xoreos
0.0.5
|
Decoder for QuickTime videos. More...
#include <quicktime.h>
Classes | |
struct | Atom |
class | AudioSampleDesc |
class | AudioTrackHandler |
struct | ParseTable |
class | QuickTimeAudioTrack |
struct | QuickTimeTrack |
class | SampleDesc |
struct | SampleToChunkEntry |
struct | TimeToSampleEntry |
class | VideoSampleDesc |
class | VideoTrackHandler |
Public Member Functions | |
QuickTimeDecoder (Common::SeekableReadStream *stream) | |
~QuickTimeDecoder () | |
Public Member Functions inherited from Video::VideoDecoder | |
VideoDecoder () | |
~VideoDecoder () | |
void | setScale (Scale scale) |
bool | isPlaying () const |
Is the video currently playing? More... | |
virtual uint32 | getWidth () const |
Returns the width of the video's frames. More... | |
virtual uint32 | getHeight () const |
Returns the height of the video's frames. More... | |
void | start () |
Start playing the video. More... | |
void | abort () |
Abort the playing of the video. More... | |
bool | needsUpdate () const |
Check whether a new frame should be decoded, i.e. More... | |
bool | endOfVideo () const |
Returns if the video has reached the end or not. More... | |
bool | endOfVideoTracks () const |
Have all video tracks finished? More... | |
uint32 | getTime () const |
Returns the time position (in ms) of the current video. More... | |
uint32 | getTimeToNextFrame () const |
Return the time, in milliseconds, to the next frame. More... | |
void | calculateDistance () |
Calculate the object's distance. More... | |
void | render (Graphics::RenderPass pass) |
Render the object. More... | |
virtual Common::Timestamp | getDuration () const |
Get the duration of the video. More... | |
void | pauseVideo (bool pause) |
Pause or resume the video. More... | |
bool | isPaused () const |
Return whether the video is currently paused or not. More... | |
Public Member Functions inherited from Graphics::GLContainer | |
GLContainer () | |
~GLContainer () | |
void | rebuild () |
void | destroy () |
Public Member Functions inherited from Graphics::Queueable | |
Queueable () | |
virtual | ~Queueable () |
Public Member Functions inherited from Graphics::Renderable | |
Renderable (RenderableType type) | |
~Renderable () | |
bool | operator< (const Queueable &q) const |
virtual void | advanceTime (float dt) |
Advance time (used by renderables with animations). More... | |
virtual void | renderImmediate (const glm::mat4 &parentTransform) |
For shader based systems, don't sort anything, render this right_now. More... | |
virtual void | queueRender (const glm::mat4 &parentTransform) |
Queue the object for later rendering. More... | |
double | getDistance () const |
Get the distance of the object from the viewer. More... | |
uint32 | getID () const |
Get the object's unique ID. More... | |
bool | isClickable () const |
Is the object clickable? More... | |
void | setClickable (bool clickable) |
Set the object's clickable state. More... | |
const Common::UString & | getTag () const |
Get the object's tag. More... | |
void | setTag (const Common::UString &tag) |
Set the object's tag. More... | |
bool | isVisible () const |
Is the object visible? More... | |
virtual void | show () |
Show the object. More... | |
virtual void | hide () |
Hide the object. More... | |
virtual bool | isIn (float x, float y) const |
Is that point within the object? More... | |
virtual bool | isIn (float x, float y, float z) const |
Is that point within the object? More... | |
virtual bool | isIn (float x1, float y1, float z1, float x2, float y2, float z2) const |
Does the line from x1.y1.z1 to x2.y2.z2 intersect with the object? More... | |
Protected Member Functions | |
void | decodeNextTrackFrame (VideoTrack &track) |
Decode enough data for the next frame. More... | |
Protected Member Functions inherited from Video::VideoDecoder | |
void | initVideo () |
Create a surface for video of these dimensions. More... | |
void | deinit () |
void | doRebuild () |
void | doDestroy () |
void | addTrack (Track *track, bool isExternal=false) |
Define a track to be used by this class. More... | |
TrackPtr | getTrack (uint track) |
Get the given internal track based on its index. More... | |
ConstTrackPtr | getTrack (uint track) const |
Get the given internal track based on its index. More... | |
VideoTrackPtr | findNextVideoTrack () |
Set _nextVideoTrack to the video track with the lowest start time for the next frame. More... | |
TrackList | getInternalTracks () |
Get a copy of the internal tracks. More... | |
ConstTrackList | getInternalTracks () const |
Get a copy of the internal tracks. More... | |
Protected Member Functions inherited from Graphics::Queueable | |
bool | isInQueue (QueueType queue) const |
void | addToQueue (QueueType queue) |
void | removeFromQueue (QueueType queue) |
void | lockQueue (QueueType queue) |
void | unlockQueue (QueueType queue) |
void | sortQueue (QueueType queue) |
Protected Member Functions inherited from Graphics::Renderable | |
void | resort () |
void | lockFrame () |
void | unlockFrame () |
void | lockFrameIfVisible () |
void | unlockFrameIfVisible () |
Private Types | |
enum | CodecType { CODEC_TYPE_MOV_OTHER, CODEC_TYPE_VIDEO, CODEC_TYPE_AUDIO } |
Private Member Functions | |
SampleDesc * | readSampleDesc (QuickTimeTrack *track, uint32 format) |
void | initParseTable () |
void | checkAudioBuffer (AudioTrack &track, const Common::Timestamp &endTime) |
Ensure that there is enough audio buffered in the given track to reach the given timestamp. More... | |
Codec * | findDefaultVideoCodec () const |
int | readDefault (Atom atom) |
int | readLeaf (Atom atom) |
int | readELST (Atom atom) |
int | readHDLR (Atom atom) |
int | readMDHD (Atom atom) |
int | readMOOV (Atom atom) |
int | readMVHD (Atom atom) |
int | readTRAK (Atom atom) |
int | readSTCO (Atom atom) |
int | readSTSC (Atom atom) |
int | readSTSD (Atom atom) |
int | readSTSS (Atom atom) |
int | readSTSZ (Atom atom) |
int | readSTTS (Atom atom) |
int | readESDS (Atom atom) |
void | load () |
Private Attributes | |
Common::ScopedPtr< Common::SeekableReadStream > | _fd |
const ParseTable * | _parseTable |
bool | _foundMOOV |
uint32 | _timeScale |
Common::PtrVector< QuickTimeTrack > | _tracks |
Common::PtrVector< QuickTimeAudioTrack > | _audioTracks |
int | _videoTrackIndex |
Additional Inherited Members | |
Public Types inherited from Video::VideoDecoder | |
enum | Scale { kScaleNone, kScaleUp, kScaleDown, kScaleUpDown } |
Protected Types inherited from Video::VideoDecoder | |
typedef boost::shared_ptr< Track > | TrackPtr |
A Track pointer. More... | |
typedef boost::shared_ptr< const Track > | ConstTrackPtr |
A const Track pointer. More... | |
typedef boost::shared_ptr< AudioTrack > | AudioTrackPtr |
An AudioTrack pointer. More... | |
typedef boost::shared_ptr< VideoTrack > | VideoTrackPtr |
A VideoTrack pointer. More... | |
typedef std::vector< TrackPtr > | TrackList |
A list of tracks. More... | |
typedef std::vector< ConstTrackPtr > | ConstTrackList |
A list of const tracks. More... | |
Protected Attributes inherited from Video::VideoDecoder | |
bool | _needCopy |
Is new frame content available that needs to by copied? More... | |
Common::ScopedPtr< Graphics::Surface > | _surface |
The video's surface. More... | |
Protected Attributes inherited from Graphics::Renderable | |
QueueType | _queueExists |
QueueType | _queueVisible |
uint32 | _id |
bool | _clickable |
Common::UString | _tag |
double | _distance |
The distance of the object from the viewer. More... | |
Decoder for QuickTime videos.
Definition at line 84 of file quicktime.h.
|
private |
Enumerator | |
---|---|
CODEC_TYPE_MOV_OTHER | |
CODEC_TYPE_VIDEO | |
CODEC_TYPE_AUDIO |
Definition at line 165 of file quicktime.h.
Video::QuickTimeDecoder::QuickTimeDecoder | ( | Common::SeekableReadStream * | stream | ) |
Definition at line 97 of file quicktime.cpp.
References _fd, initParseTable(), and load().
Video::QuickTimeDecoder::~QuickTimeDecoder | ( | ) |
Definition at line 107 of file quicktime.cpp.
|
privatevirtual |
Ensure that there is enough audio buffered in the given track to reach the given timestamp.
Reimplemented from Video::VideoDecoder.
Definition at line 767 of file quicktime.cpp.
|
protectedvirtual |
Decode enough data for the next frame.
Currently, audio may be buffered here at the same time. This is deprecated in favor of using checkAudioBuffer().
Implements Video::VideoDecoder.
Definition at line 253 of file quicktime.cpp.
References Video::VideoDecoder::_needCopy, and Video::VideoDecoder::_surface.
|
private |
Definition at line 246 of file quicktime.cpp.
References _tracks, and _videoTrackIndex.
|
private |
Definition at line 257 of file quicktime.cpp.
References _parseTable, MKTAG, readDefault(), readELST(), readESDS(), readHDLR(), readLeaf(), readMDHD(), readMOOV(), readMVHD(), readSTCO(), readSTSC(), readSTSD(), readSTSS(), readSTSZ(), readSTTS(), and readTRAK().
Referenced by QuickTimeDecoder().
|
private |
Definition at line 110 of file quicktime.cpp.
References _audioTracks, _foundMOOV, _timeScale, _tracks, _videoTrackIndex, Video::VideoDecoder::addTrack(), CODEC_TYPE_AUDIO, CODEC_TYPE_MOV_OTHER, CODEC_TYPE_VIDEO, Video::VideoDecoder::initVideo(), and readDefault().
Referenced by QuickTimeDecoder().
|
private |
Definition at line 289 of file quicktime.cpp.
References _fd, _parseTable, Video::QuickTimeDecoder::ParseTable::func, MKTAG, Video::QuickTimeDecoder::Atom::offset, Video::QuickTimeDecoder::Atom::size, Video::QuickTimeDecoder::Atom::type, Video::QuickTimeDecoder::ParseTable::type, and warning().
Referenced by initParseTable(), load(), readMOOV(), readSTSD(), and readTRAK().
|
private |
Definition at line 407 of file quicktime.cpp.
References _fd, and warning().
Referenced by initParseTable().
|
private |
Definition at line 650 of file quicktime.cpp.
References Video::QuickTimeDecoder::SampleDesc::_extraData, _fd, Video::QuickTimeDecoder::SampleDesc::_objectTypeMP4, _tracks, Common::ScopedPtrBase< T, Deallocator >::get(), Video::kMP4DecConfigDescTag, Video::kMP4DecSpecificDescTag, Video::kMP4ESDescTag, Video::readMP4Desc(), Common::ScopedPtrBase< T, Deallocator >::reset(), and Video::QuickTimeDecoder::QuickTimeTrack::sampleDescs.
Referenced by initParseTable().
|
private |
Definition at line 424 of file quicktime.cpp.
References _fd, _tracks, CODEC_TYPE_AUDIO, CODEC_TYPE_VIDEO, Video::QuickTimeDecoder::QuickTimeTrack::codecType, MKTAG, Video::QuickTimeDecoder::Atom::offset, and Video::QuickTimeDecoder::Atom::size.
Referenced by initParseTable().
|
private |
Definition at line 357 of file quicktime.cpp.
References _fd, and Video::QuickTimeDecoder::Atom::size.
Referenced by initParseTable().
|
private |
Definition at line 455 of file quicktime.cpp.
References _fd, _tracks, Video::QuickTimeDecoder::QuickTimeTrack::duration, and Video::QuickTimeDecoder::QuickTimeTrack::timeScale.
Referenced by initParseTable().
|
private |
Definition at line 364 of file quicktime.cpp.
References _foundMOOV, and readDefault().
Referenced by initParseTable().
|
private |
Definition at line 373 of file quicktime.cpp.
References _fd, _timeScale, and warning().
Referenced by initParseTable().
|
private |
Definition at line 157 of file quicktime.cpp.
References _fd, CODEC_TYPE_AUDIO, CODEC_TYPE_VIDEO, Video::QuickTimeDecoder::QuickTimeTrack::codecType, Video::QuickTimeDecoder::QuickTimeTrack::height, MKTAG, Common::ScopedPtrBase< T, Deallocator >::release(), Video::QuickTimeDecoder::QuickTimeTrack::timeScale, warning(), and Video::QuickTimeDecoder::QuickTimeTrack::width.
Referenced by readSTSD().
|
private |
Definition at line 605 of file quicktime.cpp.
References _fd, _tracks, Video::QuickTimeDecoder::QuickTimeTrack::chunkCount, Video::QuickTimeDecoder::QuickTimeTrack::chunkOffsets, and Common::ScopedPtrBase< T, Deallocator >::reset().
Referenced by initParseTable().
|
private |
Definition at line 519 of file quicktime.cpp.
References _fd, _tracks, Video::QuickTimeDecoder::QuickTimeTrack::sampleToChunk, and Video::QuickTimeDecoder::QuickTimeTrack::sampleToChunkCount.
Referenced by initParseTable().
|
private |
Definition at line 482 of file quicktime.cpp.
References _fd, _tracks, readDefault(), readSampleDesc(), Video::QuickTimeDecoder::QuickTimeTrack::sampleDescs, and Video::QuickTimeDecoder::Atom::size.
Referenced by initParseTable().
|
private |
Definition at line 542 of file quicktime.cpp.
References _fd, _tracks, Video::QuickTimeDecoder::QuickTimeTrack::keyframeCount, Video::QuickTimeDecoder::QuickTimeTrack::keyframes, and Common::ScopedPtrBase< T, Deallocator >::reset().
Referenced by initParseTable().
|
private |
Definition at line 560 of file quicktime.cpp.
References _fd, _tracks, Common::ScopedPtrBase< T, Deallocator >::reset(), Video::QuickTimeDecoder::QuickTimeTrack::sampleCount, Video::QuickTimeDecoder::QuickTimeTrack::sampleSize, and Video::QuickTimeDecoder::QuickTimeTrack::sampleSizes.
Referenced by initParseTable().
|
private |
Definition at line 583 of file quicktime.cpp.
References _fd, _tracks, Video::QuickTimeDecoder::QuickTimeTrack::frameCount, Video::QuickTimeDecoder::QuickTimeTrack::timeToSample, and Video::QuickTimeDecoder::QuickTimeTrack::timeToSampleCount.
Referenced by initParseTable().
|
private |
Definition at line 393 of file quicktime.cpp.
References _tracks, CODEC_TYPE_MOV_OTHER, Video::QuickTimeDecoder::QuickTimeTrack::codecType, readDefault(), and Video::QuickTimeDecoder::QuickTimeTrack::startTime.
Referenced by initParseTable().
|
private |
Definition at line 282 of file quicktime.h.
Referenced by load().
|
private |
Definition at line 94 of file quicktime.h.
Referenced by QuickTimeDecoder(), readDefault(), readELST(), readESDS(), readHDLR(), readLeaf(), readMDHD(), readMVHD(), readSampleDesc(), readSTCO(), readSTSC(), readSTSD(), readSTSS(), readSTSZ(), and readSTTS().
|
private |
Definition at line 275 of file quicktime.h.
Referenced by load(), and readMOOV().
|
private |
Definition at line 274 of file quicktime.h.
Referenced by initParseTable(), and readDefault().
|
private |
Definition at line 276 of file quicktime.h.
Referenced by load(), and readMVHD().
|
private |
Definition at line 277 of file quicktime.h.
Referenced by findDefaultVideoCodec(), load(), readESDS(), readHDLR(), readMDHD(), readSTCO(), readSTSC(), readSTSD(), readSTSS(), readSTSZ(), readSTTS(), and readTRAK().
|
private |
Definition at line 285 of file quicktime.h.
Referenced by findDefaultVideoCodec(), and load().