summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-11-21 17:20:28 +0100
committerGwenole Beauchesne <gwenole.beauchesne@intel.com>2013-11-21 23:08:02 +0100
commit152ffb52d2f85fc358f4c97ad061b4831611666a (patch)
tree6a2e1cb33e2d96e50c299192aea52f0f8e49c6df
parenta1189301c9816936b070150691114dec2a053104 (diff)
downloadgst-vaapi-152ffb52d2f85fc358f4c97ad061b4831611666a.tar.gz
filter: add helpers to check for supported/active operation.
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.
-rw-r--r--docs/reference/libs/libs-sections.txt2
-rwxr-xr-xgst-libs/gst/vaapi/gstvaapifilter.c47
-rwxr-xr-xgst-libs/gst/vaapi/gstvaapifilter.h6
3 files changed, 55 insertions, 0 deletions
diff --git a/docs/reference/libs/libs-sections.txt b/docs/reference/libs/libs-sections.txt
index cc00f430..e0752b73 100644
--- a/docs/reference/libs/libs-sections.txt
+++ b/docs/reference/libs/libs-sections.txt
@@ -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
diff --git a/gst-libs/gst/vaapi/gstvaapifilter.c b/gst-libs/gst/vaapi/gstvaapifilter.c
index e185f6ea..b6e90733 100755
--- a/gst-libs/gst/vaapi/gstvaapifilter.c
+++ b/gst-libs/gst/vaapi/gstvaapifilter.c
@@ -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
diff --git a/gst-libs/gst/vaapi/gstvaapifilter.h b/gst-libs/gst/vaapi/gstvaapifilter.h
index 2ea44052..5d9ec659 100755
--- a/gst-libs/gst/vaapi/gstvaapifilter.h
+++ b/gst-libs/gst/vaapi/gstvaapifilter.h
@@ -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);