summaryrefslogtreecommitdiff
path: root/ext/x264/gstx264enc.c
diff options
context:
space:
mode:
authorNicolas Dufresne <nicolas.dufresne@collabora.com>2014-07-08 16:45:45 -0400
committerNicolas Dufresne <nicolas.dufresne@collabora.co.uk>2014-07-25 14:29:21 -0400
commit8aea88d2616c3be8dd30a883534031d832872c9c (patch)
tree8f6c2831014d6de851086ccd9de018c8601275c7 /ext/x264/gstx264enc.c
parent698714fc9781c614ea5d65744508d5db73f16066 (diff)
x264enc: Request buffers in allocation query
https://bugzilla.gnome.org/show_bug.cgi?id=732288
Diffstat (limited to 'ext/x264/gstx264enc.c')
-rw-r--r--ext/x264/gstx264enc.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ext/x264/gstx264enc.c b/ext/x264/gstx264enc.c
index aa1e481e..3b67cdab 100644
--- a/ext/x264/gstx264enc.c
+++ b/ext/x264/gstx264enc.c
@@ -1920,8 +1920,21 @@ gst_x264_enc_finish (GstVideoEncoder * encoder)
static gboolean
gst_x264_enc_propose_allocation (GstVideoEncoder * encoder, GstQuery * query)
{
+ GstX264Enc *self = GST_X264_ENC (encoder);
+ GstVideoInfo *info;
+ guint num_buffers;
+
gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
+ if (!self->input_state)
+ return FALSE;
+
+ info = &self->input_state->info;
+ num_buffers = x264_encoder_maximum_delayed_frames (self->x264enc) + 1;
+
+ gst_query_add_allocation_pool (query, NULL, info->size, num_buffers,
+ num_buffers);
+
return GST_VIDEO_ENCODER_CLASS (parent_class)->propose_allocation (encoder,
query);
}