diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-07-09 15:28:31 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-07-09 17:16:35 +0200 |
commit | cb92e7ca797839858f65f5780f6fceced7426b79 (patch) | |
tree | 230e11412844074789d5ab8f2e3dfef24d96f4f4 /tests | |
parent | 09397fa0d85ffdc5aff819a72a700c7e2b4031a5 (diff) |
tests: port to new video format API.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/image.c | 12 | ||||
-rw-r--r-- | tests/image.h | 2 | ||||
-rw-r--r-- | tests/test-display.c | 10 | ||||
-rw-r--r-- | tests/test-textures.c | 2 | ||||
-rw-r--r-- | tests/test-windows.c | 24 |
5 files changed, 25 insertions, 25 deletions
diff --git a/tests/image.c b/tests/image.c index 5c45391f..d412a17c 100644 --- a/tests/image.c +++ b/tests/image.c @@ -24,7 +24,7 @@ GstVaapiImage * image_generate( GstVaapiDisplay *display, - GstVaapiImageFormat format, + GstVideoFormat format, guint width, guint height ) @@ -257,7 +257,7 @@ image_draw_rectangle( guint32 color ) { - const GstVaapiImageFormat image_format = gst_vaapi_image_get_format(image); + const GstVideoFormat image_format = gst_vaapi_image_get_format(image); const guint image_width = gst_vaapi_image_get_width(image); const guint image_height = gst_vaapi_image_get_height(image); GstVaapiDisplay *display; @@ -267,11 +267,11 @@ image_draw_rectangle( guint i; static const struct { - GstVaapiImageFormat format; + GstVideoFormat format; DrawRectFunc draw_rect; } map[] = { -#define _(FORMAT) { GST_VAAPI_IMAGE_##FORMAT, draw_rect_##FORMAT } +#define _(FORMAT) { GST_VIDEO_FORMAT_##FORMAT, draw_rect_##FORMAT } _(ARGB), _(BGRA), _(RGBA), @@ -302,7 +302,7 @@ image_draw_rectangle( stride[i] = gst_vaapi_image_get_pitch(image, i); } - if (gst_vaapi_image_format_is_yuv(image_format)) + if (gst_video_format_is_yuv(image_format)) color = argb2yuv(color); if (x < 0) @@ -324,7 +324,7 @@ gboolean image_upload(GstVaapiImage *image, GstVaapiSurface *surface) { GstVaapiDisplay *display; - GstVaapiImageFormat format; + GstVideoFormat format; GstVaapiSubpicture *subpicture; display = gst_vaapi_object_get_display(GST_VAAPI_OBJECT(surface)); diff --git a/tests/image.h b/tests/image.h index 0b7f487f..6c7afaf9 100644 --- a/tests/image.h +++ b/tests/image.h @@ -28,7 +28,7 @@ GstVaapiImage * image_generate( GstVaapiDisplay *display, - GstVaapiImageFormat format, + GstVideoFormat format, guint width, guint height ); diff --git a/tests/test-display.c b/tests/test-display.c index 4155fc13..263fa35c 100644 --- a/tests/test-display.c +++ b/tests/test-display.c @@ -126,22 +126,22 @@ print_format_caps(GstCaps *caps, const gchar *name) for (i = 0; i < gst_caps_get_size(caps); i++) { GstStructure * const structure = gst_caps_get_structure(caps, i); const VAImageFormat *va_format; - GstVaapiImageFormat format; + GstVideoFormat format; if (!structure) g_error("could not get caps structure %d", i); g_print(" %s:", gst_structure_get_name(structure)); - format = gst_vaapi_image_format_from_structure(structure); - if (!format) + format = gst_video_format_from_structure(structure); + if (format == GST_VIDEO_FORMAT_UNKNOWN) g_error("could not determine format"); - va_format = gst_vaapi_image_format_get_va_format(format); + va_format = gst_video_format_to_va_format(format); if (!va_format) g_error("could not determine VA format"); - if (gst_vaapi_image_format_is_yuv(format)) + if (gst_video_format_is_yuv(format)) print_format_caps_yuv(va_format); else print_format_caps_rgb(va_format); diff --git a/tests/test-textures.c b/tests/test-textures.c index e89fb5f2..14bb5151 100644 --- a/tests/test-textures.c +++ b/tests/test-textures.c @@ -71,7 +71,7 @@ main(int argc, char *argv[]) if (!surface) g_error("could not create VA surface"); - image = image_generate(display, GST_VAAPI_IMAGE_NV12, width, height); + image = image_generate(display, GST_VIDEO_FORMAT_NV12, width, height); if (!image) g_error("could not create VA image"); if (!image_upload(image, surface)) diff --git a/tests/test-windows.c b/tests/test-windows.c index a305205e..fa5b40b0 100644 --- a/tests/test-windows.c +++ b/tests/test-windows.c @@ -52,24 +52,24 @@ create_test_surface(GstVaapiDisplay *display, guint width, guint height) guint i; static const GstVaapiChromaType chroma_type = GST_VAAPI_CHROMA_TYPE_YUV420; - static const GstVaapiImageFormat image_formats[] = { - GST_VAAPI_IMAGE_NV12, - GST_VAAPI_IMAGE_YV12, - GST_VAAPI_IMAGE_I420, - GST_VAAPI_IMAGE_AYUV, - GST_VAAPI_IMAGE_ARGB, - GST_VAAPI_IMAGE_BGRA, - GST_VAAPI_IMAGE_RGBA, - GST_VAAPI_IMAGE_ABGR, - 0 + static const GstVideoFormat image_formats[] = { + GST_VIDEO_FORMAT_NV12, + GST_VIDEO_FORMAT_YV12, + GST_VIDEO_FORMAT_I420, + GST_VIDEO_FORMAT_AYUV, + GST_VIDEO_FORMAT_ARGB, + GST_VIDEO_FORMAT_BGRA, + GST_VIDEO_FORMAT_RGBA, + GST_VIDEO_FORMAT_ABGR, + GST_VIDEO_FORMAT_UNKNOWN }; surface = gst_vaapi_surface_new(display, chroma_type, width, height); if (!surface) g_error("could not create Gst/VA surface"); - for (i = 0; image_formats[i]; i++) { - const GstVaapiImageFormat format = image_formats[i]; + for (i = 0; image_formats[i] != GST_VIDEO_FORMAT_UNKNOWN; i++) { + const GstVideoFormat format = image_formats[i]; image = image_generate(display, format, width, height); if (!image) |