diff options
author | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2016-02-03 11:04:15 +0100 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2016-02-03 20:03:47 +0100 |
commit | 4b5be5973ed7784a5099463de976e1fd118d6f57 (patch) | |
tree | 8a5ac3722437360a316550e2c8a69c8b082a3dc1 /gst | |
parent | 28d01c08576933f1ccc41456f80730a689de0508 (diff) | |
download | gst-vaapi-4b5be5973ed7784a5099463de976e1fd118d6f57.tar.gz |
libs: small refactors to enhance the code style
As gst-indent generated ugly code in these cases, this patch changes the used
idiomatic into other one.
No functional changes were introduced.
Signed-off-by: Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com>
Diffstat (limited to 'gst')
-rw-r--r-- | gst/vaapi/gstvaapivideomemory.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c index 3cf4746b..00f6a85d 100644 --- a/gst/vaapi/gstvaapivideomemory.c +++ b/gst/vaapi/gstvaapivideomemory.c @@ -188,12 +188,13 @@ gboolean gst_video_meta_map_vaapi_memory (GstVideoMeta * meta, guint plane, GstMapInfo * info, gpointer * data, gint * stride, GstMapFlags flags) { + GstAllocator *allocator; GstVaapiVideoMemory *const mem = GST_VAAPI_VIDEO_MEMORY_CAST (gst_buffer_peek_memory (meta->buffer, 0)); - g_return_val_if_fail (mem, FALSE); - g_return_val_if_fail (GST_VAAPI_IS_VIDEO_ALLOCATOR (mem->parent_instance. - allocator), FALSE); + + allocator = GST_MEMORY_CAST (mem)->allocator; + g_return_val_if_fail (GST_VAAPI_IS_VIDEO_ALLOCATOR (allocator), FALSE); g_return_val_if_fail (mem->meta, FALSE); if (mem->map_type && mem->map_type != GST_VAAPI_VIDEO_MEMORY_MAP_TYPE_PLANAR) @@ -264,12 +265,13 @@ gboolean gst_video_meta_unmap_vaapi_memory (GstVideoMeta * meta, guint plane, GstMapInfo * info) { + GstAllocator *allocator; GstVaapiVideoMemory *const mem = GST_VAAPI_VIDEO_MEMORY_CAST (gst_buffer_peek_memory (meta->buffer, 0)); - g_return_val_if_fail (mem, FALSE); - g_return_val_if_fail (GST_VAAPI_IS_VIDEO_ALLOCATOR (mem->parent_instance. - allocator), FALSE); + + allocator = GST_MEMORY_CAST (mem)->allocator; + g_return_val_if_fail (GST_VAAPI_IS_VIDEO_ALLOCATOR (allocator), FALSE); g_return_val_if_fail (mem->meta, FALSE); g_return_val_if_fail (mem->surface, FALSE); g_return_val_if_fail (mem->image, FALSE); |