[gst-devel] Can a controller use a different clock?

Stefan Kost ensonic at hora-obscura.de
Tue Jun 5 10:37:53 CEST 2007


hi,

Steve Fink wrote:
<snip>
> I want dynamic volume control with a stream that I am seeking around
> within. Specifically, I want two very different types: (1) I want to
> overlay a volume "track" on top of a stream where the volume at any
> point is tied to the offset within that stream, and (2) I want a
> volume adjustment that happens relative to playback time. #1 is used
> when using a single source sound clip and making several variations,
> where each variation has its own settings for what part of the clip
> should be loud and what part should be soft. These variants will be
> played back with occasional nonlinearities where I seek to different
> points within the clip, and the same part of the clip for a given
> variant should always have the same volume. #2 is used for fading out
> the playback, probably because you're switching to something else. (It
> may not be a global fade across all clips, though; there may be other
> streams getting mixed in on their own timelines.)

You schedule parameter changes as soon as you know when they should happen. If
you want to fade out the volume as a result of a button click the I would query
the position of the stream in the button-pressed callback and schedule two
parameter changes [position,1.0],[position+(3*GST_SECOND),0.0]. Maybe adding a
little to the first control-change position. Also set the interpolation mode to
linear.

> 
>>From what I can tell (or what you told me, rather), GstController does
> #1. If I do a seek, then the controller will adjust the property
> values based on the position within the stream (the timestamp in the
> quoted code).
The controller follows the playback position. If you play the part again, the
volume fade will happen again. If you don't want that remove the control-points
(e.g. on EOS or SEGMENT_DONE).
> #2 must be done manually, or by using a custom
> interpolation function that ignores most of its input and looks up the
> current playback time instead.
> 

Stefan





More information about the gstreamer-devel mailing list