mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
vaapiconvert: warn when surface failed to be updated with image.
This commit is contained in:
parent
dd879638ca
commit
6e9a816c48
1 changed files with 17 additions and 3 deletions
|
@ -343,6 +343,7 @@ gst_vaapiconvert_transform(
|
||||||
GstVaapiVideoBuffer *vbuffer;
|
GstVaapiVideoBuffer *vbuffer;
|
||||||
GstVaapiSurface *surface;
|
GstVaapiSurface *surface;
|
||||||
GstVaapiImage *image;
|
GstVaapiImage *image;
|
||||||
|
gboolean success;
|
||||||
|
|
||||||
vbuffer = GST_VAAPI_VIDEO_BUFFER(outbuf);
|
vbuffer = GST_VAAPI_VIDEO_BUFFER(outbuf);
|
||||||
surface = gst_vaapi_video_buffer_get_surface(vbuffer);
|
surface = gst_vaapi_video_buffer_get_surface(vbuffer);
|
||||||
|
@ -362,8 +363,10 @@ gst_vaapiconvert_transform(
|
||||||
if (!gst_vaapi_image_unmap(image))
|
if (!gst_vaapi_image_unmap(image))
|
||||||
return GST_FLOW_UNEXPECTED;
|
return GST_FLOW_UNEXPECTED;
|
||||||
|
|
||||||
if (convert->direct_rendering < 2)
|
if (convert->direct_rendering < 2) {
|
||||||
gst_vaapi_surface_put_image(surface, image);
|
if (!gst_vaapi_surface_put_image(surface, image))
|
||||||
|
goto error_put_image;
|
||||||
|
}
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -372,9 +375,20 @@ gst_vaapiconvert_transform(
|
||||||
return GST_FLOW_UNEXPECTED;
|
return GST_FLOW_UNEXPECTED;
|
||||||
|
|
||||||
gst_vaapi_image_update_from_buffer(image, inbuf);
|
gst_vaapi_image_update_from_buffer(image, inbuf);
|
||||||
gst_vaapi_surface_put_image(surface, image);
|
success = gst_vaapi_surface_put_image(surface, image);
|
||||||
gst_vaapi_video_pool_put_object(convert->images, image);
|
gst_vaapi_video_pool_put_object(convert->images, image);
|
||||||
|
if (!success)
|
||||||
|
goto error_put_image;
|
||||||
return GST_FLOW_OK;
|
return GST_FLOW_OK;
|
||||||
|
|
||||||
|
error_put_image:
|
||||||
|
{
|
||||||
|
GST_WARNING("failed to upload %" GST_FOURCC_FORMAT " image "
|
||||||
|
"to surface 0x%08x",
|
||||||
|
GST_FOURCC_ARGS(gst_vaapi_image_get_format(image)),
|
||||||
|
gst_vaapi_surface_get_id(surface));
|
||||||
|
return GST_FLOW_OK;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static GstCaps *
|
static GstCaps *
|
||||||
|
|
Loading…
Reference in a new issue