summaryrefslogtreecommitdiff
path: root/src/dxr3/dxr3_decode_video.c
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2004-01-04 22:26:28 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2004-01-04 22:26:28 +0000
commitb831c841f570dde9092dfbbf1fc4a40f8b5c301c (patch)
tree49eb53dbbc44ea6ab82042f1f0ae471fdc7141c9 /src/dxr3/dxr3_decode_video.c
parent5d919982e44bae40e8f9f0c57713b870e7a96582 (diff)
downloadxine-lib-b831c841f570dde9092dfbbf1fc4a40f8b5c301c.tar.gz
xine-lib-b831c841f570dde9092dfbbf1fc4a40f8b5c301c.tar.bz2
The most important change is the smallest:
* add a small delay before enabling zoom mode, since the card gets confused when we activate zoom mode before the first frame (that's also what the ChangeLog entry accounts for) Then some less important changes: * give a hint about sync mode to the SCR plugin to properly recover the mode when resuming from pause mode * refactor the enhanced mode handling out of the MPEG encoders into video out * inline some decoder functions, because they are only used once anyway * some additional cleanup CVS patchset: 5996 CVS date: 2004/01/04 22:26:28
Diffstat (limited to 'src/dxr3/dxr3_decode_video.c')
-rw-r--r--src/dxr3/dxr3_decode_video.c34
1 files changed, 20 insertions, 14 deletions
diff --git a/src/dxr3/dxr3_decode_video.c b/src/dxr3/dxr3_decode_video.c
index 4b6c2f339..2f1f4c2ae 100644
--- a/src/dxr3/dxr3_decode_video.c
+++ b/src/dxr3/dxr3_decode_video.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: dxr3_decode_video.c,v 1.49 2003/12/14 22:13:22 siggi Exp $
+ * $Id: dxr3_decode_video.c,v 1.50 2004/01/04 22:26:28 mroi Exp $
*/
/* dxr3 video decoder plugin.
@@ -136,10 +136,10 @@ typedef struct dxr3_decoder_s {
} dxr3_decoder_t;
/* helper functions */
-static int dxr3_present(xine_stream_t *stream);
-static int dxr3_mvcommand(int fd_control, int command);
-static void parse_mpeg_header(dxr3_decoder_t *this, uint8_t *buffer);
-static int get_duration(dxr3_decoder_t *this);
+static inline int dxr3_present(xine_stream_t *stream);
+static inline int dxr3_mvcommand(int fd_control, int command);
+static inline void parse_mpeg_header(dxr3_decoder_t *this, uint8_t *buffer);
+static inline int get_duration(dxr3_decoder_t *this);
/* config callbacks */
static void dxr3_update_sync_mode(void *this_gen, xine_cfg_entry_t *entry);
@@ -428,6 +428,9 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf)
#endif
dxr3_mvcommand(this->fd_control, MVCOMMAND_SYNC);
this->resync_window = -RESYNC_WINDOW_SIZE;
+ pthread_mutex_lock(&this->scr->mutex);
+ this->scr->sync = 1;
+ pthread_mutex_unlock(&this->scr->mutex);
}
if (this->resync_window != 0 && this->resync_window > -RESYNC_WINDOW_SIZE)
this->resync_window--;
@@ -459,6 +462,9 @@ static void dxr3_decode_data(video_decoder_t *this_gen, buf_element_t *buf)
#endif
dxr3_mvcommand(this->fd_control, MVCOMMAND_START);
this->resync_window = RESYNC_WINDOW_SIZE;
+ pthread_mutex_lock(&this->scr->mutex);
+ this->scr->sync = 0;
+ pthread_mutex_unlock(&this->scr->mutex);
}
if (this->resync_window != 0 && this->resync_window < RESYNC_WINDOW_SIZE)
this->resync_window++;
@@ -638,7 +644,7 @@ static void dxr3_dispose(video_decoder_t *this_gen)
}
-static int dxr3_present(xine_stream_t *stream)
+static inline int dxr3_present(xine_stream_t *stream)
{
plugin_node_t *node;
video_driver_class_t *vo_class;
@@ -658,18 +664,18 @@ static int dxr3_present(xine_stream_t *stream)
return present;
}
-static int dxr3_mvcommand(int fd_control, int command)
+static inline int dxr3_mvcommand(int fd_control, int command)
{
- em8300_register_t regs;
+ em8300_register_t reg;
- regs.microcode_register = 1;
- regs.reg = 0;
- regs.val = command;
+ reg.microcode_register = 1;
+ reg.reg = 0;
+ reg.val = command;
- return ioctl(fd_control, EM8300_IOCTL_WRITEREG, &regs);
+ return ioctl(fd_control, EM8300_IOCTL_WRITEREG, &reg);
}
-static void parse_mpeg_header(dxr3_decoder_t *this, uint8_t * buffer)
+static inline void parse_mpeg_header(dxr3_decoder_t *this, uint8_t * buffer)
{
this->frame_rate_code = buffer[3] & 15;
this->height = (buffer[0] << 16) |
@@ -727,7 +733,7 @@ static void parse_mpeg_header(dxr3_decoder_t *this, uint8_t * buffer)
}
}
-static int get_duration(dxr3_decoder_t *this)
+static inline int get_duration(dxr3_decoder_t *this)
{
int duration;