mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 03:35:21 +00:00
plugins: fix code style for errors
https://bugzilla.gnome.org/show_bug.cgi?id=773497
This commit is contained in:
parent
34e8579238
commit
0f938be7a4
6 changed files with 84 additions and 42 deletions
|
@ -341,9 +341,11 @@ _h264_convert_byte_stream_to_avc (GstBuffer * buf)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
{
|
||||||
gst_buffer_unmap (buf, &info);
|
gst_buffer_unmap (buf, &info);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_vaapiencode_h264_alloc_buffer (GstVaapiEncode * base_encode,
|
gst_vaapiencode_h264_alloc_buffer (GstVaapiEncode * base_encode,
|
||||||
|
|
|
@ -340,9 +340,11 @@ _h265_convert_byte_stream_to_hvc (GstBuffer * buf)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
{
|
||||||
gst_buffer_unmap (buf, &info);
|
gst_buffer_unmap (buf, &info);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_vaapiencode_h265_alloc_buffer (GstVaapiEncode * base_encode,
|
gst_vaapiencode_h265_alloc_buffer (GstVaapiEncode * base_encode,
|
||||||
|
|
|
@ -1449,18 +1449,23 @@ done:
|
||||||
gst_buffer_unref (buffer);
|
gst_buffer_unref (buffer);
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
|
/* ERRORS */
|
||||||
error:
|
error:
|
||||||
|
{
|
||||||
GST_ELEMENT_ERROR (sink, RESOURCE, WRITE,
|
GST_ELEMENT_ERROR (sink, RESOURCE, WRITE,
|
||||||
("Internal error: could not render surface"), (NULL));
|
("Internal error: could not render surface"), (NULL));
|
||||||
ret = GST_FLOW_ERROR;
|
ret = GST_FLOW_ERROR;
|
||||||
goto done;
|
goto done;
|
||||||
|
}
|
||||||
|
|
||||||
no_surface:
|
no_surface:
|
||||||
|
{
|
||||||
/* No surface or surface proxy. That's very bad! */
|
/* No surface or surface proxy. That's very bad! */
|
||||||
GST_WARNING_OBJECT (sink, "could not get surface");
|
GST_WARNING_OBJECT (sink, "could not get surface");
|
||||||
ret = GST_FLOW_ERROR;
|
ret = GST_FLOW_ERROR;
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_vaapisink_show_frame (GstVideoSink * video_sink, GstBuffer * src_buffer)
|
gst_vaapisink_show_frame (GstVideoSink * video_sink, GstBuffer * src_buffer)
|
||||||
|
|
|
@ -436,30 +436,46 @@ gst_vaapi_video_memory_map (GstVaapiVideoMemory * mem, gsize maxsize,
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
error_unsupported_map:
|
error_unsupported_map:
|
||||||
|
{
|
||||||
GST_ERROR ("unsupported map flags (0x%x)", flags);
|
GST_ERROR ("unsupported map flags (0x%x)", flags);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
error_unsupported_map_type:
|
error_unsupported_map_type:
|
||||||
|
{
|
||||||
GST_ERROR ("unsupported map type (%d)", mem->map_type);
|
GST_ERROR ("unsupported map type (%d)", mem->map_type);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
error_no_surface_proxy:
|
error_no_surface_proxy:
|
||||||
|
{
|
||||||
GST_ERROR ("failed to extract GstVaapiSurfaceProxy from video meta");
|
GST_ERROR ("failed to extract GstVaapiSurfaceProxy from video meta");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
error_no_surface:
|
error_no_surface:
|
||||||
|
{
|
||||||
GST_ERROR ("failed to extract VA surface from video buffer");
|
GST_ERROR ("failed to extract VA surface from video buffer");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
error_no_current_surface:
|
error_no_current_surface:
|
||||||
|
{
|
||||||
GST_ERROR ("failed to make surface current");
|
GST_ERROR ("failed to make surface current");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
error_no_image:
|
error_no_image:
|
||||||
|
{
|
||||||
GST_ERROR ("failed to extract VA image from video buffer");
|
GST_ERROR ("failed to extract VA image from video buffer");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
error_no_current_image:
|
error_no_current_image:
|
||||||
|
{
|
||||||
GST_ERROR ("failed to make image current");
|
GST_ERROR ("failed to make image current");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
error_map_image:
|
error_map_image:
|
||||||
|
{
|
||||||
GST_ERROR ("failed to map VA image");
|
GST_ERROR ("failed to map VA image");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_vaapi_video_memory_unmap (GstVaapiVideoMemory * mem)
|
gst_vaapi_video_memory_unmap (GstVaapiVideoMemory * mem)
|
||||||
|
@ -482,9 +498,11 @@ gst_vaapi_video_memory_unmap (GstVaapiVideoMemory * mem)
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
error_incompatible_map:
|
error_incompatible_map:
|
||||||
|
{
|
||||||
GST_ERROR ("incompatible map type (%d)", mem->map_type);
|
GST_ERROR ("incompatible map type (%d)", mem->map_type);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static GstVaapiVideoMemory *
|
static GstVaapiVideoMemory *
|
||||||
gst_vaapi_video_memory_copy (GstVaapiVideoMemory * mem,
|
gst_vaapi_video_memory_copy (GstVaapiVideoMemory * mem,
|
||||||
|
@ -518,15 +536,21 @@ gst_vaapi_video_memory_copy (GstVaapiVideoMemory * mem,
|
||||||
|
|
||||||
/* ERRORS */
|
/* ERRORS */
|
||||||
error_no_current_surface:
|
error_no_current_surface:
|
||||||
|
{
|
||||||
GST_ERROR ("failed to make surface current");
|
GST_ERROR ("failed to make surface current");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
error_unsupported:
|
error_unsupported:
|
||||||
|
{
|
||||||
GST_ERROR ("failed to copy partial memory (unsupported operation)");
|
GST_ERROR ("failed to copy partial memory (unsupported operation)");
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
error_allocate_memory:
|
error_allocate_memory:
|
||||||
|
{
|
||||||
GST_ERROR ("failed to allocate GstVaapiVideoMemory copy");
|
GST_ERROR ("failed to allocate GstVaapiVideoMemory copy");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static GstVaapiVideoMemory *
|
static GstVaapiVideoMemory *
|
||||||
gst_vaapi_video_memory_share (GstVaapiVideoMemory * mem,
|
gst_vaapi_video_memory_share (GstVaapiVideoMemory * mem,
|
||||||
|
|
|
@ -307,10 +307,13 @@ gst_vaapi_video_meta_new_from_pool (GstVaapiVideoPool * pool)
|
||||||
set_display (meta, gst_vaapi_video_pool_get_display (pool));
|
set_display (meta, gst_vaapi_video_pool_get_display (pool));
|
||||||
return meta;
|
return meta;
|
||||||
|
|
||||||
|
/* ERRORS */
|
||||||
error:
|
error:
|
||||||
|
{
|
||||||
gst_vaapi_video_meta_unref (meta);
|
gst_vaapi_video_meta_unref (meta);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* gst_vaapi_video_meta_new_with_image:
|
* gst_vaapi_video_meta_new_with_image:
|
||||||
|
|
|
@ -143,10 +143,13 @@ meta_texture_new (void)
|
||||||
goto error;
|
goto error;
|
||||||
return meta;
|
return meta;
|
||||||
|
|
||||||
|
/* ERRORS */
|
||||||
error:
|
error:
|
||||||
|
{
|
||||||
meta_texture_free (meta);
|
meta_texture_free (meta);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static GstVaapiVideoMetaTexture *
|
static GstVaapiVideoMetaTexture *
|
||||||
meta_texture_copy (GstVaapiVideoMetaTexture * meta)
|
meta_texture_copy (GstVaapiVideoMetaTexture * meta)
|
||||||
|
@ -237,10 +240,13 @@ gst_buffer_add_texture_upload_meta (GstBuffer * buffer)
|
||||||
goto error;
|
goto error;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
|
/* ERRORS */
|
||||||
error:
|
error:
|
||||||
|
{
|
||||||
meta_texture_free (meta_texture);
|
meta_texture_free (meta_texture);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
gst_buffer_ensure_texture_upload_meta (GstBuffer * buffer)
|
gst_buffer_ensure_texture_upload_meta (GstBuffer * buffer)
|
||||||
|
|
Loading…
Reference in a new issue