diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-07-23 18:00:26 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-08-23 19:00:38 +0200 |
commit | 290cc8b7c975b0696593ac5c2e12c6ce2ac8a25e (patch) | |
tree | 21536fc21574fc6fa4021f0caa7f09ddc8973b4c /tests | |
parent | d7cc1374ed103217bc5a5661167a8c5302e021ea (diff) |
tests: filter: dump supported operations and formats.
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test-filter.c | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/test-filter.c b/tests/test-filter.c index c04e12e7..c12505ab 100755 --- a/tests/test-filter.c +++ b/tests/test-filter.c @@ -119,6 +119,57 @@ error_cleanup: return NULL; } +static void +dump_operation(GstVaapiFilterOpInfo *op_info) +{ + GParamSpec * const pspec = op_info->pspec; + GValue value = G_VALUE_INIT; + gchar *value_str; + + if (!op_info) + return; + + g_print(" %s: ", g_param_spec_get_name(pspec)); + g_value_init(&value, G_PARAM_SPEC_VALUE_TYPE(pspec)); + g_param_value_set_default(pspec, &value); + value_str = g_strdup_value_contents(&value); + g_print("%s (default: %s)\n", G_VALUE_TYPE_NAME(&value), + value_str ? value_str : "<unknown>"); + g_free(value_str); +} + +static void +dump_operations(GstVaapiFilter *filter) +{ + GPtrArray * const ops = gst_vaapi_filter_get_operations(filter); + guint i; + + if (!ops) + return; + + g_print("%u operations\n", ops->len); + for (i = 0; i < ops->len; i++) + dump_operation(g_ptr_array_index(ops, i)); + g_ptr_array_unref(ops); +} + +static void +dump_formats(GstVaapiFilter *filter) +{ + GArray * const formats = gst_vaapi_filter_get_formats(filter); + guint i; + + if (!formats) + return; + + g_print("%u formats\n", formats->len); + for (i = 0; i < formats->len; i++) { + GstVideoFormat format = g_array_index(formats, GstVideoFormat, i); + g_print(" %s\n", gst_vaapi_video_format_to_string(format)); + } + g_array_unref(formats); +} + int main(int argc, char *argv[]) { @@ -161,6 +212,9 @@ main(int argc, char *argv[]) if (!filter) g_error("failed to create video processing pipeline"); + dump_operations(filter); + dump_formats(filter); + status = gst_vaapi_filter_process(filter, src_surface, dst_surface, filter_flags); if (status != GST_VAAPI_FILTER_STATUS_SUCCESS) |