summaryrefslogtreecommitdiff
path: root/src/dxr3/dxr3_decoder.c
diff options
context:
space:
mode:
authorHarm van der Heijden <hrm@users.sourceforge.net>2001-12-16 19:05:44 +0000
committerHarm van der Heijden <hrm@users.sourceforge.net>2001-12-16 19:05:44 +0000
commit88584e824dc4d0a4a250574f274d7f999d83d36d (patch)
tree8f4554a385675fe9ca30f09bd5e5f89ce6752c57 /src/dxr3/dxr3_decoder.c
parentd40c02ae2a3ccd4c884dab7ff35579228ae138a9 (diff)
downloadxine-lib-88584e824dc4d0a4a250574f274d7f999d83d36d.tar.gz
xine-lib-88584e824dc4d0a4a250574f274d7f999d83d36d.tar.bz2
merged dxr3 and dxr3enc drivers. Will autmatically use hardware mpeg
decoding if using the dxr3 decoder plugin, uses on-the-fly mpeg encoding otherwise (provided encoding support is compiled in). some remarks: - dxr3enc is no more. I've added some transition code in loadplugins.c (look for the IGNORE_DXR3ENC) to prevent loading a stale dxr3enc plugin from a previous install and to print a message if someone tries to run xine -V dxr3enc. - small updates to configure.in and _xine.m4. Mostly about the messages, no new checks or anything. - both dxr3_vo_standard.c and dxr3_vo_encoder.c are no more. The one and only dxr3 video out driver is aptly named dxr3_video_out.c CVS patchset: 1256 CVS date: 2001/12/16 19:05:44
Diffstat (limited to 'src/dxr3/dxr3_decoder.c')
-rw-r--r--src/dxr3/dxr3_decoder.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/src/dxr3/dxr3_decoder.c b/src/dxr3/dxr3_decoder.c
index 085221203..c3adeb6e8 100644
--- a/src/dxr3/dxr3_decoder.c
+++ b/src/dxr3/dxr3_decoder.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_decoder.c,v 1.43 2001/12/15 20:56:21 hrm Exp $
+ * $Id: dxr3_decoder.c,v 1.44 2001/12/16 19:05:44 hrm Exp $
*
* dxr3 video and spu decoder plugin. Accepts the video and spu data
* from XINE and sends it directly to the corresponding dxr3 devices.
@@ -318,9 +318,10 @@ static void dxr3_init (video_decoder_t *this_gen, vo_instance_t *video_out)
/* open video device */
snprintf (tmpstr, sizeof(tmpstr), "%s_mv", devname);
if ((this->fd_video = open (tmpstr, O_WRONLY)) < 0) {
- printf("dxr3: Failed to open video device %s (%s)\n",
- tmpstr, strerror(errno));
- return;
+ /* printf("dxr3: Failed to open video device %s (%s)\n",
+ tmpstr, strerror(errno)); */
+ /* it's possible that the dxr3 video out plugin still
+ * has it. We try again before writing */
}
if ((this->fd_control = open (devname, O_WRONLY)) < 0) {
@@ -490,7 +491,7 @@ static void dxr3_decode_data (video_decoder_t *this_gen, buf_element_t *buf)
this->aspect,
IMGFMT_YV12,
this->duration,
- VO_BOTH_FIELDS);
+ DXR3_VO_UPDATE_FLAG);
/* copy PTS from buffer to img, img->draw uses it.
leaving img->SCR alone seems to work best */
if (buf->type != BUF_VIDEO_FILL) {
@@ -529,7 +530,8 @@ static void dxr3_decode_data (video_decoder_t *this_gen, buf_element_t *buf)
{
this->last_pts = vpts;
/* update the dxr3's current pts value */
- if (ioctl(this->fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vpts)) {
+ if (this->fd_video >= 0 &&
+ ioctl(this->fd_video, EM8300_IOCTL_VIDEO_SETPTS, &vpts)) {
printf("dxr3: set video pts failed (%s)\n",
strerror(errno));
}
@@ -544,7 +546,17 @@ static void dxr3_decode_data (video_decoder_t *this_gen, buf_element_t *buf)
/* if the dxr3_alt_play option is used, change the dxr3 playmode */
if(this->enhanced_mode && !scanning_mode)
dxr3_mvcommand(this->fd_control, 6);
-
+
+ /* ensure video device is open */
+ if (this->fd_video < 0) {
+ char tmpstr[128];
+ snprintf (tmpstr, sizeof(tmpstr), "%s_mv", devname);
+ if ((this->fd_video = open (tmpstr, O_WRONLY)) < 0) {
+ printf("dxr3: Failed to open video device %s (%s)\n",
+ tmpstr, strerror(errno));
+ return;
+ }
+ }
/* now write the content to the dxr3 mpeg device and, in a dramatic
break with open source tradition, check the return value */
written = write(this->fd_video, buf->content, buf->size);
@@ -566,8 +578,9 @@ static void dxr3_close (video_decoder_t *this_gen)
this->video_decoder.metronom->unregister_scr(
this->video_decoder.metronom, this->scr);
- close(this->fd_video);
- this->fd_video = 0;
+ if (this->fd_video >= 0)
+ close(this->fd_video);
+ this->fd_video = -1;
this->video_out->close(this->video_out);
}