filter: fix first-time operation lookup.

Fix first-time operation lookup through find_operation() if the set
of supported operations was not initially determined through the
gst_vaapi_filter_get_operations() helper function.

Signed-off-by: Gwenole Beauchesne <gwenole.beauchesne@intel.com>
This commit is contained in:
Zhao Halley 2013-09-04 13:53:25 +08:00 committed by Gwenole Beauchesne
parent 3e4d8d27b3
commit e05e65e349

View file

@ -628,12 +628,14 @@ error:
g_ptr_array_unref(default_ops);
return NULL;
}
#endif
/* Determine the set of supported VPP operations by the specific
filter, or known to this library if filter is NULL */
static GPtrArray *
ensure_operations(GstVaapiFilter *filter)
{
#if USE_VA_VPP
GPtrArray *ops;
if (filter && filter->operations)
@ -643,8 +645,9 @@ ensure_operations(GstVaapiFilter *filter)
if (!ops)
return NULL;
return filter ? get_operations_ordered(filter, ops) : ops;
}
#endif
return NULL;
}
/* Find whether the VPP operation is supported or not */
GstVaapiFilterOpData *
@ -652,7 +655,7 @@ find_operation(GstVaapiFilter *filter, GstVaapiFilterOp op)
{
guint i;
if (!filter->operations)
if (!ensure_operations(filter))
return NULL;
for (i = 0; i < filter->operations->len; i++) {