Commit 736a5c08 authored by Stefan Kost's avatar Stefan Kost
Browse files

gst/adder/gstadder.c (gst_adder_src_event, gst_adder_collected,...

gst/adder/gstadder.c (gst_adder_src_event, gst_adder_collected, gst_adder_change_state): gst/adder/gstadder.h (bps, o...

Original commit message from CVS:
* gst/adder/gstadder.c (gst_adder_src_event, gst_adder_collected,
gst_adder_change_state):
* gst/adder/gstadder.h (bps, offset, collect_event, segment,
segment_pending, segment_position, segment_rate):
Handle playback-rate on adder.
parent db624feb
2007-05-08 Stefan Kost <ensonic@users.sf.net>
* gst/adder/gstadder.c (gst_adder_src_event, gst_adder_collected,
gst_adder_change_state):
* gst/adder/gstadder.h (bps, offset, collect_event, segment,
segment_pending, segment_position, segment_rate):
Handle playback-rate on adder.
2007-05-07 Michael Smith <msmith@fluendo.com>
 
* ext/theora/gsttheoradec.h:
......@@ -443,9 +443,9 @@ gst_adder_src_event (GstPad * pad, GstEvent * event)
GstSeekType curtype;
gint64 cur;
/* parse the flushing flag */
gst_event_parse_seek (event, NULL, NULL, &flags, &curtype, &cur, NULL,
NULL);
/* parse the seek parameters */
gst_event_parse_seek (event, &adder->segment_rate, NULL, &flags, &curtype,
&cur, NULL, NULL);
/* check if we are flushing */
if (flags & GST_SEEK_FLAG_FLUSH) {
......@@ -741,6 +741,7 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
GstEvent *event;
/* FIXME, use rate/applied_rate as set on all sinkpads.
* - currently we just set rate as received from last seek-event
* We could potentially figure out the duration as well using
* the current segment positions and the stated stop positions.
* Also we just start from stream time 0 which is rather
......@@ -752,7 +753,7 @@ gst_adder_collected (GstCollectPads * pads, gpointer user_data)
* the later streams would be delayed until the stream times
* match.
*/
event = gst_event_new_new_segment_full (FALSE, 1.0,
event = gst_event_new_new_segment_full (FALSE, adder->segment_rate,
1.0, GST_FORMAT_TIME, adder->timestamp, -1, adder->segment_position);
gst_pad_push_event (adder->srcpad, event);
......@@ -812,6 +813,7 @@ gst_adder_change_state (GstElement * element, GstStateChange transition)
adder->offset = 0;
adder->segment_pending = TRUE;
adder->segment_position = 0;
adder->segment_rate = 1.0;
gst_segment_init (&adder->segment, GST_FORMAT_UNDEFINED);
gst_collect_pads_start (adder->collect);
break;
......
......@@ -72,7 +72,7 @@ struct _GstAdder {
gboolean is_signed;
/* number of bytes per sample, actually width/8 * channels */
gint bps;
gint bps;
/* function to add samples */
GstAdderFunction func;
......@@ -80,12 +80,13 @@ struct _GstAdder {
/* counters to keep track of timestamps */
gint64 timestamp;
gint64 offset;
/* sink event handling */
GstPadEventFunction collect_event;
GstSegment segment;
gboolean segment_pending;
guint64 segment_position;
gdouble segment_rate;
};
struct _GstAdderClass {
......
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