Commit 70bfd34b authored by U. Artie Eoff's avatar U. Artie Eoff Committed by Víctor Manuel Jáquez Leal

msdkdec: add post_configure virtual method

A post_configure virtual method is added to allow
codec subclasses to adjust the initialized parameters
after MFXVideoDECODE_DecodeHeader is called from the
gstmsdkdec::gst_msdkdec_handle_frame function.

This is useful if codecs want to adjust the output
parameters based on the codec-specific decoding
options that are present in the mfxInfoMFX structure
after MFXVideoDECODE_DecodeHeader initializes them.
parent 6117a2c6
...@@ -926,6 +926,11 @@ gst_msdkdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame) ...@@ -926,6 +926,11 @@ gst_msdkdec_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame)
goto done; goto done;
} }
if (!klass->post_configure (thiz)) {
flow = GST_FLOW_ERROR;
goto error;
}
if (!thiz->initialized) if (!thiz->initialized)
hard_reset = TRUE; hard_reset = TRUE;
else if (thiz->allocation_caps) { else if (thiz->allocation_caps) {
...@@ -1453,6 +1458,13 @@ gst_msdkdec_finalize (GObject * object) ...@@ -1453,6 +1458,13 @@ gst_msdkdec_finalize (GObject * object)
g_object_unref (thiz->adapter); g_object_unref (thiz->adapter);
} }
static gboolean
gst_msdkdec_post_configure (GstMsdkDec * decoder)
{
/* Do nothing */
return TRUE;
}
static gboolean static gboolean
gst_msdkdec_preinit_decoder (GstMsdkDec * decoder) gst_msdkdec_preinit_decoder (GstMsdkDec * decoder)
{ {
...@@ -1503,6 +1515,7 @@ gst_msdkdec_class_init (GstMsdkDecClass * klass) ...@@ -1503,6 +1515,7 @@ gst_msdkdec_class_init (GstMsdkDecClass * klass)
decoder_class->flush = GST_DEBUG_FUNCPTR (gst_msdkdec_flush); decoder_class->flush = GST_DEBUG_FUNCPTR (gst_msdkdec_flush);
decoder_class->drain = GST_DEBUG_FUNCPTR (gst_msdkdec_drain); decoder_class->drain = GST_DEBUG_FUNCPTR (gst_msdkdec_drain);
klass->post_configure = GST_DEBUG_FUNCPTR (gst_msdkdec_post_configure);
klass->preinit_decoder = GST_DEBUG_FUNCPTR (gst_msdkdec_preinit_decoder); klass->preinit_decoder = GST_DEBUG_FUNCPTR (gst_msdkdec_preinit_decoder);
klass->postinit_decoder = GST_DEBUG_FUNCPTR (gst_msdkdec_postinit_decoder); klass->postinit_decoder = GST_DEBUG_FUNCPTR (gst_msdkdec_postinit_decoder);
......
...@@ -108,6 +108,9 @@ struct _GstMsdkDecClass ...@@ -108,6 +108,9 @@ struct _GstMsdkDecClass
gboolean (*configure) (GstMsdkDec * decoder); gboolean (*configure) (GstMsdkDec * decoder);
/* adjust mfx parameters per codec after decode header */
gboolean (*post_configure) (GstMsdkDec * decoder);
/* reset mfx parameters per codec */ /* reset mfx parameters per codec */
gboolean (*preinit_decoder) (GstMsdkDec * decoder); gboolean (*preinit_decoder) (GstMsdkDec * decoder);
/* adjust mfx parameters per codec */ /* adjust mfx parameters per codec */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment