anyone who can explain more on the difference between segment.abs_rate and segment.abs_applied_rate

Wim Taymans wim.taymans at gmail.com
Wed Oct 19 00:12:16 PDT 2011


On 10/19/2011 08:58 AM, bcxa sz wrote:
> Hi Wim,
>
> Thanks for your explanation. Can you help me further?
>
> On Wed, Oct 19, 2011 at 1:14 PM, Wim Taymans<wim.taymans at gmail.com>  wrote:
>> On 10/19/2011 04:14 AM, bcxa sz wrote:
>>>
>>> Hi Developers,
>>>
>>> I am reading the design document on the sync and notice formulas to
>>> calculate the running time and the stream time:
>>>
>>> B.running_time = (B.time_stamp - NS.start) / NS.abs_rate + NS.accum
>>>
>>> stream_time =  (B.time_stamp - NS.start) / NS.abs_applied_rate + NS.accum
>>
>> The formula for stream time is wrong, it should be NS.time instead of
>> NS.accum..
>>
>
> Yes, you are right. Also I can not get the meaning of NS.time and
> NS.accum from document. Can you explain a little bit on this?

NS.time is the stream time associated with the NS.start value. It is 
used in position reporting.

Every time a new segment event is received (and the update flag is 
FALSE), NS.accum should be incremented with the duration of the previous 
segment event. The purpose of this value is to keep track of the total 
elapsed time taken up by all previous segments. It is used in the 
calculation of the running_time and it is needed to make the 
running_time increment monotonically. Again, a piece of paper and some 
segments will illustrate this. Your use case should be the looping of 
some media sample.

>
>>>
>>> Anyone can explain to me why the running_time use abs_rate but
>>> stream_time use abs_applied_rate?
>>
>> Because using the same value for both timelines does not give the desired
>> results..
>>
> can you explain a little to me why?

Because for negative playback rates, we want the running_time to 
increment and the stream_time to decrement. We also want to be able to 
independently control playback speed and position reporting.

Wim

>
>> Wim
>>
>>> _______________________________________________
>>> gstreamer-devel mailing list
>>> gstreamer-devel at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
>> _______________________________________________
>> gstreamer-devel mailing list
>> gstreamer-devel at lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
>>
> _______________________________________________
> gstreamer-devel mailing list
> gstreamer-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/gstreamer-devel



More information about the gstreamer-devel mailing list