mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-20 22:28:22 +00:00
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:
parent
8fa6504d34
commit
74d7521a7c
2 changed files with 4 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
Loading…
Reference in a new issue