From e90fcdbc80f3533c9e2754a2efa84316a55d0f80 Mon Sep 17 00:00:00 2001 From: Stefan Kost Date: Fri, 28 Apr 2006 18:55:17 +0000 Subject: [PATCH] make GstElementDetails const Original commit message from CVS: * gst/gstbin.c: * gst/gstpipeline.c: * plugins/elements/gstcapsfilter.c: * plugins/elements/gstfakesink.c: * plugins/elements/gstfakesrc.c: * plugins/elements/gstfdsink.c: * plugins/elements/gstfdsrc.c: * plugins/elements/gstfilesink.c: * plugins/elements/gstfilesrc.c: * plugins/elements/gstidentity.c: * plugins/elements/gstqueue.c: * plugins/elements/gsttee.c: * plugins/elements/gsttypefindelement.c: (gst_type_find_element_handle_event): make GstElementDetails const --- ChangeLog | 20 ++++++++++++++++++-- gst/gstbin.c | 7 +++++-- gst/gstpipeline.c | 2 +- plugins/elements/gstcapsfilter.c | 2 +- plugins/elements/gstfakesink.c | 2 +- plugins/elements/gstfakesrc.c | 2 +- plugins/elements/gstfdsink.c | 2 +- plugins/elements/gstfdsrc.c | 2 +- plugins/elements/gstfilesink.c | 2 +- plugins/elements/gstfilesrc.c | 2 +- plugins/elements/gstidentity.c | 3 ++- plugins/elements/gstqueue.c | 2 +- plugins/elements/gsttee.c | 2 +- plugins/elements/gsttypefindelement.c | 19 ++++++++++--------- 14 files changed, 45 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 255b43f680..6127e03c03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2006-04-28 Stefan Kost + + * gst/gstbin.c: + * gst/gstpipeline.c: + * plugins/elements/gstcapsfilter.c: + * plugins/elements/gstfakesink.c: + * plugins/elements/gstfakesrc.c: + * plugins/elements/gstfdsink.c: + * plugins/elements/gstfdsrc.c: + * plugins/elements/gstfilesink.c: + * plugins/elements/gstfilesrc.c: + * plugins/elements/gstidentity.c: + * plugins/elements/gstqueue.c: + * plugins/elements/gsttee.c: + * plugins/elements/gsttypefindelement.c: + (gst_type_find_element_handle_event): + make GstElementDetails const + 2006-04-28 Stefan Kost * libs/gst/base/gstbasesink.c: (gst_base_sink_event): @@ -21,8 +39,6 @@ 2006-04-28 Wim Taymans - Patch by: Topi Paavola - * gst/gstutils.c: (push_and_ref): Added some more docs. Fix refcount issue whith gst_element_found_tags() helper diff --git a/gst/gstbin.c b/gst/gstbin.c index 1ca83056a7..9f8c1bdb2e 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -167,7 +167,8 @@ GST_DEBUG_CATEGORY_STATIC (bin_debug); #define GST_CAT_DEFAULT bin_debug -static GstElementDetails gst_bin_details = GST_ELEMENT_DETAILS ("Generic bin", +static const GstElementDetails gst_bin_details = +GST_ELEMENT_DETAILS ("Generic bin", "Generic/Bin", "Simple container object", "Erik Walthinsen ," "Wim Taymans "); @@ -1895,7 +1896,9 @@ done: /* * This function is a utility event handler for seek events. - * It will send the event to all sinks. + * It will send the event to all sinks or sources depending on the + * event-direction. + * * Applications are free to override this behaviour and * implement their own seek handler, but this will work for * pretty much all cases in practice. diff --git a/gst/gstpipeline.c b/gst/gstpipeline.c index ccb4dc8997..0d238ca165 100644 --- a/gst/gstpipeline.c +++ b/gst/gstpipeline.c @@ -90,7 +90,7 @@ GST_DEBUG_CATEGORY_STATIC (pipeline_debug); #define GST_CAT_DEFAULT pipeline_debug -static GstElementDetails gst_pipeline_details = +static const GstElementDetails gst_pipeline_details = GST_ELEMENT_DETAILS ("Pipeline object", "Generic/Bin", "Complete pipeline object", diff --git a/plugins/elements/gstcapsfilter.c b/plugins/elements/gstcapsfilter.c index 07481570cd..33c503c8ab 100644 --- a/plugins/elements/gstcapsfilter.c +++ b/plugins/elements/gstcapsfilter.c @@ -29,7 +29,7 @@ #include -static GstElementDetails gst_capsfilter_details = +static const GstElementDetails gst_capsfilter_details = GST_ELEMENT_DETAILS ("CapsFilter", "Generic", "Pass data without modification, limiting formats", diff --git a/plugins/elements/gstfakesink.c b/plugins/elements/gstfakesink.c index abe34ed250..15a1d2a439 100644 --- a/plugins/elements/gstfakesink.c +++ b/plugins/elements/gstfakesink.c @@ -42,7 +42,7 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_DEBUG_CATEGORY_STATIC (gst_fake_sink_debug); #define GST_CAT_DEFAULT gst_fake_sink_debug -static GstElementDetails gst_fake_sink_details = +static const GstElementDetails gst_fake_sink_details = GST_ELEMENT_DETAILS ("Fake Sink", "Sink", "Black hole for data", diff --git a/plugins/elements/gstfakesrc.c b/plugins/elements/gstfakesrc.c index bb0d1d8ccd..9084e1c242 100644 --- a/plugins/elements/gstfakesrc.c +++ b/plugins/elements/gstfakesrc.c @@ -65,7 +65,7 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", GST_DEBUG_CATEGORY_STATIC (gst_fake_src_debug); #define GST_CAT_DEFAULT gst_fake_src_debug -static GstElementDetails gst_fake_src_details = +static const GstElementDetails gst_fake_src_details = GST_ELEMENT_DETAILS ("Fake Source", "Source", "Push empty (no data) buffers around", diff --git a/plugins/elements/gstfdsink.c b/plugins/elements/gstfdsink.c index 373f7fbc0b..b5eb634241 100644 --- a/plugins/elements/gstfdsink.c +++ b/plugins/elements/gstfdsink.c @@ -88,7 +88,7 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_DEBUG_CATEGORY_STATIC (gst_fd_sink__debug); #define GST_CAT_DEFAULT gst_fd_sink__debug -static GstElementDetails gst_fd_sink__details = +static const GstElementDetails gst_fd_sink__details = GST_ELEMENT_DETAILS ("Filedescriptor Sink", "Sink/File", "Write data to a file descriptor", diff --git a/plugins/elements/gstfdsrc.c b/plugins/elements/gstfdsrc.c index 1ad6e04dd5..d090dc3a3b 100644 --- a/plugins/elements/gstfdsrc.c +++ b/plugins/elements/gstfdsrc.c @@ -78,7 +78,7 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", GST_DEBUG_CATEGORY_STATIC (gst_fd_src_debug); #define GST_CAT_DEFAULT gst_fd_src_debug -static GstElementDetails gst_fd_src_details = +static const GstElementDetails gst_fd_src_details = GST_ELEMENT_DETAILS ("Disk Source", "Source/File", "Synchronous read from a file", diff --git a/plugins/elements/gstfilesink.c b/plugins/elements/gstfilesink.c index de6f669e75..e1e86f6348 100644 --- a/plugins/elements/gstfilesink.c +++ b/plugins/elements/gstfilesink.c @@ -52,7 +52,7 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_DEBUG_CATEGORY_STATIC (gst_file_sink_debug); #define GST_CAT_DEFAULT gst_file_sink_debug -static GstElementDetails gst_file_sink_details = +static const GstElementDetails gst_file_sink_details = GST_ELEMENT_DETAILS ("File Sink", "Sink/File", "Write stream to a file", diff --git a/plugins/elements/gstfilesrc.c b/plugins/elements/gstfilesrc.c index 72aa74f287..2cdd2893c2 100644 --- a/plugins/elements/gstfilesrc.c +++ b/plugins/elements/gstfilesrc.c @@ -116,7 +116,7 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", GST_DEBUG_CATEGORY_STATIC (gst_file_src_debug); #define GST_CAT_DEFAULT gst_file_src_debug -static GstElementDetails gst_file_src_details = +static const GstElementDetails gst_file_src_details = GST_ELEMENT_DETAILS ("File Source", "Source/File", "Read from arbitrary point in a file", diff --git a/plugins/elements/gstidentity.c b/plugins/elements/gstidentity.c index 0e8f6c7239..cd24d42471 100644 --- a/plugins/elements/gstidentity.c +++ b/plugins/elements/gstidentity.c @@ -45,7 +45,8 @@ static GstStaticPadTemplate srctemplate = GST_STATIC_PAD_TEMPLATE ("src", GST_DEBUG_CATEGORY_STATIC (gst_identity_debug); #define GST_CAT_DEFAULT gst_identity_debug -static GstElementDetails gst_identity_details = GST_ELEMENT_DETAILS ("Identity", +static const GstElementDetails gst_identity_details = +GST_ELEMENT_DETAILS ("Identity", "Generic", "Pass data without modification", "Erik Walthinsen "); diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index f4f1a3e5f0..9f738ccfdf 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -76,7 +76,7 @@ GST_DEBUG_CATEGORY_STATIC (queue_dataflow); queue->max_size.time, \ queue->queue->length) -static GstElementDetails gst_queue_details = GST_ELEMENT_DETAILS ("Queue", +static const GstElementDetails gst_queue_details = GST_ELEMENT_DETAILS ("Queue", "Generic", "Simple data queue", "Erik Walthinsen "); diff --git a/plugins/elements/gsttee.c b/plugins/elements/gsttee.c index 5632a42801..3317a1ee5b 100644 --- a/plugins/elements/gsttee.c +++ b/plugins/elements/gsttee.c @@ -45,7 +45,7 @@ static GstStaticPadTemplate sinktemplate = GST_STATIC_PAD_TEMPLATE ("sink", GST_DEBUG_CATEGORY_STATIC (gst_tee_debug); #define GST_CAT_DEFAULT gst_tee_debug -static GstElementDetails gst_tee_details = +static const GstElementDetails gst_tee_details = GST_ELEMENT_DETAILS ("Tee pipe fitting", "Generic", "1-to-N pipe fitting", diff --git a/plugins/elements/gsttypefindelement.c b/plugins/elements/gsttypefindelement.c index b1ef91107d..6cdf2df460 100644 --- a/plugins/elements/gsttypefindelement.c +++ b/plugins/elements/gsttypefindelement.c @@ -63,7 +63,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_type_find_element_debug); #define GST_CAT_DEFAULT gst_type_find_element_debug -static GstElementDetails gst_type_find_element_details = +static const GstElementDetails gst_type_find_element_details = GST_ELEMENT_DETAILS ("TypeFind", "Generic", "Finds the media type of a stream", @@ -476,16 +476,17 @@ gst_type_find_element_handle_event (GstPad * pad, GstEvent * event) if (typefind->store) { caps = gst_type_find_helper_for_buffer (GST_OBJECT (typefind), typefind->store, &prob); + + if (caps && prob >= typefind->min_probability) { + g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], + 0, prob, caps); + } else { + GST_ELEMENT_ERROR (typefind, STREAM, TYPE_NOT_FOUND, + (NULL), (NULL)); + } + gst_caps_replace (&caps, NULL); } - if (caps && prob >= typefind->min_probability) { - g_signal_emit (typefind, gst_type_find_element_signals[HAVE_TYPE], - 0, prob, caps); - } else { - GST_ELEMENT_ERROR (typefind, STREAM, TYPE_NOT_FOUND, - (NULL), (NULL)); - } - gst_caps_replace (&caps, NULL); stop_typefinding (typefind); res = gst_pad_event_default (pad, event); break;