From 4a8a80061f2f1c706ff6f5fef7d6e44f6a673528 Mon Sep 17 00:00:00 2001 From: Gwenole Beauchesne Date: Mon, 22 Jul 2013 15:15:48 +0200 Subject: [PATCH] libs: add and expose gst_vaapi_video_format_to_string() helper. This is just a wrapper over gst_video_format_to_string() for older GStreamer 0.10 builds. --- docs/reference/libs/libs-sections.txt | 1 + gst-libs/gst/vaapi/gstvaapiimage.c | 4 ++-- gst-libs/gst/vaapi/gstvaapisurface.c | 4 ++-- gst-libs/gst/vaapi/video-format.c | 15 +++++++++++++++ gst-libs/gst/vaapi/video-format.h | 3 +++ 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/docs/reference/libs/libs-sections.txt b/docs/reference/libs/libs-sections.txt index 5c68755..a79f048 100644 --- a/docs/reference/libs/libs-sections.txt +++ b/docs/reference/libs/libs-sections.txt @@ -1,6 +1,7 @@
videoformat GstVideoFormat +gst_vaapi_video_format_to_string gst_vaapi_video_format_from_caps gst_vaapi_video_format_from_structure gst_vaapi_video_format_from_va_format diff --git a/gst-libs/gst/vaapi/gstvaapiimage.c b/gst-libs/gst/vaapi/gstvaapiimage.c index 776439d..30df81d 100644 --- a/gst-libs/gst/vaapi/gstvaapiimage.c +++ b/gst-libs/gst/vaapi/gstvaapiimage.c @@ -285,7 +285,7 @@ gst_vaapi_image_new( g_return_val_if_fail(width > 0, NULL); g_return_val_if_fail(height > 0, NULL); - GST_DEBUG("format %s, size %ux%u", gst_video_format_to_string(format), + GST_DEBUG("format %s, size %ux%u", gst_vaapi_video_format_to_string(format), width, height); image = gst_vaapi_object_new(gst_vaapi_image_class(), display); @@ -435,7 +435,7 @@ _gst_vaapi_image_set_image(GstVaapiImage *image, const VAImage *va_image) image->format = format; image->is_linear = TRUE; GST_DEBUG("linearized image to %s format", - gst_video_format_to_string(format)); + gst_vaapi_video_format_to_string(format)); } } } diff --git a/gst-libs/gst/vaapi/gstvaapisurface.c b/gst-libs/gst/vaapi/gstvaapisurface.c index 9c681a8..768a8a9 100644 --- a/gst-libs/gst/vaapi/gstvaapisurface.c +++ b/gst-libs/gst/vaapi/gstvaapisurface.c @@ -184,7 +184,7 @@ gst_vaapi_surface_create_with_format(GstVaapiSurface *surface, /* ERRORS */ error_unsupported_format: - GST_ERROR("unsupported format %u", gst_video_format_to_string(format)); + GST_ERROR("unsupported format %u", gst_vaapi_video_format_to_string(format)); return FALSE; #else return FALSE; @@ -256,7 +256,7 @@ gst_vaapi_surface_new_with_format( GstVaapiSurface *surface; GST_DEBUG("size %ux%u, format %s", width, height, - gst_video_format_to_string(format)); + gst_vaapi_video_format_to_string(format)); surface = gst_vaapi_object_new(gst_vaapi_surface_class(), display); if (!surface) diff --git a/gst-libs/gst/vaapi/video-format.c b/gst-libs/gst/vaapi/video-format.c index 9edd983..68198a4 100644 --- a/gst-libs/gst/vaapi/video-format.c +++ b/gst-libs/gst/vaapi/video-format.c @@ -140,6 +140,21 @@ get_map(GstVideoFormat format) } /** + * gst_vaapi_video_format_to_string: + * @format: a #GstVideoFormat + * + * Returns the string representation of the @format argument. + * + * Return value: string representation of @format, or %NULL if unknown + * or unsupported. + */ +const gchar * +gst_vaapi_video_format_to_string(GstVideoFormat format) +{ + return gst_video_format_to_string(format); +} + +/** * gst_vaapi_video_format_is_rgb: * @format: a #GstVideoFormat * diff --git a/gst-libs/gst/vaapi/video-format.h b/gst-libs/gst/vaapi/video-format.h index eb7ec1d..a3d7d5b 100644 --- a/gst-libs/gst/vaapi/video-format.h +++ b/gst-libs/gst/vaapi/video-format.h @@ -28,6 +28,9 @@ G_BEGIN_DECLS +const char * +gst_vaapi_video_format_to_string(GstVideoFormat format); + gboolean gst_vaapi_video_format_is_rgb(GstVideoFormat format); -- 2.7.4