video: add gst_video_decoder_allocate_output_frame_with_params
authorJulien Isorce <j.isorce@samsung.com>
Fri, 14 Oct 2016 14:14:14 +0000 (15:14 +0100)
committerJulien Isorce <j.isorce@samsung.com>
Fri, 4 Nov 2016 16:18:13 +0000 (16:18 +0000)
It adds a third argument to pass GstBufferPoolAcquireParams
to gst_buffer_pool_acquire_buffer.

If a user subclasses GstBufferPoolAcquireParams, this allows to
pass an updated param to the underlying buffer pool at each
gst_video_decoder_allocate_output_frame_with_params call.

https://bugzilla.gnome.org/show_bug.cgi?id=773165

docs/libs/gst-plugins-base-libs-sections.txt
gst-libs/gst/video/gstvideodecoder.c
gst-libs/gst/video/gstvideodecoder.h

index e82050beb0c702753a3413385c11ea3ff7ddf638..81a37d48be3c4280f6e49defbc57824020710e8a 100644 (file)
@@ -2876,6 +2876,7 @@ GstVideoDecoderClass
 gst_video_decoder_add_to_frame
 gst_video_decoder_allocate_output_buffer
 gst_video_decoder_allocate_output_frame
+gst_video_decoder_allocate_output_frame_full
 gst_video_decoder_get_allocator
 gst_video_decoder_get_buffer_pool
 gst_video_decoder_drop_frame
index eb9dd298208ee0ab96c0deebd3bec139996d9341..4b9209caacf86f0d2bc91d92632f0e26ebb68ed9 100644 (file)
@@ -3955,6 +3955,27 @@ failed_allocation:
 GstFlowReturn
 gst_video_decoder_allocate_output_frame (GstVideoDecoder *
     decoder, GstVideoCodecFrame * frame)
+{
+  return gst_video_decoder_allocate_output_frame_with_params (decoder, frame,
+      NULL);
+}
+
+/**
+ * gst_video_decoder_allocate_output_frame_with_params:
+ * @decoder: a #GstVideoDecoder
+ * @frame: a #GstVideoCodecFrame
+ * @params: a #GstBufferPoolAcquireParams
+ *
+ * Same as #gst_video_decoder_allocate_output_frame except it allows passing
+ * #GstBufferPoolAcquireParams to the sub call gst_buffer_pool_acquire_buffer.
+ *
+ * Returns: %GST_FLOW_OK if an output buffer could be allocated
+ *
+ * Since: 1.12
+ */
+GstFlowReturn
+gst_video_decoder_allocate_output_frame_with_params (GstVideoDecoder *
+    decoder, GstVideoCodecFrame * frame, GstBufferPoolAcquireParams * params)
 {
   GstFlowReturn flow_ret;
   GstVideoCodecState *state;
@@ -3988,7 +4009,7 @@ gst_video_decoder_allocate_output_frame (GstVideoDecoder *
   GST_LOG_OBJECT (decoder, "alloc buffer size %d", num_bytes);
 
   flow_ret = gst_buffer_pool_acquire_buffer (decoder->priv->pool,
-      &frame->output_buffer, NULL);
+      &frame->output_buffer, params);
 
   GST_VIDEO_DECODER_STREAM_UNLOCK (decoder);
 
index 02e6753851e4fb728b79e69ac7ed69dce4f30990..b314c4f29751ace3fa9e57448e9146f71c26e30f 100644 (file)
@@ -391,6 +391,9 @@ gsize          gst_video_decoder_get_pending_frame_size (GstVideoDecoder *decode
 
 GstBuffer     *gst_video_decoder_allocate_output_buffer (GstVideoDecoder * decoder);
 
+GstFlowReturn  gst_video_decoder_allocate_output_frame_with_params (GstVideoDecoder *decoder,
+                                                                    GstVideoCodecFrame * frame,
+                                                                    GstBufferPoolAcquireParams *params);
 GstFlowReturn  gst_video_decoder_allocate_output_frame  (GstVideoDecoder *decoder,
                                                         GstVideoCodecFrame *frame);