Commit ac4fc0ed authored by Stefan Kost's avatar Stefan Kost

gst/spectrum/gstspectrum.*: One FIXME less, by resolving message timestamps...

gst/spectrum/gstspectrum.*: One FIXME less, by resolving message timestamps against the playback segment.

Original commit message from CVS:
* gst/spectrum/gstspectrum.c: (gst_spectrum_start),
(gst_spectrum_event), (gst_spectrum_transform_ip):
* gst/spectrum/gstspectrum.h:
One FIXME less, by resolving message timestamps against the playback
segment.
parent 91ffb37c
2007-03-07 Stefan Kost <ensonic@users.sf.net>
* gst/spectrum/gstspectrum.c: (gst_spectrum_start),
(gst_spectrum_event), (gst_spectrum_transform_ip):
* gst/spectrum/gstspectrum.h:
One FIXME less, by resolving message timestamps against the playback
segment.
2007-03-06 Wim Taymans <wim@fluendo.com> 2007-03-06 Wim Taymans <wim@fluendo.com>
* gst/spectrum/gstspectrum.c: (gst_spectrum_class_init), * gst/spectrum/gstspectrum.c: (gst_spectrum_class_init),
......
common @ c4f56a65
Subproject commit 9a56e28fc15440eb6852411321c46312e1d1bb73 Subproject commit c4f56a657d79aee0e3fc25ef2bcf876f9f3c1593
...@@ -297,6 +297,7 @@ gst_spectrum_start (GstBaseTransform * trans) ...@@ -297,6 +297,7 @@ gst_spectrum_start (GstBaseTransform * trans)
GstSpectrum *filter = GST_SPECTRUM (trans); GstSpectrum *filter = GST_SPECTRUM (trans);
filter->num_frames = 0; filter->num_frames = 0;
gst_segment_init (&filter->segment, GST_FORMAT_UNDEFINED);
return TRUE; return TRUE;
} }
...@@ -321,6 +322,22 @@ gst_spectrum_event (GstBaseTransform * trans, GstEvent * event) ...@@ -321,6 +322,22 @@ gst_spectrum_event (GstBaseTransform * trans, GstEvent * event)
case GST_EVENT_EOS: case GST_EVENT_EOS:
gst_adapter_clear (filter->adapter); gst_adapter_clear (filter->adapter);
break; break;
case GST_EVENT_NEWSEGMENT:{
GstFormat format;
gdouble rate, arate;
gint64 start, stop, time;
gboolean update;
/* the newsegment values are used to clip the input samples
* and to convert the incomming timestamps to running time */
gst_event_parse_new_segment_full (event, &update, &rate, &arate, &format,
&start, &stop, &time);
/* now configure the values */
gst_segment_set_newsegment_full (&filter->segment, update,
rate, arate, format, start, stop, time);
break;
}
default: default:
break; break;
} }
...@@ -369,9 +386,9 @@ gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * in) ...@@ -369,9 +386,9 @@ gst_spectrum_transform_ip (GstBaseTransform * trans, GstBuffer * in)
gfloat pos, step; gfloat pos, step;
guchar *spect = spectrum->spect; guchar *spect = spectrum->spect;
/* FIXME, the buffer timestamp does not mean anything, maybe you mean GstClockTime endtime =
* stream_time or running_time? */ gst_segment_to_running_time (&spectrum->segment, GST_FORMAT_TIME,
GstClockTime endtime = GST_BUFFER_TIMESTAMP (in); GST_BUFFER_TIMESTAMP (in));
GstClockTime blktime = GstClockTime blktime =
GST_FRAMES_TO_CLOCK_TIME (spectrum->len, spectrum->rate); GST_FRAMES_TO_CLOCK_TIME (spectrum->len, spectrum->rate);
......
...@@ -45,6 +45,7 @@ struct _GstSpectrum { ...@@ -45,6 +45,7 @@ struct _GstSpectrum {
GstPad *sinkpad,*srcpad; GstPad *sinkpad,*srcpad;
GstAdapter *adapter; GstAdapter *adapter;
GstSegment segment;
/* properties */ /* properties */
gboolean message; /* whether or not to post messages */ gboolean message; /* whether or not to post messages */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment