Skip to main content

Need getMediaTimeForFrame() clarification

1 reply [Last post]
stopiwalla
Offline
Joined: 2010-05-25
Points: 0

What is the purpose and use of this call:
public Time getMediaTimeForFrame(String name, Time mt, int direction) in DVRAPIImpl.java which implements DVRAPIManager?

The 'Time mt' param is a media time or a system time?

How is the the 'int direction' parameter used?

This is how I am interpreting it:
Given a DVR recording name, fetch the frame time (in mediaTime) at the specified time 'mt' which is a random media Time into the DVR recording (assuming it's not a system time), and if this is the case, the time itself allows us to seek to a particular location in the recording, than what's the use for direction?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
cpratt
Offline
Joined: 2008-12-18
Points: 0

Sorry for the delay - this post sneaked past me.

Your interpretation is mostly correct.

This method takes a media time and returns the media time of the video frame closest to the given media time in either the forward or reverse direction.

So if the direction is backwards, it will give you the media time of the nearest randomly-accessible frame preceding the given media time. i.e. the returned Time must be <= mt.

If forward, the media time of the nearest randomly-accessible frame following the given media time. i.e. the returned Time must be >= mt.

Also a call to getMediaTime() after calling setMediaTime(t = getMediaTimeForFrame(mt)) on a rate-0 stream must return t.

The contract for this method follows the contract for mpeos_dvrRecording/TSBMediaTimeForFrame() which is derived from the requirements of MediaTimeFactoryControl.setTimeApproximations().

Let me know if you have further questions.