elements: use new gst_element_class_add_static_pad_template()

https://bugzilla.gnome.org/show_bug.cgi?id=762778
This commit is contained in:
Tim-Philipp Müller 2016-02-27 15:36:28 +00:00
parent fa12d23a17
commit cf0680017e
20 changed files with 50 additions and 81 deletions

View file

@ -145,10 +145,8 @@ gst_capsfilter_class_init (GstCapsFilterClass * klass)
"Generic",
"Pass data without modification, limiting formats",
"David Schleef <ds@schleef.org>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
trans_class = GST_BASE_TRANSFORM_CLASS (klass);
trans_class->transform_caps =

View file

@ -95,14 +95,12 @@ gst_concat_pad_init (GstConcatPad * self)
self->flushing = FALSE;
}
static GstStaticPadTemplate concat_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink_%u",
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS_ANY);
static GstStaticPadTemplate concat_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
@ -178,10 +176,8 @@ gst_concat_class_init (GstConcatClass * klass)
"Concat", "Generic", "Concatenate multiple streams",
"Sebastian Dröge <sebastian@centricular.com>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&concat_sink_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&concat_src_template));
gst_element_class_add_static_pad_template (gstelement_class, &sink_template);
gst_element_class_add_static_pad_template (gstelement_class, &src_template);
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_concat_request_new_pad);
@ -195,7 +191,7 @@ gst_concat_init (GstConcat * self)
g_mutex_init (&self->lock);
g_cond_init (&self->cond);
self->srcpad = gst_pad_new_from_static_template (&concat_src_template, "src");
self->srcpad = gst_pad_new_from_static_template (&src_template, "src");
gst_pad_set_event_function (self->srcpad,
GST_DEBUG_FUNCPTR (gst_concat_src_event));
gst_pad_set_query_function (self->srcpad,

View file

@ -271,10 +271,8 @@ gst_download_buffer_class_init (GstDownloadBufferClass * klass)
/* set several parent class virtual functions */
gobject_class->finalize = gst_download_buffer_finalize;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
gst_element_class_set_static_metadata (gstelement_class, "DownloadBuffer",
"Generic", "Download Buffer element",

View file

@ -224,8 +224,8 @@ gst_fake_sink_class_init (GstFakeSinkClass * klass)
"Erik Walthinsen <omega@cse.ogi.edu>, "
"Wim Taymans <wim@fluendo.com>, "
"Mr. 'frag-me-more' Vanderwingo <wingo@fluendo.com>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_fake_sink_change_state);

View file

@ -340,8 +340,7 @@ gst_fake_src_class_init (GstFakeSrcClass * klass)
"Source",
"Push empty (no data) buffers around",
"Erik Walthinsen <omega@cse.ogi.edu>, " "Wim Taymans <wim@fluendo.com>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
gstbase_src_class->is_seekable = GST_DEBUG_FUNCPTR (gst_fake_src_is_seekable);
gstbase_src_class->start = GST_DEBUG_FUNCPTR (gst_fake_src_start);

View file

@ -146,8 +146,7 @@ gst_fd_sink_class_init (GstFdSinkClass * klass)
"Filedescriptor Sink",
"Sink/File",
"Write data to a file descriptor", "Erik Walthinsen <omega@cse.ogi.edu>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
gstbasesink_class->render = GST_DEBUG_FUNCPTR (gst_fd_sink_render);
gstbasesink_class->render_list = GST_DEBUG_FUNCPTR (gst_fd_sink_render_list);

View file

@ -174,8 +174,7 @@ gst_fd_src_class_init (GstFdSrcClass * klass)
"Filedescriptor Source",
"Source/File",
"Read from a file descriptor", "Erik Walthinsen <omega@cse.ogi.edu>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_fd_src_start);
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_fd_src_stop);

View file

@ -238,8 +238,7 @@ gst_file_sink_class_init (GstFileSinkClass * klass)
"File Sink",
"Sink/File", "Write stream to a file",
"Thomas Vander Stichele <thomas at apestaart dot org>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
gstbasesink_class->start = GST_DEBUG_FUNCPTR (gst_file_sink_start);
gstbasesink_class->stop = GST_DEBUG_FUNCPTR (gst_file_sink_stop);

View file

@ -196,8 +196,7 @@ gst_file_src_class_init (GstFileSrcClass * klass)
"Source/File",
"Read from arbitrary point in a file",
"Erik Walthinsen <omega@cse.ogi.edu>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
gstbasesrc_class->start = GST_DEBUG_FUNCPTR (gst_file_src_start);
gstbasesrc_class->stop = GST_DEBUG_FUNCPTR (gst_file_src_stop);

View file

@ -95,14 +95,12 @@ gst_funnel_pad_init (GstFunnelPad * pad)
pad->got_eos = FALSE;
}
static GstStaticPadTemplate funnel_sink_template =
GST_STATIC_PAD_TEMPLATE ("sink_%u",
static GstStaticPadTemplate sink_template = GST_STATIC_PAD_TEMPLATE ("sink_%u",
GST_PAD_SINK,
GST_PAD_REQUEST,
GST_STATIC_CAPS_ANY);
static GstStaticPadTemplate funnel_src_template =
GST_STATIC_PAD_TEMPLATE ("src",
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src",
GST_PAD_SRC,
GST_PAD_ALWAYS,
GST_STATIC_CAPS_ANY);
@ -199,10 +197,8 @@ gst_funnel_class_init (GstFunnelClass * klass)
"Funnel pipe fitting", "Generic", "N-to-1 pipe fitting",
"Olivier Crete <olivier.crete@collabora.co.uk>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&funnel_sink_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&funnel_src_template));
gst_element_class_add_static_pad_template (gstelement_class, &sink_template);
gst_element_class_add_static_pad_template (gstelement_class, &src_template);
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_funnel_request_new_pad);
@ -213,8 +209,7 @@ gst_funnel_class_init (GstFunnelClass * klass)
static void
gst_funnel_init (GstFunnel * funnel)
{
funnel->srcpad = gst_pad_new_from_static_template (&funnel_src_template,
"src");
funnel->srcpad = gst_pad_new_from_static_template (&src_template, "src");
gst_pad_use_fixed_caps (funnel->srcpad);
gst_element_add_pad (GST_ELEMENT (funnel), funnel->srcpad);

View file

@ -242,10 +242,8 @@ gst_identity_class_init (GstIdentityClass * klass)
"Identity",
"Generic",
"Pass data without modification", "Erik Walthinsen <omega@cse.ogi.edu>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_identity_change_state);

View file

@ -1271,10 +1271,10 @@ gst_input_selector_class_init (GstInputSelectorClass * klass)
"Julien Moutte <julien@moutte.net>, "
"Jan Schmidt <thaytan@mad.scientist.com>, "
"Wim Taymans <wim.taymans@gmail.com>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_input_selector_sink_factory));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_input_selector_src_factory));
gst_element_class_add_static_pad_template (gstelement_class,
&gst_input_selector_sink_factory);
gst_element_class_add_static_pad_template (gstelement_class,
&gst_input_selector_src_factory);
gstelement_class->request_new_pad = gst_input_selector_request_new_pad;
gstelement_class->release_pad = gst_input_selector_release_pad;

View file

@ -474,10 +474,8 @@ gst_multi_queue_class_init (GstMultiQueueClass * klass)
gst_element_class_set_static_metadata (gstelement_class,
"MultiQueue",
"Generic", "Multiple data queue", "Edward Hervey <edward@fluendo.com>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_multi_queue_request_new_pad);

View file

@ -135,10 +135,10 @@ gst_output_selector_class_init (GstOutputSelectorClass * klass)
gst_element_class_set_static_metadata (gstelement_class, "Output selector",
"Generic", "1-to-N output stream selector",
"Stefan Kost <stefan.kost@nokia.com>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_output_selector_sink_factory));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_output_selector_src_factory));
gst_element_class_add_static_pad_template (gstelement_class,
&gst_output_selector_sink_factory);
gst_element_class_add_static_pad_template (gstelement_class,
&gst_output_selector_src_factory);
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_output_selector_request_new_pad);

View file

@ -407,10 +407,8 @@ gst_queue_class_init (GstQueueClass * klass)
gst_element_class_set_static_metadata (gstelement_class,
"Queue",
"Generic", "Simple data queue", "Erik Walthinsen <omega@cse.ogi.edu>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
/* Registering debug symbols for function pointers */
GST_DEBUG_REGISTER_FUNCPTR (gst_queue_src_activate_mode);

View file

@ -410,10 +410,8 @@ gst_queue2_class_init (GstQueue2Class * klass)
/* set several parent class virtual functions */
gobject_class->finalize = gst_queue2_finalize;
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
gst_element_class_set_static_metadata (gstelement_class, "Queue 2",
"Generic",

View file

@ -110,11 +110,11 @@ gst_streamid_demux_class_init (GstStreamidDemuxClass * klass)
gst_element_class_set_static_metadata (gstelement_class, "Streamid Demux",
"Generic", "1-to-N output stream by stream-id",
"HoonHee Lee <hoonhee.lee@lge.com>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_streamid_demux_sink_factory));
gst_element_class_add_static_pad_template (gstelement_class,
&gst_streamid_demux_sink_factory);
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&gst_streamid_demux_src_factory));
gst_element_class_add_static_pad_template (gstelement_class,
&gst_streamid_demux_src_factory);
gstelement_class->change_state = gst_streamid_demux_change_state;
}

View file

@ -99,8 +99,7 @@ enum
PROP_ALLOW_NOT_LINKED,
};
static GstStaticPadTemplate tee_src_template =
GST_STATIC_PAD_TEMPLATE ("src_%u",
static GstStaticPadTemplate src_template = GST_STATIC_PAD_TEMPLATE ("src_%u",
GST_PAD_SRC,
GST_PAD_REQUEST,
GST_STATIC_CAPS_ANY);
@ -290,10 +289,8 @@ gst_tee_class_init (GstTeeClass * klass)
"Generic",
"1-to-N pipe fitting",
"Erik Walthinsen <omega@cse.ogi.edu>, " "Wim Taymans <wim@fluendo.com>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&tee_src_template));
gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
gst_element_class_add_static_pad_template (gstelement_class, &src_template);
gstelement_class->request_new_pad =
GST_DEBUG_FUNCPTR (gst_tee_request_new_pad);

View file

@ -232,10 +232,10 @@ gst_type_find_element_class_init (GstTypeFindElementClass * typefind_class)
"Generic",
"Finds the media type of a stream",
"Benjamin Otte <in7y118@public.uni-hamburg.de>");
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&type_find_element_src_template));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&type_find_element_sink_template));
gst_element_class_add_static_pad_template (gstelement_class,
&type_find_element_src_template);
gst_element_class_add_static_pad_template (gstelement_class,
&type_find_element_sink_template);
gstelement_class->change_state =
GST_DEBUG_FUNCPTR (gst_type_find_element_change_state);

View file

@ -95,10 +95,8 @@ gst_valve_class_init (GstValveClass * klass)
DEFAULT_DROP, G_PARAM_READWRITE | GST_PARAM_MUTABLE_PLAYING |
G_PARAM_STATIC_STRINGS));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&srctemplate));
gst_element_class_add_pad_template (gstelement_class,
gst_static_pad_template_get (&sinktemplate));
gst_element_class_add_static_pad_template (gstelement_class, &srctemplate);
gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate);
gst_element_class_set_static_metadata (gstelement_class, "Valve element",
"Filter", "Drops buffers and events or lets them through",