mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-10 17:35:59 +00:00
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
This commit is contained in:
parent
0e2fc39f24
commit
84e234a8c7
2 changed files with 12 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue