mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-11 09:55:36 +00:00
v4l2codecs: gstv4l2decoder: set minimum sizeimage
Set minimum sizeimage such that there is enough space for any overhead introduced by the codec. Notably fix a vp9 issue in which a small image would not have a bitstream buffer large enough to accomodate it. Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1012>
This commit is contained in:
parent
120b96a974
commit
285695ee52
1 changed files with 4 additions and 1 deletions
|
@ -36,6 +36,8 @@
|
||||||
|
|
||||||
#include <gst/base/base.h>
|
#include <gst/base/base.h>
|
||||||
|
|
||||||
|
#define IMAGE_MINSZ 4096
|
||||||
|
|
||||||
GST_DEBUG_CATEGORY (v4l2_decoder_debug);
|
GST_DEBUG_CATEGORY (v4l2_decoder_debug);
|
||||||
#define GST_CAT_DEFAULT v4l2_decoder_debug
|
#define GST_CAT_DEFAULT v4l2_decoder_debug
|
||||||
|
|
||||||
|
@ -324,8 +326,9 @@ gst_v4l2_decoder_set_sink_fmt (GstV4l2Decoder * self, guint32 pix_fmt,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
gint ret;
|
gint ret;
|
||||||
|
|
||||||
/* Using raw image size for now, it is guarantied to be large enough */
|
/* Using raw image size for now, it is guarantied to be large enough */
|
||||||
gsize sizeimage = (width * height * pixel_bitdepth) / 8;
|
gsize sizeimage = MAX (IMAGE_MINSZ, (width * height * pixel_bitdepth) / 8);
|
||||||
|
|
||||||
if (self->mplane)
|
if (self->mplane)
|
||||||
format.fmt.pix_mp.plane_fmt[0].sizeimage = sizeimage;
|
format.fmt.pix_mp.plane_fmt[0].sizeimage = sizeimage;
|
||||||
|
|
Loading…
Reference in a new issue