vaapivideomemory: code style fixes

A cosmetic commit for enhance readability of the casts and method
preconditions.
This commit is contained in:
Víctor Manuel Jáquez Leal 2016-11-10 13:25:30 +01:00
parent 85b3af62b4
commit f6566a2c98

View file

@ -298,11 +298,12 @@ gst_video_meta_map_vaapi_memory (GstVideoMeta * meta, guint plane,
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 (mem->meta, 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_mutex_lock (&mem->lock);
if (mem->map_type && mem->map_type != GST_VAAPI_VIDEO_MEMORY_MAP_TYPE_PLANAR)
@ -340,14 +341,15 @@ gst_video_meta_unmap_vaapi_memory (GstVideoMeta * meta, guint plane,
GstAllocator *allocator;
GstVaapiVideoMemory *const mem =
GST_VAAPI_VIDEO_MEMORY_CAST (gst_buffer_peek_memory (meta->buffer, 0));
g_return_val_if_fail (mem, 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, 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);
allocator = GST_MEMORY_CAST (mem)->allocator;
g_return_val_if_fail (GST_VAAPI_IS_VIDEO_ALLOCATOR (allocator), FALSE);
g_mutex_lock (&mem->lock);
if (--mem->map_count == 0) {
mem->map_type = 0;