diff options
author | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-07-26 13:12:28 +0200 |
---|---|---|
committer | Gwenole Beauchesne <gwenole.beauchesne@intel.com> | 2013-07-26 13:16:57 +0200 |
commit | 73323ba76ad697939b0afe2cae53d1e5959eb36e (patch) | |
tree | bc0d785ddaf61acb5b1308274fb90e28d319a2b3 /tests | |
parent | f997f6271f72dead273d3851f0751adb2942cdba (diff) | |
download | gst-vaapi-73323ba76ad697939b0afe2cae53d1e5959eb36e.tar.gz |
tests: image: try to upload images through vaDeriveImage() too.
On some platforms, vaPutImage() would fail even if it does not involve
color format conversion or scaling, whereas copying raw pixels through
vaDeriveImage() could work instead.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/image.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/image.c b/tests/image.c index f5ee9a92..3abcaf82 100644 --- a/tests/image.c +++ b/tests/image.c @@ -363,7 +363,9 @@ image_upload(GstVaapiImage *image, GstVaapiSurface *surface) { GstVaapiDisplay *display; GstVideoFormat format; + GstVaapiImage *surface_image; GstVaapiSubpicture *subpicture; + gboolean success; display = gst_vaapi_object_get_display(GST_VAAPI_OBJECT(surface)); if (!display) @@ -376,6 +378,14 @@ image_upload(GstVaapiImage *image, GstVaapiSurface *surface) if (gst_vaapi_surface_put_image(surface, image)) return TRUE; + surface_image = gst_vaapi_surface_derive_image(surface); + if (surface_image) { + success = gst_vaapi_image_copy(surface_image, image); + gst_vaapi_object_unref(surface_image); + if (success) + return TRUE; + } + g_print("could not upload %s image to surface\n", gst_vaapi_video_format_to_string(format)); |