v4l2src: Fix using mpegts via the mmap interface

MPEG doesn't have a static size per frame, so don't pretend it has one
and fail when capturing because it doesn't match. Instead mark the size
as unknown and let the read frame grabbing method use a reasonable fallback
value (assuming that's only for actual streaming formats)

Fixes bug #628349.
This commit is contained in:
Sjoerd Simons 2010-08-30 18:36:54 +01:00 committed by Sebastian Dröge
parent 8fa6504d34
commit 74d7521a7c
2 changed files with 4 additions and 1 deletions

View file

@ -1215,7 +1215,6 @@ gst_v4l2_object_get_caps_info (GstV4l2Object * v4l2object, GstCaps * caps,
if (strcmp (mimetype, "video/mpegts") == 0) {
fourcc = V4L2_PIX_FMT_MPEG;
outsize = 8192;
*fps_n = 0;
*fps_d = 1;
goto done;

View file

@ -800,6 +800,10 @@ gst_v4l2src_get_read (GstV4l2Src * v4l2src, GstBuffer ** buf)
gint buffersize;
buffersize = v4l2src->frame_byte_size;
/* In case the size per frame is unknown assume it's a streaming format (e.g.
* mpegts) and grab a reasonable default size instead */
if (buffersize == 0)
buffersize = 8192;
*buf = gst_buffer_new_and_alloc (buffersize);