vaapiconvert: warn when surface failed to be updated with image.

This commit is contained in:
Gwenole Beauchesne 2011-09-08 13:09:17 +02:00
parent dd879638ca
commit 6e9a816c48

View file

@ -343,6 +343,7 @@ gst_vaapiconvert_transform(
GstVaapiVideoBuffer *vbuffer;
GstVaapiSurface *surface;
GstVaapiImage *image;
gboolean success;
vbuffer = GST_VAAPI_VIDEO_BUFFER(outbuf);
surface = gst_vaapi_video_buffer_get_surface(vbuffer);
@ -362,8 +363,10 @@ gst_vaapiconvert_transform(
if (!gst_vaapi_image_unmap(image))
return GST_FLOW_UNEXPECTED;
if (convert->direct_rendering < 2)
gst_vaapi_surface_put_image(surface, image);
if (convert->direct_rendering < 2) {
if (!gst_vaapi_surface_put_image(surface, image))
goto error_put_image;
}
return GST_FLOW_OK;
}
@ -372,9 +375,20 @@ gst_vaapiconvert_transform(
return GST_FLOW_UNEXPECTED;
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);
if (!success)
goto error_put_image;
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 *