msdk: encode: Add property to set slice/partitioning

Adding a new property num-slices to set the number of
slices/partitions per frame. Adding it as a general
property for all codecs (except jpeg).

https://bugzilla.gnome.org/show_bug.cgi?id=791637
This commit is contained in:
Sreerenj Balachandran 2018-02-14 16:27:47 +00:00
parent a165a1a1a9
commit f076f1948e
2 changed files with 4 additions and 0 deletions

View file

@ -94,6 +94,7 @@ static GstStaticPadTemplate sink_factory = GST_STATIC_PAD_TEMPLATE ("sink",
#define PROP_REF_FRAMES_DEFAULT 1
#define PROP_I_FRAMES_DEFAULT 0
#define PROP_B_FRAMES_DEFAULT 0
#define PROP_NUM_SLICES_DEFAULT 0
#define GST_MSDKENC_RATE_CONTROL_TYPE (gst_msdkenc_rate_control_get_type())
static GType
@ -293,6 +294,7 @@ gst_msdkenc_init_encoder (GstMsdkEnc * thiz)
thiz->param.mfx.GopPicSize = thiz->gop_size;
thiz->param.mfx.GopRefDist = thiz->b_frames + 1;
thiz->param.mfx.IdrInterval = thiz->i_frames;
thiz->param.mfx.NumSlice = thiz->num_slices;
thiz->param.mfx.NumRefFrame = thiz->ref_frames;
thiz->param.mfx.EncodedOrder = 0; /* Take input frames in display order */
@ -1302,6 +1304,7 @@ gst_msdkenc_init (GstMsdkEnc * thiz)
thiz->ref_frames = PROP_REF_FRAMES_DEFAULT;
thiz->i_frames = PROP_I_FRAMES_DEFAULT;
thiz->b_frames = PROP_B_FRAMES_DEFAULT;
thiz->num_slices = PROP_NUM_SLICES_DEFAULT;
}
/* gst_msdkenc_set_common_property:

View file

@ -134,6 +134,7 @@ struct _GstMsdkEnc
guint ref_frames;
guint i_frames;
guint b_frames;
guint num_slices;
gboolean reconfig;
};