diff options
author | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-06-14 19:27:03 +0200 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-06-19 11:03:14 +0200 |
commit | 15f1ccaef8a48e5646df4a38592ab570d0aff93e (patch) | |
tree | 717654ba1a3fc561b6c82164b4c7e8e1bc79494b /gst/frei0r | |
parent | d459b814f1f970fd5727e6a554cd9c264a6ce062 (diff) | |
download | gst-plugins-bad-15f1ccaef8a48e5646df4a38592ab570d0aff93e.tar.gz gst-plugins-bad-15f1ccaef8a48e5646df4a38592ab570d0aff93e.tar.bz2 gst-plugins-bad-15f1ccaef8a48e5646df4a38592ab570d0aff93e.zip |
frei0r: Don't allow caps changes in PLAYING/PAUSED
Most frei0r source plugins generate output based on
previous output and creating a new instance on caps
changes will let the output start at 0 again.
Diffstat (limited to 'gst/frei0r')
-rw-r--r-- | gst/frei0r/gstfrei0rsrc.c | 35 |
1 files changed, 11 insertions, 24 deletions
diff --git a/gst/frei0r/gstfrei0rsrc.c b/gst/frei0r/gstfrei0rsrc.c index 77d29964..b5bba6de 100644 --- a/gst/frei0r/gstfrei0rsrc.c +++ b/gst/frei0r/gstfrei0rsrc.c @@ -58,6 +58,16 @@ gst_frei0r_src_set_caps (GstBaseSrc * src, GstCaps * caps) return TRUE; } +static GstCaps * +gst_frei0r_src_get_caps (GstBaseSrc * src) +{ + if (GST_PAD_CAPS (GST_BASE_SRC_PAD (src))) + return gst_caps_ref (GST_PAD_CAPS (GST_BASE_SRC_PAD (src))); + else + return + gst_caps_copy (gst_pad_get_pad_template_caps (GST_BASE_SRC_PAD (src))); +} + static GstFlowReturn gst_frei0r_src_create (GstPushSrc * src, GstBuffer ** buf) { @@ -116,29 +126,6 @@ gst_frei0r_src_create (GstPushSrc * src, GstBuffer ** buf) return GST_FLOW_OK; } -static void -gst_frei0r_src_get_times (GstBaseSrc * basesrc, GstBuffer * buffer, - GstClockTime * start, GstClockTime * end) -{ - /* for live sources, sync on the timestamp of the buffer */ - if (gst_base_src_is_live (basesrc)) { - GstClockTime timestamp = GST_BUFFER_TIMESTAMP (buffer); - - if (GST_CLOCK_TIME_IS_VALID (timestamp)) { - /* get duration to calculate end time */ - GstClockTime duration = GST_BUFFER_DURATION (buffer); - - if (GST_CLOCK_TIME_IS_VALID (duration)) { - *end = timestamp + duration; - } - *start = timestamp; - } - } else { - *start = -1; - *end = -1; - } -} - static gboolean gst_frei0r_src_start (GstBaseSrc * basesrc) { @@ -358,10 +345,10 @@ gst_frei0r_src_class_init (GstFrei0rSrcClass * klass, gst_element_class_add_pad_template (gstelement_class, templ); gstbasesrc_class->set_caps = gst_frei0r_src_set_caps; + gstbasesrc_class->get_caps = gst_frei0r_src_get_caps; gstbasesrc_class->is_seekable = gst_frei0r_src_is_seekable; gstbasesrc_class->do_seek = gst_frei0r_src_do_seek; gstbasesrc_class->query = gst_frei0r_src_query; - gstbasesrc_class->get_times = gst_frei0r_src_get_times; gstbasesrc_class->start = gst_frei0r_src_start; gstbasesrc_class->stop = gst_frei0r_src_stop; |