mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
v4l2object: Ask for a decent buffer size when dealing with encoded formats
https://bugzilla.gnome.org/show_bug.cgi?id=720568
This commit is contained in:
parent
86646ce03b
commit
0c8ec43a12
1 changed files with 10 additions and 0 deletions
|
@ -74,6 +74,8 @@ GST_DEBUG_CATEGORY_EXTERN (GST_CAT_PERFORMANCE);
|
|||
#define DEFAULT_PROP_FREQUENCY 0
|
||||
#define DEFAULT_PROP_IO_MODE GST_V4L2_IO_AUTO
|
||||
|
||||
#define ENCODED_BUFFER_SIZE (1 * 1024 * 1024)
|
||||
|
||||
enum
|
||||
{
|
||||
PROP_0,
|
||||
|
@ -2656,6 +2658,10 @@ gst_v4l2_object_set_format (GstV4l2Object * v4l2object, GstCaps * caps)
|
|||
format.fmt.pix_mp.plane_fmt[i].bytesperline =
|
||||
v4l2object->bytesperline[i];
|
||||
|
||||
if (GST_VIDEO_INFO_FORMAT (&info) == GST_VIDEO_FORMAT_ENCODED) {
|
||||
format.fmt.pix_mp.plane_fmt[0].sizeimage = ENCODED_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
if (v4l2_ioctl (fd, VIDIOC_S_FMT, &format) < 0)
|
||||
goto set_fmt_failed;
|
||||
|
||||
|
@ -2719,6 +2725,10 @@ gst_v4l2_object_set_format (GstV4l2Object * v4l2object, GstCaps * caps)
|
|||
/* try to ask our prefered stride */
|
||||
format.fmt.pix.bytesperline = v4l2object->bytesperline[0];
|
||||
|
||||
if (GST_VIDEO_INFO_FORMAT (&info) == GST_VIDEO_FORMAT_ENCODED) {
|
||||
format.fmt.pix.sizeimage = ENCODED_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
if (v4l2_ioctl (fd, VIDIOC_S_FMT, &format) < 0)
|
||||
goto set_fmt_failed;
|
||||
|
||||
|
|
Loading…
Reference in a new issue