static gboolean
gst_msdkdec_init_decoder (GstMsdkDec * thiz)
{
+ GstMsdkDecClass *klass = GST_MSDKDEC_GET_CLASS (thiz);
GstVideoInfo *info;
mfxSession session;
mfxStatus status;
g_return_val_if_fail (thiz->param.mfx.FrameInfo.Width
&& thiz->param.mfx.FrameInfo.Height, FALSE);
- /* Force 32 bit rounding to avoid messing up of memory alignment when
- * dealing with different allocators */
- /* Fixme: msdk sometimes only requires 16 bit rounding, optimization possible */
- thiz->param.mfx.FrameInfo.Width =
- GST_ROUND_UP_16 (thiz->param.mfx.FrameInfo.Width);
- thiz->param.mfx.FrameInfo.Height =
- GST_ROUND_UP_32 (thiz->param.mfx.FrameInfo.Height);
+ klass->preinit_decoder (thiz);
+
/* Set framerate only if provided.
* If not, framerate will be assumed inside the driver.
* Also we respect the upstream provided fps values */
g_object_unref (thiz->adapter);
}
+static gboolean
+gst_msdkdec_preinit_decoder (GstMsdkDec * decoder)
+{
+ decoder->param.mfx.FrameInfo.Width =
+ GST_ROUND_UP_16 (decoder->param.mfx.FrameInfo.Width);
+ decoder->param.mfx.FrameInfo.Height =
+ GST_ROUND_UP_32 (decoder->param.mfx.FrameInfo.Height);
+
+ return TRUE;
+}
+
static void
gst_msdkdec_class_init (GstMsdkDecClass * klass)
{
decoder_class->flush = GST_DEBUG_FUNCPTR (gst_msdkdec_flush);
decoder_class->drain = GST_DEBUG_FUNCPTR (gst_msdkdec_drain);
+ klass->preinit_decoder = GST_DEBUG_FUNCPTR (gst_msdkdec_preinit_decoder);
+
g_object_class_install_property (gobject_class, GST_MSDKDEC_PROP_HARDWARE,
g_param_spec_boolean ("hardware", "Hardware", "Enable hardware decoders",
PROP_HARDWARE_DEFAULT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
GST_OBJECT_UNLOCK (thiz);
}
+static gboolean
+gst_msdkvp8dec_preinit_decoder (GstMsdkDec * decoder)
+{
+ decoder->param.mfx.FrameInfo.Width =
+ GST_ROUND_UP_16 (decoder->param.mfx.FrameInfo.Width);
+ decoder->param.mfx.FrameInfo.Height =
+ GST_ROUND_UP_16 (decoder->param.mfx.FrameInfo.Height);
+
+ return TRUE;
+}
+
static void
gst_msdkvp8dec_class_init (GstMsdkVP8DecClass * klass)
{
gobject_class->get_property = gst_msdkdec_vp8_get_property;
decoder_class->configure = GST_DEBUG_FUNCPTR (gst_msdkvp8dec_configure);
+ decoder_class->preinit_decoder =
+ GST_DEBUG_FUNCPTR (gst_msdkvp8dec_preinit_decoder);
gst_element_class_set_static_metadata (element_class,
"Intel MSDK VP8 decoder",
GST_OBJECT_UNLOCK (thiz);
}
+static gboolean
+gst_msdkvp9dec_preinit_decoder (GstMsdkDec * decoder)
+{
+ decoder->param.mfx.FrameInfo.Width =
+ GST_ROUND_UP_16 (decoder->param.mfx.FrameInfo.Width);
+ decoder->param.mfx.FrameInfo.Height =
+ GST_ROUND_UP_16 (decoder->param.mfx.FrameInfo.Height);
+
+ return TRUE;
+}
+
static void
gst_msdkvp9dec_class_init (GstMsdkVP9DecClass * klass)
{
gobject_class->get_property = gst_msdkdec_vp9_get_property;
decoder_class->configure = GST_DEBUG_FUNCPTR (gst_msdkvp9dec_configure);
+ decoder_class->preinit_decoder =
+ GST_DEBUG_FUNCPTR (gst_msdkvp9dec_preinit_decoder);
gst_element_class_set_static_metadata (element_class,
"Intel MSDK VP9 decoder",