return TRUE;
}
+ /* This may indirectly set *context_ptr, see function body */
_gst_context_query (element, GST_MSDK_CONTEXT_TYPE_NAME);
if (*context_ptr)
if (!gst_msdk_context_find (GST_ELEMENT_CAST (thiz), &thiz->context))
return FALSE;
+ if (thiz->context == thiz->old_context) {
+ GST_INFO_OBJECT (thiz, "Found old context %" GST_PTR_FORMAT
+ ", reusing as-is", thiz->context);
+ return TRUE;
+ }
+
/* TODO: Currently d3d allocator is not implemented.
* So decoder uses system memory by default on Windows.
*/
thiz->context);
}
+ /* Save the current context in a separate field so that we know whether it
+ * has changed between calls to _start() */
+ gst_object_replace ((GstObject **) & thiz->old_context,
+ (GstObject *) thiz->context);
+
gst_msdk_context_add_shared_async_depth (thiz->context, thiz->async_depth);
return TRUE;
/* MFX context */
GstMsdkContext *context;
+ GstMsdkContext *old_context;
mfxVideoParam param;
GArray *tasks;
guint next_task;
if (!gst_msdk_context_find (GST_ELEMENT_CAST (thiz), &thiz->context))
return FALSE;
+ if (thiz->context == thiz->old_context) {
+ GST_INFO_OBJECT (thiz, "Found old context %" GST_PTR_FORMAT
+ ", reusing as-is", thiz->context);
+ return TRUE;
+ }
+
GST_INFO_OBJECT (thiz, "Found context %" GST_PTR_FORMAT " from neighbour",
thiz->context);
thiz->context);
}
+ /* Save the current context in a separate field so that we know whether it
+ * has changed between calls to _start() */
+ gst_object_replace ((GstObject **) & thiz->old_context,
+ (GstObject *) thiz->context);
+
gst_msdk_context_add_shared_async_depth (thiz->context, thiz->async_depth);
/* Set the minimum pts to some huge value (1000 hours). This keeps
gst_clear_object (&thiz->msdk_pool);
gst_clear_object (&thiz->msdk_converted_pool);
+ gst_clear_object (&thiz->old_context);
G_OBJECT_CLASS (parent_class)->finalize (object);
}
/* MFX context */
GstMsdkContext *context;
+ GstMsdkContext *old_context;
mfxVideoParam param;
guint num_surfaces;
guint num_tasks;
if (!gst_msdk_context_find (GST_ELEMENT_CAST (thiz), &thiz->context))
return FALSE;
+ if (thiz->context == thiz->old_context) {
+ GST_INFO_OBJECT (thiz, "Found old context %" GST_PTR_FORMAT
+ ", reusing as-is", thiz->context);
+ return TRUE;
+ }
+
GST_INFO_OBJECT (thiz, "Found context %" GST_PTR_FORMAT " from neighbour",
thiz->context);
thiz->context);
}
+ /* Save the current context in a separate field so that we know whether it
+ * has changed between calls to _start() */
+ gst_object_replace ((GstObject **) & thiz->old_context,
+ (GstObject *) thiz->context);
+
gst_msdk_context_add_shared_async_depth (thiz->context, thiz->async_depth);
return TRUE;
static void
gst_msdkvpp_finalize (GObject * object)
{
+ GstMsdkVPP *thiz = GST_MSDKVPP (object);
+
+ gst_clear_object (&thiz->old_context);
+
G_OBJECT_CLASS (parent_class)->finalize (object);
}
/* MFX context */
GstMsdkContext *context;
+ GstMsdkContext *old_context;
mfxVideoParam param;
guint in_num_surfaces;
guint out_num_surfaces;