summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@users.sourceforge.net>2003-02-21 19:13:15 +0000
committerBastien Nocera <hadess@users.sourceforge.net>2003-02-21 19:13:15 +0000
commit6b121d608d092d5e93cb94b9f05de2c4c9766603 (patch)
tree67025004ca41d3f5bd9f53249a0af5df1e0b744a
parent632478548ae1bc78649517698d1766bd02a0fe60 (diff)
downloadxine-lib-6b121d608d092d5e93cb94b9f05de2c4c9766603.tar.gz
xine-lib-6b121d608d092d5e93cb94b9f05de2c4c9766603.tar.bz2
- inform the width and height for the v4l input plugin, remove plenty of nasty
printf's, name the yuv_frames plugin properly CVS patchset: 4235 CVS date: 2003/02/21 19:13:15
-rw-r--r--ChangeLog2
-rw-r--r--src/demuxers/demux_yuv_frames.c11
-rw-r--r--src/input/input_v4l.c51
3 files changed, 47 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index f9091fb59..5f2762089 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,5 @@
xine-lib (1-beta6)
-
+ * inform the width and height for the v4l input plugin
xine-lib (1-beta5)
* new AV sync strategy (audio resample) for DXR3 users
diff --git a/src/demuxers/demux_yuv_frames.c b/src/demuxers/demux_yuv_frames.c
index 14772ca22..11fd33536 100644
--- a/src/demuxers/demux_yuv_frames.c
+++ b/src/demuxers/demux_yuv_frames.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: demux_yuv_frames.c,v 1.3 2003/01/26 15:56:21 tmmm Exp $
+ * $Id: demux_yuv_frames.c,v 1.4 2003/02/21 19:13:17 hadess Exp $
*
* dummy demultiplexer for raw yuv frames (delivered by v4l)
*
@@ -88,9 +88,10 @@ static int demux_yuv_frames_send_chunk (demux_plugin_t *this_gen) {
this->video_fifo->put (this->video_fifo, buf);
break;
default:
+#ifdef LOG
printf ("demux_yuv_frames: help, unknown buffer type %08x\n",
buf->type);
-
+#endif
buf->free_buffer (buf);
}
}
@@ -172,9 +173,9 @@ static demux_plugin_t *open_plugin (demux_class_t *class_gen,
default:
return NULL;
}
-
+#ifdef LOG
printf ("demux_yuv_frames: input accepted.\n");
-
+#endif
/*
* if we reach this point, the input has been accepted.
*/
@@ -253,6 +254,6 @@ static void *init_class (xine_t *xine, void *data) {
plugin_info_t xine_plugin_info[] = {
/* type, API, "name", version, special_info, init_function */
- { PLUGIN_DEMUX, 20, "ogg", XINE_VERSION_CODE, NULL, init_class },
+ { PLUGIN_DEMUX, 20, "yuv_frames", XINE_VERSION_CODE, NULL, init_class },
{ PLUGIN_NONE, 0, "", 0, NULL, NULL }
};
diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c
index 1c32351b2..09fd00486 100644
--- a/src/input/input_v4l.c
+++ b/src/input/input_v4l.c
@@ -182,10 +182,15 @@ static buf_element_t *v4l_plugin_read_block (input_plugin_t *this_gen,
while (ioctl(this->video_fd, VIDIOCMCAPTURE, &this->gb_buf) < 0) {
+#ifdef LOG
printf("input_v4l: upper while loop\n");
- if (errno == EAGAIN)
+#endif
+ if (errno == EAGAIN) {
+#ifdef LOG
printf ("input_v4l: cannot sync\n");
- else {
+#endif
+ continue;
+ } else {
perror("VIDIOCMCAPTURE");
return NULL;
}
@@ -196,7 +201,9 @@ static buf_element_t *v4l_plugin_read_block (input_plugin_t *this_gen,
while (ioctl(this->video_fd, VIDIOCSYNC, &this->gb_frame) < 0 &&
(errno == EAGAIN || errno == EINTR))
{
+#ifdef LOG
printf("input_v4l: waiting for videosync\n");
+#endif
}
if (this->start_time == 0)
@@ -280,8 +287,8 @@ static int v4l_plugin_get_optional_data (input_plugin_t *this_gen,
}
-static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *stream,
- const char *data) {
+static input_plugin_t *open_plugin (input_class_t *cls_gen,
+ xine_stream_t *stream, const char *data) {
/* v4l_input_class_t *cls = (v4l_input_class_t *) cls_gen; */
v4l_input_plugin_t *this;
@@ -311,19 +318,25 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea
this->video_fd = open("/dev/video0", O_RDWR);
if (this->video_fd < 0) {
+#ifdef LOG
printf ("input_v4l: cannot open v4l device\n");
+#endif
free(this);
return NULL;
}
if (ioctl(this->video_fd,VIDIOCGCAP,&this->video_cap) < 0) {
+#ifdef LOG
printf ("input_v4l: VIDIOCGCAP ioctl went wrong\n");
+#endif
free(this);
return NULL;
}
if (!(this->video_cap.type & VID_TYPE_CAPTURE)) {
+#ifdef LOG
printf ("input_v4l: grab device does not handle capture\n");
+#endif
free(this);
return NULL;
}
@@ -342,7 +355,9 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea
if (found == 0 || resolutions[j].width < this->video_cap.minwidth
|| resolutions[j].height < this->video_cap.minheight)
{
+#ifdef LOG
printf ("input_v4l: grab device does not support any preset resolutions");
+#endif
free(this);
return NULL;
}
@@ -395,13 +410,20 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea
if (ret < 0) {
close (this->video_fd);
this->video_fd = -1;
+#ifdef LOG
printf ("input_v4l: grab: no colorspace format found\n");
+#endif
return 0;
- } else
+ }
+#ifdef LOG
+ else
printf ("input_v4l: grab: format YUV 4:2:2\n");
- } else
+#endif
+ }
+#ifdef LOG
+ else
printf ("input_v4l: grab: format YUV 4:2:0\n");
-
+#endif
this->frame_format = pict.palette;
val = 1;
@@ -410,9 +432,9 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea
this->use_mmap = 0;
} else {
-
+#ifdef LOG
printf ("input_v4l: using mmap, size %d\n", this->gb_buffers.size);
-
+#endif
this->video_buf = mmap(0, this->gb_buffers.size,
PROT_READ|PROT_WRITE, MAP_SHARED,
this->video_fd,0);
@@ -436,15 +458,19 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea
this->gb_buf.format = VIDEO_PALETTE_YUV422;
ret = ioctl(this->video_fd, VIDIOCMCAPTURE, &this->gb_buf);
- } else
+ }
+#ifdef LOG
+ else
printf ("input_v4l: YUV420 should work\n");
-
+#endif
if (ret < 0) {
+#ifdef LOG
if (errno != EAGAIN) {
printf("input_v4l: grab device does not support suitable format\n");
} else {
printf("input_v4l: grab device does not receive any video signal\n");
}
+#endif
close (this->video_fd);
free (this);
return NULL;
@@ -462,6 +488,9 @@ static input_plugin_t *open_plugin (input_class_t *cls_gen, xine_stream_t *strea
break;
}
+ stream->stream_info[XINE_STREAM_INFO_VIDEO_WIDTH] = resolutions[j].width;
+ stream->stream_info[XINE_STREAM_INFO_VIDEO_HEIGHT] = resolutions[j].height;
+
this->start_time=0;
this->input_plugin.get_capabilities = v4l_plugin_get_capabilities;