25 #ifndef VIDEO_DECODER_H 26 #define VIDEO_DECODER_H 30 #include <boost/shared_ptr.hpp> 49 class QueuingAudioStream;
199 void pause(
bool shouldPause);
508 #endif // VIDEO_DECODER_H Common::ScopedPtr< Graphics::Surface > _surface
The video's surface.
uint32 getTimeToNextFrame() const
Return the time, in milliseconds, to the next frame.
Only scale the video up, if necessary.
virtual void pauseIntern(bool shouldPause)
Function called by pause() for subclasses to implement.
Don't scale the video.
An abstract representation of an audio track.
The track is a video track.
boost::shared_ptr< const Track > ConstTrackPtr
A const Track pointer.
A simple rational class that holds fractions.
void addTrack(Track *track, bool isExternal=false)
Define a track to be used by this class.
bool _needCopy
Is new frame content available that needs to by copied?
virtual void decodeNextTrackFrame(VideoTrack &track)=0
Decode enough data for the next frame.
Graphics::TextureID _texture
void setMute(bool mute)
Mute the track.
virtual bool endOfTrack() const =0
Return if the track has finished.
virtual Common::Timestamp getDuration() const
Get the duration of the track.
TrackPtr getTrack(uint track)
Get the given internal track based on its index.
virtual bool canBufferData() const =0
Can more audio data be buffered?
The track is an audio track.
virtual uint32 getWidth() const =0
Get the width of this track.
void update()
Update the video, if necessary.
void setScale(Scale scale)
A generic interface for video decoders.
virtual uint32 getHeight() const
Returns the height of the video's frames.
Common::Timestamp getFrameTime(uint frame) const
Get the time the given frame should be shown.
A simple scoped smart pointer template.
void initVideo()
Create a surface for video of these dimensions.
A container of OpenGL elements.
bool needsUpdate() const
Check whether a new frame should be decoded, i.e.
A VideoTrack that is played at a constant rate.
virtual Common::Timestamp getDuration() const
Get the duration of the track.
TrackList getInternalTracks()
Get a copy of the internal tracks.
virtual TrackType getTrackType() const =0
Get the type of track.
void render(Graphics::RenderPass pass)
Render the object.
uint32 _pauseLevel
The pause level of the video; 0 for not paused.
VideoTrackPtr _nextVideoTrack
The next video track that needs to display.
boost::shared_ptr< VideoTrack > VideoTrackPtr
A VideoTrack pointer.
Common::Timestamp getNextFrameStartTime() const
Get the start time of the next frame since the start of the video.
Sound::ChannelHandle _handle
VideoTrackPtr findNextVideoTrack()
Set _nextVideoTrack to the video track with the lowest start time for the next frame.
void start()
Start playing this track.
void pauseVideo(bool pause)
Pause or resume the video.
void start()
Start playing the video.
virtual Sound::AudioStream * getAudioStream() const =0
Get the AudioStream that is the representation of this AudioTrack.
void stopAudio()
Stop all audio tracks.
bool endOfTrack() const
Return if the track has finished.
std::vector< ConstTrackPtr > ConstTrackList
A list of const tracks.
bool isPlaying() const
Is the video currently playing?
void pause(bool shouldPause)
Set the pause status of the track.
void getQuadDimensions(float &width, float &height) const
Get the dimensions of the quad to draw the texture on.
bool _paused
Is the track paused?
Low-level type definitions to handle fixed width types portably.
TrackList _internalTracks
Tracks internal to this VideoDecoder.
An abstract representation of a video track.
float getGain() const
Get the gain for this track.
void setGain(float gain)
Set the gain for this track.
The track type is unknown.
bool endOfVideo() const
Returns if the video has reached the end or not.
void calculateDistance()
Calculate the object's distance.
bool isPaused() const
Return whether the video is currently paused or not.
virtual int getCurFrame() const =0
Get the current frame of this track.
virtual Common::Rational getFrameRate() const =0
Get the rate at which this track is played.
virtual uint32 getHeight() const =0
Get the height of this track.
Generic audio input stream.
An object that can be displayed by the graphics manager.
uint32 getTime() const
Returns the time position (in ms) of the current video.
virtual int getFrameCount() const
Get the frame count of this track.
void abort()
Abort the playing of the video.
virtual void checkAudioBuffer(AudioTrack &track, const Common::Timestamp &endTime)
Ensure that there is enough audio buffered in the given track to reach the given timestamp.
boost::shared_ptr< Track > TrackPtr
A Track pointer.
uint getFrameAtTime(const Common::Timestamp &time) const
Get the frame that should be displaying at the given time.
void pauseIntern(bool shouldPause)
Function called by pause() for subclasses to implement.
uint32 getRunningTime() const
Get the time the AudioStream behind this track has been running.
virtual ~FixedRateVideoTrack()
virtual bool endOfTrack() const
Return if the track has finished.
A handle to a sound channel.
bool endOfVideoTracks() const
Have all video tracks finished?
TrackType getTrackType() const
Get the type of track.
virtual uint32 getWidth() const
Returns the width of the video's frames.
virtual Common::Timestamp getDuration() const
Get the duration of the video.
Timestamps allow specifying points in time and measuring time intervals with a sub-millisecond granul...
TrackType
The types of tracks this class can be.
An abstract representation of a track in a movie.
A container of OpenGL elements.
Rational number implementation.
Scale the video up and down, if necessary.
virtual Common::Timestamp getFrameTime(uint frame) const
Get the time the given frame should be shown.
virtual Common::Timestamp getNextFrameStartTime() const =0
Get the start time of the next frame since the start of the video.
bool isPaused() const
Return if the track is paused.
void copyData()
Copy the video image data to the texture.
TrackList _externalTracks
Tracks loaded from externals files.
void startAudio()
Start the designated internal audio track and any external audio tracks.
TrackList _tracks
Tracks owned by this VideoDecoder (both internal and external).
An object that can be displayed by the graphics manager.
TrackType getTrackType() const
Get the type of track.
uint32 _startTime
The start time of the video, or -1 for not set.
std::vector< TrackPtr > TrackList
A list of tracks.
Only scale the video down, if necessary.
void stop()
Stop playing this track.
boost::shared_ptr< AudioTrack > AudioTrackPtr
An AudioTrack pointer.
uint32 _pauseStartTime
The time when the track was first paused.