Commit 84e234a8 authored by Haihao Xiang's avatar Haihao Xiang

msdkenc: add set_extra_params virtual method

set_extra_params is added to allow sub class to add extra mfx parameters
for changed input frame or meta data
parent 0e2fc39f
......@@ -1383,6 +1383,8 @@ gst_msdkenc_handle_frame (GstVideoEncoder * encoder, GstVideoCodecFrame * frame)
gst_msdkenc_flush_frames (thiz, FALSE);
gst_msdkenc_close_encoder (thiz);
klass->set_extra_params (thiz, frame);
// This will reinitialized the encoder but keep same input format.
gst_msdkenc_set_format (encoder, NULL);
}
......@@ -1683,6 +1685,12 @@ gst_msdkenc_need_reconfig (GstMsdkEnc * encoder, GstVideoCodecFrame * frame)
return FALSE;
}
static void
gst_msdkenc_set_extra_params (GstMsdkEnc * encoder, GstVideoCodecFrame * frame)
{
/* Do nothing */
}
static void
gst_msdkenc_class_init (GstMsdkEncClass * klass)
{
......@@ -1696,6 +1704,7 @@ gst_msdkenc_class_init (GstMsdkEncClass * klass)
klass->need_conversion = gst_msdkenc_need_conversion;
klass->need_reconfig = gst_msdkenc_need_reconfig;
klass->set_extra_params = gst_msdkenc_set_extra_params;
gobject_class->finalize = gst_msdkenc_finalize;
......
......@@ -177,6 +177,9 @@ struct _GstMsdkEncClass
/* Return TRUE if sub class requires a recofnig */
gboolean (*need_reconfig) (GstMsdkEnc * encoder, GstVideoCodecFrame * frame);
/* Allow sub class set extra frame parameters */
void (*set_extra_params) (GstMsdkEnc * encoder, GstVideoCodecFrame * frame);
};
struct _MsdkEncTask
......
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