vaapidecode: re-indent (gst-indent) gstvaapidecode.c

This commit is contained in:
Sreerenj Balachandran 2015-03-02 14:59:16 +02:00
parent aafa59f01e
commit 5425a05bd4

View file

@ -62,6 +62,7 @@ GST_DEBUG_CATEGORY_STATIC(gst_debug_vaapidecode);
/* Default templates */
#define GST_CAPS_CODEC(CODEC) CODEC "; "
/* *INDENT-OFF* */
static const char gst_vaapidecode_sink_caps_str[] =
GST_CAPS_CODEC("video/mpeg, mpegversion=2, systemstream=(boolean)false")
GST_CAPS_CODEC("video/mpeg, mpegversion=4")
@ -104,9 +105,9 @@ G_DEFINE_TYPE_WITH_CODE(
gst_vaapidecode,
GST_TYPE_VIDEO_DECODER,
GST_VAAPI_PLUGIN_BASE_INIT_INTERFACES)
/* *INDENT-ON* */
static gboolean
gst_vaapidecode_update_src_caps(GstVaapiDecode *decode);
static gboolean gst_vaapidecode_update_src_caps (GstVaapiDecode * decode);
static gboolean
gst_vaapi_decode_input_state_replace (GstVaapiDecode * decode,
@ -178,8 +179,8 @@ gst_vaapidecode_update_src_caps(GstVaapiDecode *decode)
GstCapsFeatures *features = NULL;
GstVaapiCapsFeature feature;
feature = gst_vaapi_find_preferred_caps_feature(
GST_VIDEO_DECODER_SRC_PAD(vdec),
feature =
gst_vaapi_find_preferred_caps_feature (GST_VIDEO_DECODER_SRC_PAD (vdec),
GST_VIDEO_INFO_FORMAT (&ref_state->info), &format);
if (feature == GST_VAAPI_CAPS_FEATURE_NOT_NEGOTIATED)
@ -189,16 +190,17 @@ gst_vaapidecode_update_src_caps(GstVaapiDecode *decode)
#if (USE_GLX || USE_EGL)
case GST_VAAPI_CAPS_FEATURE_GL_TEXTURE_UPLOAD_META:
if (decode->has_texture_upload_meta)
features = gst_caps_features_new(
GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, NULL);
features =
gst_caps_features_new
(GST_CAPS_FEATURE_META_GST_VIDEO_GL_TEXTURE_UPLOAD_META, NULL);
else
format = GST_VIDEO_FORMAT_I420;
break;
#endif
#if GST_CHECK_VERSION(1,5,0)
case GST_VAAPI_CAPS_FEATURE_VAAPI_SURFACE:
features = gst_caps_features_new(
GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, NULL);
features =
gst_caps_features_new (GST_CAPS_FEATURE_MEMORY_VAAPI_SURFACE, NULL);
break;
#endif
default:
@ -231,8 +233,7 @@ gst_vaapidecode_update_src_caps(GstVaapiDecode *decode)
"width", G_TYPE_INT, vi->width,
"height", G_TYPE_INT, vi->height,
"framerate", GST_TYPE_FRACTION, vi->fps_n, vi->fps_d,
"pixel-aspect-ratio", GST_TYPE_FRACTION, vi->par_n, vi->par_d,
NULL);
"pixel-aspect-ratio", GST_TYPE_FRACTION, vi->par_n, vi->par_d, NULL);
gst_caps_set_interlaced (state->caps, vi);
#endif
@ -301,7 +302,6 @@ gst_vaapidecode_push_decoded_frame(GstVideoDecoder *vdec,
crop_meta->height = crop_rect->height;
}
}
#if GST_CHECK_VERSION(1,1,0) && (USE_GLX || USE_EGL)
if (decode->has_texture_upload_meta)
gst_buffer_ensure_texture_upload_meta (out_frame->output_buffer);
@ -330,8 +330,7 @@ error_create_buffer:
GST_ELEMENT_ERROR (vdec, STREAM, FAILED,
("Failed to create sink buffer"),
("video sink failed to create video buffer for proxy'ed "
"surface %" GST_VAAPI_ID_FORMAT,
GST_VAAPI_ID_ARGS(surface_id)));
"surface %" GST_VAAPI_ID_FORMAT, GST_VAAPI_ID_ARGS (surface_id)));
gst_video_decoder_drop_frame (vdec, out_frame);
gst_video_codec_frame_unref (out_frame);
return GST_FLOW_ERROR;
@ -386,7 +385,8 @@ gst_vaapidecode_push_all_decoded_frames(GstVaapiDecode *decode)
}
static GstFlowReturn
gst_vaapidecode_handle_frame(GstVideoDecoder *vdec, GstVideoCodecFrame *frame)
gst_vaapidecode_handle_frame (GstVideoDecoder * vdec,
GstVideoCodecFrame * frame)
{
GstVaapiDecode *const decode = GST_VAAPIDECODE (vdec);
GstVaapiDecoderStatus status;
@ -422,7 +422,8 @@ gst_vaapidecode_handle_frame(GstVideoDecoder *vdec, GstVideoCodecFrame *frame)
goto error_push_all_decoded_frames;
g_mutex_lock (&decode->surface_ready_mutex);
if (gst_vaapi_decoder_check_status (decode->decoder) == GST_VAAPI_DECODER_STATUS_ERROR_NO_SURFACE)
if (gst_vaapi_decoder_check_status (decode->decoder) ==
GST_VAAPI_DECODER_STATUS_ERROR_NO_SURFACE)
g_cond_wait (&decode->surface_ready, &decode->surface_ready_mutex);
g_mutex_unlock (&decode->surface_ready_mutex);
continue;
@ -599,8 +600,8 @@ gst_vaapidecode_create(GstVaapiDecode *decode, GstCaps *caps)
alignment = GST_VAAPI_STREAM_ALIGN_H264_NALU;
else
alignment = GST_VAAPI_STREAM_ALIGN_H264_NONE;
gst_vaapi_decoder_h264_set_alignment(
GST_VAAPI_DECODER_H264(decode->decoder), alignment);
gst_vaapi_decoder_h264_set_alignment (GST_VAAPI_DECODER_H264 (decode->
decoder), alignment);
}
}
break;
@ -644,7 +645,8 @@ gst_vaapidecode_destroy(GstVaapiDecode *decode)
}
static gboolean
gst_vaapidecode_reset_full(GstVaapiDecode *decode, GstCaps *caps, gboolean hard)
gst_vaapidecode_reset_full (GstVaapiDecode * decode, GstCaps * caps,
gboolean hard)
{
GstVaapiCodec codec;
@ -781,8 +783,7 @@ gst_vaapidecode_parse_frame(GstVideoDecoder *vdec,
if (got_frame) {
ret = gst_video_decoder_have_frame (vdec);
decode->current_frame_size = 0;
}
else
} else
ret = GST_VAAPI_DECODE_FLOW_PARSE_DATA;
break;
case GST_VAAPI_DECODER_STATUS_ERROR_NO_DATA:
@ -847,8 +848,7 @@ gst_vaapidecode_class_init(GstVaapiDecodeClass *klass)
gst_element_class_set_static_metadata (element_class,
"VA-API decoder",
"Codec/Decoder/Video",
GST_PLUGIN_DESC,
"Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
GST_PLUGIN_DESC, "Gwenole Beauchesne <gwenole.beauchesne@intel.com>");
/* sink pad */
pad_template = gst_static_pad_template_get (&gst_vaapidecode_sink_factory);
@ -872,8 +872,9 @@ gst_vaapidecode_ensure_allowed_caps(GstVaapiDecode *decode)
if (!gst_vaapidecode_ensure_display (decode))
goto error_no_display;
profiles = gst_vaapi_display_get_decode_profiles(
GST_VAAPI_PLUGIN_BASE_DISPLAY(decode));
profiles =
gst_vaapi_display_get_decode_profiles (GST_VAAPI_PLUGIN_BASE_DISPLAY
(decode));
if (!profiles)
goto error_no_profiles;
@ -952,8 +953,7 @@ gst_vaapidecode_query(GST_PAD_QUERY_FUNCTION_ARGS)
if (gst_vaapi_reply_to_query (query, plugin->display)) {
GST_DEBUG ("sharing display %p", plugin->display);
res = TRUE;
}
else if (GST_PAD_IS_SINK(pad)) {
} else if (GST_PAD_IS_SINK (pad)) {
switch (GST_QUERY_TYPE (query)) {
#if GST_CHECK_VERSION(1,0,0)
case GST_QUERY_CAPS:{
@ -969,8 +969,7 @@ gst_vaapidecode_query(GST_PAD_QUERY_FUNCTION_ARGS)
gst_caps_unref (tmp);
}
GST_DEBUG_OBJECT(decode, "Returning sink caps %" GST_PTR_FORMAT,
caps);
GST_DEBUG_OBJECT (decode, "Returning sink caps %" GST_PTR_FORMAT, caps);
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);
@ -983,8 +982,7 @@ gst_vaapidecode_query(GST_PAD_QUERY_FUNCTION_ARGS)
parent, query);
break;
}
}
else {
} else {
switch (GST_QUERY_TYPE (query)) {
#if GST_CHECK_VERSION(1,0,0)
case GST_QUERY_CAPS:{
@ -1000,8 +998,7 @@ gst_vaapidecode_query(GST_PAD_QUERY_FUNCTION_ARGS)
gst_caps_unref (tmp);
}
GST_DEBUG_OBJECT(decode, "Returning src caps %" GST_PTR_FORMAT,
caps);
GST_DEBUG_OBJECT (decode, "Returning src caps %" GST_PTR_FORMAT, caps);
gst_query_set_caps_result (query, caps);
gst_caps_unref (caps);