From b4154ac85cbd9440ef71822e28dfa5385396d3f9 Mon Sep 17 00:00:00 2001 From: Sreerenj Balachandran Date: Tue, 30 Jun 2015 09:44:18 +0300 Subject: [PATCH] gst/vaapi: Switch to upstreram like indentation. gst-indent for all gst/vaapi/*.c source files --- gst/vaapi/gstvaapi.c | 55 ++++++++++++++++--------------------- gst/vaapi/gstvaapidecodebin.c | 15 +++++----- gst/vaapi/gstvaapiencode.c | 5 ++-- gst/vaapi/gstvaapiencode_jpeg.c | 6 ++-- gst/vaapi/gstvaapipluginbase.c | 8 ++---- gst/vaapi/gstvaapipluginutil.c | 10 ++++--- gst/vaapi/gstvaapipostproc.c | 12 ++++---- gst/vaapi/gstvaapivideobufferpool.c | 1 - gst/vaapi/gstvaapivideocontext.c | 8 +++--- gst/vaapi/gstvaapivideomemory.c | 3 +- gst/vaapi/gstvaapivideometa.c | 4 +-- 11 files changed, 57 insertions(+), 70 deletions(-) diff --git a/gst/vaapi/gstvaapi.c b/gst/vaapi/gstvaapi.c index e5bf227..3ad0ec0 100644 --- a/gst/vaapi/gstvaapi.c +++ b/gst/vaapi/gstvaapi.c @@ -51,50 +51,41 @@ #define PLUGIN_LICENSE "LGPL" static gboolean -plugin_init (GstPlugin *plugin) +plugin_init (GstPlugin * plugin) { - gst_element_register(plugin, "vaapidecode", - GST_RANK_PRIMARY + 1, - GST_TYPE_VAAPIDECODE); - gst_element_register(plugin, "vaapipostproc", - GST_RANK_PRIMARY, - GST_TYPE_VAAPIPOSTPROC); - gst_element_register(plugin, "vaapisink", - GST_RANK_PRIMARY, - GST_TYPE_VAAPISINK); + gst_element_register (plugin, "vaapidecode", + GST_RANK_PRIMARY + 1, GST_TYPE_VAAPIDECODE); + gst_element_register (plugin, "vaapipostproc", + GST_RANK_PRIMARY, GST_TYPE_VAAPIPOSTPROC); + gst_element_register (plugin, "vaapisink", + GST_RANK_PRIMARY, GST_TYPE_VAAPISINK); #if USE_ENCODERS - gst_element_register(plugin, "vaapiencode_h264", - GST_RANK_PRIMARY, - GST_TYPE_VAAPIENCODE_H264); - gst_element_register(plugin, "vaapiencode_mpeg2", - GST_RANK_PRIMARY, - GST_TYPE_VAAPIENCODE_MPEG2); + gst_element_register (plugin, "vaapiencode_h264", + GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_H264); + gst_element_register (plugin, "vaapiencode_mpeg2", + GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_MPEG2); #endif #if USE_JPEG_ENCODER - gst_element_register(plugin, "vaapiencode_jpeg", - GST_RANK_PRIMARY, - GST_TYPE_VAAPIENCODE_JPEG); + gst_element_register (plugin, "vaapiencode_jpeg", + GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_JPEG); #endif #if USE_VP8_ENCODER - gst_element_register(plugin, "vaapiencode_vp8", - GST_RANK_PRIMARY, - GST_TYPE_VAAPIENCODE_VP8); + gst_element_register (plugin, "vaapiencode_vp8", + GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_VP8); #endif #if USE_H265_ENCODER - gst_element_register(plugin, "vaapiencode_h265", - GST_RANK_PRIMARY, - GST_TYPE_VAAPIENCODE_H265); + gst_element_register (plugin, "vaapiencode_h265", + GST_RANK_PRIMARY, GST_TYPE_VAAPIENCODE_H265); #endif #if GST_CHECK_VERSION(1,4,0) - gst_element_register(plugin, "vaapidecodebin", - GST_RANK_PRIMARY + 2, - GST_TYPE_VAAPI_DECODE_BIN); + gst_element_register (plugin, "vaapidecodebin", + GST_RANK_PRIMARY + 2, GST_TYPE_VAAPI_DECODE_BIN); #endif - return TRUE; + return TRUE; } -GST_PLUGIN_DEFINE(GST_VERSION_MAJOR, GST_VERSION_MINOR, - vaapi, PLUGIN_DESC, plugin_init, - PACKAGE_VERSION, PLUGIN_LICENSE, PACKAGE, PACKAGE_BUGREPORT) +GST_PLUGIN_DEFINE (GST_VERSION_MAJOR, GST_VERSION_MINOR, + vaapi, PLUGIN_DESC, plugin_init, + PACKAGE_VERSION, PLUGIN_LICENSE, PACKAGE, PACKAGE_BUGREPORT) diff --git a/gst/vaapi/gstvaapidecodebin.c b/gst/vaapi/gstvaapidecodebin.c index 6ed8f91..ad814e7 100644 --- a/gst/vaapi/gstvaapidecodebin.c +++ b/gst/vaapi/gstvaapidecodebin.c @@ -103,14 +103,16 @@ G_DEFINE_TYPE (GstVaapiDecodeBin, gst_vaapi_decode_bin, GST_TYPE_BIN); /* Remove the vaapipostproc if already added and reset the ghost pad target */ static void -disable_vpp (GstVaapiDecodeBin *vaapidecbin) +disable_vpp (GstVaapiDecodeBin * vaapidecbin) { GstPad *pad; GstStateChangeReturn ret; GstState state; /*Fixme: Add run-time disabling support */ - ret = gst_element_get_state (GST_ELEMENT (vaapidecbin), &state, NULL, GST_CLOCK_TIME_NONE); + ret = + gst_element_get_state (GST_ELEMENT (vaapidecbin), &state, NULL, + GST_CLOCK_TIME_NONE); if (ret != GST_STATE_CHANGE_SUCCESS || state > GST_STATE_NULL) { GST_WARNING_OBJECT (vaapidecbin, "Failed to set disable-vpp property!,," "No support for run-time disabling, Ignoring the user request to disable VPP."); @@ -120,14 +122,11 @@ disable_vpp (GstVaapiDecodeBin *vaapidecbin) gst_element_set_state (vaapidecbin->postproc, GST_STATE_NULL); gst_bin_remove (GST_BIN (vaapidecbin), vaapidecbin->postproc); - pad = - gst_element_get_static_pad (GST_ELEMENT (vaapidecbin->queue), - "src"); - gst_ghost_pad_set_target ((GstGhostPad *) vaapidecbin->ghost_pad_src, - pad); + pad = gst_element_get_static_pad (GST_ELEMENT (vaapidecbin->queue), "src"); + gst_ghost_pad_set_target ((GstGhostPad *) vaapidecbin->ghost_pad_src, pad); gst_object_unref (pad); } - + static void gst_vaapi_decode_bin_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) diff --git a/gst/vaapi/gstvaapiencode.c b/gst/vaapi/gstvaapiencode.c index 8e06433..7306b75 100644 --- a/gst/vaapi/gstvaapiencode.c +++ b/gst/vaapi/gstvaapiencode.c @@ -585,8 +585,9 @@ gst_vaapiencode_change_state (GstElement * element, GstStateChange transition) default: break; } - return GST_ELEMENT_CLASS (gst_vaapiencode_parent_class)-> - change_state (element, transition); + return + GST_ELEMENT_CLASS (gst_vaapiencode_parent_class)->change_state (element, + transition); } static gboolean diff --git a/gst/vaapi/gstvaapiencode_jpeg.c b/gst/vaapi/gstvaapiencode_jpeg.c index 78304f9..a5a9362 100644 --- a/gst/vaapi/gstvaapiencode_jpeg.c +++ b/gst/vaapi/gstvaapiencode_jpeg.c @@ -67,8 +67,7 @@ static GstStaticPadTemplate gst_vaapiencode_jpeg_src_factory = /* *INDENT-ON* */ /* jpeg encode */ -G_DEFINE_TYPE (GstVaapiEncodeJpeg, gst_vaapiencode_jpeg, - GST_TYPE_VAAPIENCODE); +G_DEFINE_TYPE (GstVaapiEncodeJpeg, gst_vaapiencode_jpeg, GST_TYPE_VAAPIENCODE); static void gst_vaapiencode_jpeg_init (GstVaapiEncodeJpeg * encode) @@ -150,7 +149,8 @@ gst_vaapiencode_jpeg_class_init (GstVaapiEncodeJpegClass * klass) gst_element_class_set_static_metadata (element_class, "VA-API JPEG encoder", "Codec/Encoder/Image", - GST_PLUGIN_DESC, "Sreerenj Balachandran "); + GST_PLUGIN_DESC, + "Sreerenj Balachandran "); /* sink pad */ gst_element_class_add_pad_template (element_class, diff --git a/gst/vaapi/gstvaapipluginbase.c b/gst/vaapi/gstvaapipluginbase.c index 6624316..5e922b3 100644 --- a/gst/vaapi/gstvaapipluginbase.c +++ b/gst/vaapi/gstvaapipluginbase.c @@ -397,7 +397,7 @@ has_dmabuf_capable_peer (GstVaapiPluginBase * plugin, GstPad * pad) v = 0; g_object_get (element, "io-mode", &v, NULL); - is_dmabuf_capable = v == 5; /* "dmabuf-import" enum value */ + is_dmabuf_capable = v == 5; /* "dmabuf-import" enum value */ break; } else if (GST_IS_BASE_TRANSFORM (element)) { element_name = gst_element_get_name (element); @@ -895,15 +895,13 @@ done: error_no_pool: { GST_ELEMENT_ERROR (plugin, STREAM, FAILED, - ("no buffer pool was negotiated"), - ("no buffer pool was negotiated")); + ("no buffer pool was negotiated"), ("no buffer pool was negotiated")); return GST_FLOW_ERROR; } error_active_pool: { GST_ELEMENT_ERROR (plugin, STREAM, FAILED, - ("failed to activate buffer pool"), - ("failed to activate buffer pool")); + ("failed to activate buffer pool"), ("failed to activate buffer pool")); return GST_FLOW_ERROR; } error_map_dst_buffer: diff --git a/gst/vaapi/gstvaapipluginutil.c b/gst/vaapi/gstvaapipluginutil.c index 64bc3ba..ce9cbb0 100644 --- a/gst/vaapi/gstvaapipluginutil.c +++ b/gst/vaapi/gstvaapipluginutil.c @@ -445,8 +445,10 @@ gst_vaapi_video_format_new_template_caps_with_features (GstVideoFormat format, static GstCaps * new_gl_texture_upload_meta_caps (void) { - return gst_caps_from_string (GST_VIDEO_CAPS_MAKE_WITH_FEATURES ( - GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, "{ RGBA, BGRA }")); + return + gst_caps_from_string (GST_VIDEO_CAPS_MAKE_WITH_FEATURES + (GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, + "{ RGBA, BGRA }")); } GstVaapiCapsFeature @@ -462,14 +464,14 @@ gst_vaapi_find_preferred_caps_feature (GstPad * pad, GstVideoFormat format, GstCaps *out_caps; GstVideoFormat out_format; - out_caps= gst_pad_get_allowed_caps (pad); + out_caps = gst_pad_get_allowed_caps (pad); if (!out_caps) { feature = GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED; goto cleanup; } out_format = format == GST_VIDEO_FORMAT_ENCODED ? - GST_VIDEO_FORMAT_I420 : format; + GST_VIDEO_FORMAT_I420 : format; gl_texture_upload_caps = new_gl_texture_upload_meta_caps (); if (!gl_texture_upload_caps) diff --git a/gst/vaapi/gstvaapipostproc.c b/gst/vaapi/gstvaapipostproc.c index 74743c1..427d8ad 100644 --- a/gst/vaapi/gstvaapipostproc.c +++ b/gst/vaapi/gstvaapipostproc.c @@ -326,9 +326,9 @@ gst_vaapipostproc_stop (GstBaseTransform * trans) gst_vaapi_plugin_base_close (GST_VAAPI_PLUGIN_BASE (postproc)); postproc->field_duration = GST_CLOCK_TIME_NONE; - gst_video_info_init(&postproc->sinkpad_info); - gst_video_info_init(&postproc->srcpad_info); - gst_video_info_init(&postproc->filter_pool_info); + gst_video_info_init (&postproc->sinkpad_info); + gst_video_info_init (&postproc->srcpad_info); + gst_video_info_init (&postproc->filter_pool_info); return TRUE; } @@ -536,7 +536,7 @@ gst_vaapipostproc_process_vpp (GstBaseTransform * trans, GstBuffer * inbuf, if ((postproc->flags & GST_VAAPI_POSTPROC_FLAG_SKINTONE) && !gst_vaapi_filter_set_skintone (postproc->filter, - postproc->skintone_enhance)) + postproc->skintone_enhance)) return GST_FLOW_NOT_SUPPORTED; inbuf_meta = gst_buffer_get_vaapi_video_meta (inbuf); @@ -1082,7 +1082,6 @@ gst_vaapipostproc_transform_caps_impl (GstBaseTransform * trans, GST_VIDEO_INFO_FPS_N (&vi) = fps_n; GST_VIDEO_INFO_FPS_D (&vi) = fps_d; } - // Signal the other pad that we only generate progressive frames GST_VIDEO_INFO_INTERLACE_MODE (&vi) = GST_VIDEO_INTERLACE_MODE_PROGRESSIVE; @@ -1206,8 +1205,7 @@ done: static GstFlowReturn gst_vaapipostproc_prepare_output_buffer (GstBaseTransform * trans, - GstBuffer * inbuf, - GstBuffer ** outbuf_ptr) + GstBuffer * inbuf, GstBuffer ** outbuf_ptr) { GstVaapiPostproc *const postproc = GST_VAAPIPOSTPROC (trans); diff --git a/gst/vaapi/gstvaapivideobufferpool.c b/gst/vaapi/gstvaapivideobufferpool.c index e79158f..8e45bbc 100644 --- a/gst/vaapi/gstvaapivideobufferpool.c +++ b/gst/vaapi/gstvaapivideobufferpool.c @@ -287,7 +287,6 @@ gst_vaapi_video_buffer_pool_alloc_buffer (GstBufferPool * pool, vmeta->unmap = gst_video_meta_unmap_vaapi_memory; } } - #if (USE_GLX || USE_EGL) if (priv->has_texture_upload_meta) gst_buffer_add_texture_upload_meta (buffer); diff --git a/gst/vaapi/gstvaapivideocontext.c b/gst/vaapi/gstvaapivideocontext.c index fa48242..1d3dcba 100644 --- a/gst/vaapi/gstvaapivideocontext.c +++ b/gst/vaapi/gstvaapivideocontext.c @@ -32,15 +32,15 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_CONTEXT); gst_vaapi_display_get_type () GType -gst_vaapi_display_get_type (void) G_GNUC_CONST; +gst_vaapi_display_get_type (void) + G_GNUC_CONST; G_DEFINE_BOXED_TYPE (GstVaapiDisplay, gst_vaapi_display, (GBoxedCopyFunc) gst_vaapi_display_ref, (GBoxedFreeFunc) gst_vaapi_display_unref); -GstContext * -gst_vaapi_video_context_new_with_display (GstVaapiDisplay * display, - gboolean persistent) + GstContext *gst_vaapi_video_context_new_with_display (GstVaapiDisplay * + display, gboolean persistent) { GstContext *context; GstStructure *structure; diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c index 409cdd4..fcd225f 100644 --- a/gst/vaapi/gstvaapivideomemory.c +++ b/gst/vaapi/gstvaapivideomemory.c @@ -42,8 +42,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_debug_vaapivideomemory); /* --- GstVaapiVideoMemory --- */ /* ------------------------------------------------------------------------ */ -static void -gst_vaapi_video_memory_reset_image (GstVaapiVideoMemory * mem); +static void gst_vaapi_video_memory_reset_image (GstVaapiVideoMemory * mem); static guchar * get_image_data (GstVaapiImage * image) diff --git a/gst/vaapi/gstvaapivideometa.c b/gst/vaapi/gstvaapivideometa.c index aef333e..caafcbe 100644 --- a/gst/vaapi/gstvaapivideometa.c +++ b/gst/vaapi/gstvaapivideometa.c @@ -531,8 +531,8 @@ gst_vaapi_video_meta_get_surface (GstVaapiVideoMeta * meta) { g_return_val_if_fail (GST_VAAPI_IS_VIDEO_META (meta), NULL); - return ensure_surface_proxy (meta) ? GST_VAAPI_SURFACE_PROXY_SURFACE (meta-> - proxy) : NULL; + return ensure_surface_proxy (meta) ? + GST_VAAPI_SURFACE_PROXY_SURFACE (meta->proxy) : NULL; } /** -- 2.7.4