VIDEO: Add a getDuration() function to SeekableVideoDecoder

This function returns the total duration of the video
This commit is contained in:
Matthew Hoops 2011-03-21 18:27:10 -04:00
parent 40c496d730
commit 94c27e4657
2 changed files with 6 additions and 0 deletions

View File

@ -122,6 +122,7 @@ public:
// SeekableVideoDecoder API
void seekToFrame(uint32 frame);
void seekToTime(Audio::Timestamp time);
uint32 getDuration() const { return _duration * 1000 / _timeScale; }
private:
// This is the file handle from which data is read from. It can be the actual file handle or a decompressed stream.

View File

@ -266,6 +266,11 @@ public:
* Implementation of RewindableVideoDecoder::rewind().
*/
virtual void rewind() { seekToTime(0); }
/**
* Get the total duration of the video (in ms).
*/
virtual uint32 getDuration() const = 0;
};
} // End of namespace Video