filter: add helpers to check for supported/active operation.
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 21 Nov 2013 16:20:28 +0000 (17:20 +0100)
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>
Thu, 21 Nov 2013 22:08:02 +0000 (23:08 +0100)
Add a couple of helper functions:
- gst_vaapi_filter_has_operation(): checks whether the VA driver
  advertises support for the supplied operation ;
- gst_vaapi_filter_use_operation(): checks whether the supplied
  operation was already enabled to its non-default value.

docs/reference/libs/libs-sections.txt
gst-libs/gst/vaapi/gstvaapifilter.c
gst-libs/gst/vaapi/gstvaapifilter.h

index cc00f43..e0752b7 100644 (file)
@@ -384,6 +384,8 @@ gst_vaapi_filter_unref
 gst_vaapi_filter_replace
 gst_vaapi_filter_get_operations
 gst_vaapi_filter_get_formats
+gst_vaapi_filter_has_operation
+gst_vaapi_filter_use_operation
 gst_vaapi_filter_set_operation
 gst_vaapi_filter_set_format
 gst_vaapi_filter_set_cropping_rectangle
index e185f6e..b6e9073 100755 (executable)
@@ -1117,6 +1117,53 @@ gst_vaapi_filter_get_operations(GstVaapiFilter *filter)
 }
 
 /**
+ * gst_vaapi_filter_has_operation:
+ * @filter: a #GstVaapiFilter
+ * @op: a #GstVaapiFilterOp
+ *
+ * Determines whether the underlying VA driver advertises support for
+ * the supplied operation @op.
+ *
+ * Return value: %TRUE if the specified operation may be supported by
+ *   the underlying hardware, %FALSE otherwise
+ */
+gboolean
+gst_vaapi_filter_has_operation(GstVaapiFilter *filter, GstVaapiFilterOp op)
+{
+    g_return_val_if_fail(filter != NULL, FALSE);
+
+    return find_operation(filter, op) != NULL;
+}
+
+/**
+ * gst_vaapi_filter_use_operation:
+ * @filter: a #GstVaapiFilter
+ * @op: a #GstVaapiFilterOp
+ *
+ * Determines whether the supplied operation @op was already enabled
+ * through a prior call to gst_vaapi_filter_set_operation() or any
+ * other operation-specific function.
+ *
+ * Note: should an operation be set to its default value, this means
+ * that it is actually not enabled.
+ *
+ * Return value: %TRUE if the specified operation was already enabled,
+ *   %FALSE otherwise
+ */
+gboolean
+gst_vaapi_filter_use_operation(GstVaapiFilter *filter, GstVaapiFilterOp op)
+{
+    GstVaapiFilterOpData *op_data;
+
+    g_return_val_if_fail(filter != NULL, FALSE);
+
+    op_data = find_operation(filter, op);
+    if (!op_data)
+        return FALSE;
+    return op_data->is_enabled;
+}
+
+/**
  * gst_vaapi_filter_set_operation:
  * @filter: a #GstVaapiFilter
  * @op: a #GstVaapiFilterOp
index 2ea4405..5d9ec65 100755 (executable)
@@ -150,6 +150,12 @@ GPtrArray *
 gst_vaapi_filter_get_operations(GstVaapiFilter *filter);
 
 gboolean
+gst_vaapi_filter_has_operation(GstVaapiFilter *filter, GstVaapiFilterOp op);
+
+gboolean
+gst_vaapi_filter_use_operation(GstVaapiFilter *filter, GstVaapiFilterOp op);
+
+gboolean
 gst_vaapi_filter_set_operation(GstVaapiFilter *filter, GstVaapiFilterOp op,
     const GValue *value);