summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-10-20 18:12:04 +0200
committerVíctor Manuel Jáquez Leal <victorx.jaquez@intel.com>2016-10-25 19:38:26 +0200
commit0f938be7a458314356884b56748db8ef22d78d77 (patch)
treea313e65aa39b255c2de86c8eeb9b4db8f42c95c1
parent34e85792389f9d47d5d33a42a4ce092dd92724bc (diff)
plugins: fix code style for errors
https://bugzilla.gnome.org/show_bug.cgi?id=773497
-rw-r--r--gst/vaapi/gstvaapiencode_h264.c6
-rw-r--r--gst/vaapi/gstvaapiencode_h265.c6
-rw-r--r--gst/vaapi/gstvaapisink.c21
-rw-r--r--gst/vaapi/gstvaapivideomemory.c72
-rw-r--r--gst/vaapi/gstvaapivideometa.c7
-rw-r--r--gst/vaapi/gstvaapivideometa_texture.c14
6 files changed, 84 insertions, 42 deletions
diff --git a/gst/vaapi/gstvaapiencode_h264.c b/gst/vaapi/gstvaapiencode_h264.c
index 44a857d8..1f37fc46 100644
--- a/gst/vaapi/gstvaapiencode_h264.c
+++ b/gst/vaapi/gstvaapiencode_h264.c
@@ -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
diff --git a/gst/vaapi/gstvaapiencode_h265.c b/gst/vaapi/gstvaapiencode_h265.c
index 58219bd5..dbb60e66 100644
--- a/gst/vaapi/gstvaapiencode_h265.c
+++ b/gst/vaapi/gstvaapiencode_h265.c
@@ -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
diff --git a/gst/vaapi/gstvaapisink.c b/gst/vaapi/gstvaapisink.c
index 1af1aa29..cb593d2e 100644
--- a/gst/vaapi/gstvaapisink.c
+++ b/gst/vaapi/gstvaapisink.c
@@ -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
diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c
index 2fa1ad8a..0006e490 100644
--- a/gst/vaapi/gstvaapivideomemory.c
+++ b/gst/vaapi/gstvaapivideomemory.c
@@ -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 *
diff --git a/gst/vaapi/gstvaapivideometa.c b/gst/vaapi/gstvaapivideometa.c
index caafcbea..e73386ad 100644
--- a/gst/vaapi/gstvaapivideometa.c
+++ b/gst/vaapi/gstvaapivideometa.c
@@ -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;
+ }
}
/**
diff --git a/gst/vaapi/gstvaapivideometa_texture.c b/gst/vaapi/gstvaapivideometa_texture.c
index fb1535a7..b89f9ee8 100644
--- a/gst/vaapi/gstvaapivideometa_texture.c
+++ b/gst/vaapi/gstvaapivideometa_texture.c
@@ -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