#endif
#include <gst/gst.h>
+#include <gst/video/gstvideometa.h>
+#include <gst/video/gstvideopool.h>
#include <string.h>
#include "gstomxvideodec.h"
static GstFlowReturn gst_omx_video_dec_handle_frame (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame);
static GstFlowReturn gst_omx_video_dec_finish (GstVideoDecoder * decoder);
+static gboolean gst_omx_video_dec_decide_allocation (GstVideoDecoder * bdec,
+ GstQuery * query);
static GstFlowReturn gst_omx_video_dec_drain (GstOMXVideoDec * self,
gboolean is_eos);
video_decoder_class->handle_frame =
GST_DEBUG_FUNCPTR (gst_omx_video_dec_handle_frame);
video_decoder_class->finish = GST_DEBUG_FUNCPTR (gst_omx_video_dec_finish);
+ video_decoder_class->decide_allocation =
+ GST_DEBUG_FUNCPTR (gst_omx_video_dec_decide_allocation);
klass->cdata.default_src_template_caps = "video/x-raw, "
"width = " GST_VIDEO_SIZE_RANGE ", "
return GST_FLOW_OK;
}
+
+static gboolean
+gst_omx_video_dec_decide_allocation (GstVideoDecoder * bdec, GstQuery * query)
+{
+ GstBufferPool *pool;
+ GstStructure *config;
+
+ if (!GST_VIDEO_DECODER_CLASS
+ (gst_omx_video_dec_parent_class)->decide_allocation (bdec, query))
+ return FALSE;
+
+ g_assert (gst_query_get_n_allocation_pools (query) > 0);
+ gst_query_parse_nth_allocation_pool (query, 0, &pool, NULL, NULL, NULL);
+ g_assert (pool != NULL);
+
+ config = gst_buffer_pool_get_config (pool);
+ if (gst_query_find_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL)) {
+ gst_buffer_pool_config_add_option (config,
+ GST_BUFFER_POOL_OPTION_VIDEO_META);
+ }
+ gst_buffer_pool_set_config (pool, config);
+ gst_object_unref (pool);
+
+ return TRUE;
+}
#endif
#include <gst/gst.h>
+#include <gst/video/gstvideometa.h>
#include <string.h>
#include "gstomxvideoenc.h"
static GstFlowReturn gst_omx_video_enc_handle_frame (GstVideoEncoder * encoder,
GstVideoCodecFrame * frame);
static gboolean gst_omx_video_enc_finish (GstVideoEncoder * encoder);
+static gboolean gst_omx_video_enc_propose_allocation (GstVideoEncoder * encoder,
+ GstQuery * query);
static GstFlowReturn gst_omx_video_enc_drain (GstOMXVideoEnc * self,
gboolean at_eos);
video_encoder_class->handle_frame =
GST_DEBUG_FUNCPTR (gst_omx_video_enc_handle_frame);
video_encoder_class->finish = GST_DEBUG_FUNCPTR (gst_omx_video_enc_finish);
+ video_encoder_class->propose_allocation =
+ GST_DEBUG_FUNCPTR (gst_omx_video_enc_propose_allocation);
klass->cdata.default_sink_template_caps = "video/x-raw, "
"width = " GST_VIDEO_SIZE_RANGE ", "
return GST_FLOW_OK;
}
+
+static gboolean
+gst_omx_video_enc_propose_allocation (GstVideoEncoder * encoder,
+ GstQuery * query)
+{
+ gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, NULL);
+
+ return
+ GST_VIDEO_ENCODER_CLASS
+ (gst_omx_video_enc_parent_class)->propose_allocation (encoder, query);
+}