mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
omxvideoenc: ensure enough buffers are allocated in the pool
Handle allocation query and ensure enough buffers are allocated in the negotiated pool. This help preventing buffer starvation in the pipeline. https://bugzilla.gnome.org/show_bug.cgi?id=785122
This commit is contained in:
parent
136714c6ed
commit
3f5d98a360
1 changed files with 10 additions and 0 deletions
|
@ -1775,8 +1775,18 @@ static gboolean
|
||||||
gst_omx_video_enc_propose_allocation (GstVideoEncoder * encoder,
|
gst_omx_video_enc_propose_allocation (GstVideoEncoder * encoder,
|
||||||
GstQuery * query)
|
GstQuery * query)
|
||||||
{
|
{
|
||||||
|
GstOMXVideoEnc *self = GST_OMX_VIDEO_ENC (encoder);
|
||||||
|
guint num_buffers;
|
||||||
|
gsize size = self->input_state->info.size;
|
||||||
|
|
||||||
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
|
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
|
||||||
|
|
||||||
|
num_buffers = self->enc_in_port->port_def.nBufferCountMin + 1;
|
||||||
|
GST_DEBUG_OBJECT (self,
|
||||||
|
"request at least %d buffers of size %" G_GSIZE_FORMAT, num_buffers,
|
||||||
|
size);
|
||||||
|
gst_query_add_allocation_pool (query, NULL, size, num_buffers, 0);
|
||||||
|
|
||||||
return
|
return
|
||||||
GST_VIDEO_ENCODER_CLASS
|
GST_VIDEO_ENCODER_CLASS
|
||||||
(gst_omx_video_enc_parent_class)->propose_allocation (encoder, query);
|
(gst_omx_video_enc_parent_class)->propose_allocation (encoder, query);
|
||||||
|
|
Loading…
Reference in a new issue