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; return TRUE;
error: error:
gst_buffer_unmap (buf, &info); {
return FALSE; gst_buffer_unmap (buf, &info);
return FALSE;
}
} }
static GstFlowReturn static GstFlowReturn

View file

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

View file

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

View file

@ -436,29 +436,45 @@ 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); {
return NULL; GST_ERROR ("unsupported map flags (0x%x)", flags);
return NULL;
}
error_unsupported_map_type: 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: 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: 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: 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: 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: 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: error_map_image:
GST_ERROR ("failed to map VA image"); {
return NULL; GST_ERROR ("failed to map VA image");
return NULL;
}
} }
static void static void
@ -482,8 +498,10 @@ gst_vaapi_video_memory_unmap (GstVaapiVideoMemory * mem)
/* ERRORS */ /* ERRORS */
error_incompatible_map: 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 * static GstVaapiVideoMemory *
@ -518,14 +536,20 @@ gst_vaapi_video_memory_copy (GstVaapiVideoMemory * mem,
/* ERRORS */ /* ERRORS */
error_no_current_surface: error_no_current_surface:
GST_ERROR ("failed to make surface current"); {
return NULL; GST_ERROR ("failed to make surface current");
return NULL;
}
error_unsupported: 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: error_allocate_memory:
GST_ERROR ("failed to allocate GstVaapiVideoMemory copy"); {
return NULL; GST_ERROR ("failed to allocate GstVaapiVideoMemory copy");
return NULL;
}
} }
static GstVaapiVideoMemory * 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)); set_display (meta, gst_vaapi_video_pool_get_display (pool));
return meta; return meta;
/* ERRORS */
error: 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; goto error;
return meta; return meta;
/* ERRORS */
error: error:
meta_texture_free (meta); {
return NULL; meta_texture_free (meta);
return NULL;
}
} }
static GstVaapiVideoMetaTexture * static GstVaapiVideoMetaTexture *
@ -237,9 +240,12 @@ gst_buffer_add_texture_upload_meta (GstBuffer * buffer)
goto error; goto error;
return TRUE; return TRUE;
/* ERRORS */
error: error:
meta_texture_free (meta_texture); {
return FALSE; meta_texture_free (meta_texture);
return FALSE;
}
} }
gboolean gboolean