plugins: fix code style for errors

https://bugzilla.gnome.org/show_bug.cgi?id=773497
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-10-20 18:12:04 +02:00
parent 34e8579238
commit 0f938be7a4
6 changed files with 84 additions and 42 deletions

View file

@ -341,8 +341,10 @@ _h264_convert_byte_stream_to_avc (GstBuffer * buf)
return TRUE;
error:
gst_buffer_unmap (buf, &info);
return FALSE;
{
gst_buffer_unmap (buf, &info);
return FALSE;
}
}
static GstFlowReturn

View file

@ -340,8 +340,10 @@ _h265_convert_byte_stream_to_hvc (GstBuffer * buf)
return TRUE;
error:
gst_buffer_unmap (buf, &info);
return FALSE;
{
gst_buffer_unmap (buf, &info);
return FALSE;
}
}
static GstFlowReturn

View file

@ -1449,17 +1449,22 @@ done:
gst_buffer_unref (buffer);
return ret;
/* ERRORS */
error:
GST_ELEMENT_ERROR (sink, RESOURCE, WRITE,
("Internal error: could not render surface"), (NULL));
ret = GST_FLOW_ERROR;
goto done;
{
GST_ELEMENT_ERROR (sink, RESOURCE, WRITE,
("Internal error: could not render surface"), (NULL));
ret = GST_FLOW_ERROR;
goto done;
}
no_surface:
/* No surface or surface proxy. That's very bad! */
GST_WARNING_OBJECT (sink, "could not get surface");
ret = GST_FLOW_ERROR;
goto done;
{
/* No surface or surface proxy. That's very bad! */
GST_WARNING_OBJECT (sink, "could not get surface");
ret = GST_FLOW_ERROR;
goto done;
}
}
static GstFlowReturn

View file

@ -436,29 +436,45 @@ gst_vaapi_video_memory_map (GstVaapiVideoMemory * mem, gsize maxsize,
/* ERRORS */
error_unsupported_map:
GST_ERROR ("unsupported map flags (0x%x)", flags);
return NULL;
{
GST_ERROR ("unsupported map flags (0x%x)", flags);
return NULL;
}
error_unsupported_map_type:
GST_ERROR ("unsupported map type (%d)", mem->map_type);
return NULL;
{
GST_ERROR ("unsupported map type (%d)", mem->map_type);
return NULL;
}
error_no_surface_proxy:
GST_ERROR ("failed to extract GstVaapiSurfaceProxy from video meta");
return NULL;
{
GST_ERROR ("failed to extract GstVaapiSurfaceProxy from video meta");
return NULL;
}
error_no_surface:
GST_ERROR ("failed to extract VA surface from video buffer");
return NULL;
{
GST_ERROR ("failed to extract VA surface from video buffer");
return NULL;
}
error_no_current_surface:
GST_ERROR ("failed to make surface current");
return NULL;
{
GST_ERROR ("failed to make surface current");
return NULL;
}
error_no_image:
GST_ERROR ("failed to extract VA image from video buffer");
return NULL;
{
GST_ERROR ("failed to extract VA image from video buffer");
return NULL;
}
error_no_current_image:
GST_ERROR ("failed to make image current");
return NULL;
{
GST_ERROR ("failed to make image current");
return NULL;
}
error_map_image:
GST_ERROR ("failed to map VA image");
return NULL;
{
GST_ERROR ("failed to map VA image");
return NULL;
}
}
static void
@ -482,8 +498,10 @@ gst_vaapi_video_memory_unmap (GstVaapiVideoMemory * mem)
/* ERRORS */
error_incompatible_map:
GST_ERROR ("incompatible map type (%d)", mem->map_type);
return;
{
GST_ERROR ("incompatible map type (%d)", mem->map_type);
return;
}
}
static GstVaapiVideoMemory *
@ -518,14 +536,20 @@ gst_vaapi_video_memory_copy (GstVaapiVideoMemory * mem,
/* ERRORS */
error_no_current_surface:
GST_ERROR ("failed to make surface current");
return NULL;
{
GST_ERROR ("failed to make surface current");
return NULL;
}
error_unsupported:
GST_ERROR ("failed to copy partial memory (unsupported operation)");
return NULL;
{
GST_ERROR ("failed to copy partial memory (unsupported operation)");
return NULL;
}
error_allocate_memory:
GST_ERROR ("failed to allocate GstVaapiVideoMemory copy");
return NULL;
{
GST_ERROR ("failed to allocate GstVaapiVideoMemory copy");
return NULL;
}
}
static GstVaapiVideoMemory *

View file

@ -307,9 +307,12 @@ gst_vaapi_video_meta_new_from_pool (GstVaapiVideoPool * pool)
set_display (meta, gst_vaapi_video_pool_get_display (pool));
return meta;
/* ERRORS */
error:
gst_vaapi_video_meta_unref (meta);
return NULL;
{
gst_vaapi_video_meta_unref (meta);
return NULL;
}
}
/**

View file

@ -143,9 +143,12 @@ meta_texture_new (void)
goto error;
return meta;
/* ERRORS */
error:
meta_texture_free (meta);
return NULL;
{
meta_texture_free (meta);
return NULL;
}
}
static GstVaapiVideoMetaTexture *
@ -237,9 +240,12 @@ gst_buffer_add_texture_upload_meta (GstBuffer * buffer)
goto error;
return TRUE;
/* ERRORS */
error:
meta_texture_free (meta_texture);
return FALSE;
{
meta_texture_free (meta_texture);
return FALSE;
}
}
gboolean