xoreos  0.0.5
Classes | Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Video::Bink Class Reference

A decoder for RAD Game Tools' Bink videos. More...

#include <bink.h>

Inheritance diagram for Video::Bink:
Inheritance graph
[legend]
Collaboration diagram for Video::Bink:
Collaboration graph
[legend]

Classes

struct  AudioInfo
 An audio track. More...
 
class  BinkAudioTrack
 
class  BinkVideoTrack
 
struct  VideoFrame
 A video frame. More...
 

Public Member Functions

 Bink (Common::SeekableReadStream *bink)
 
 ~Bink ()
 
- 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::UStringgetTag () 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...
 
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...
 
- 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  AudioCodec { kAudioCodecDCT, kAudioCodecRDFT }
 

Private Member Functions

void load ()
 Load a Bink file. More...
 
void initAudioTrack (AudioInfo &audio)
 

Private Attributes

Common::ScopedPtr< Common::SeekableReadStream_bink
 
std::vector< AudioInfo_audioTracks
 All audio tracks. More...
 
std::vector< VideoFrame_frames
 All video frames. More...
 
uint32 _audioTrack
 Audio track to use. More...
 

Static Private Attributes

static const int kAudioChannelsMax = 2
 
static const int kAudioBlockSizeMax = (kAudioChannelsMax << 11)
 

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< TrackTrackPtr
 A Track pointer. More...
 
typedef boost::shared_ptr< const TrackConstTrackPtr
 A const Track pointer. More...
 
typedef boost::shared_ptr< AudioTrackAudioTrackPtr
 An AudioTrack pointer. More...
 
typedef boost::shared_ptr< VideoTrackVideoTrackPtr
 A VideoTrack pointer. More...
 
typedef std::vector< TrackPtrTrackList
 A list of tracks. More...
 
typedef std::vector< ConstTrackPtrConstTrackList
 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...
 

Detailed Description

A decoder for RAD Game Tools' Bink videos.

Definition at line 98 of file bink.h.

Member Enumeration Documentation

◆ AudioCodec

Enumerator
kAudioCodecDCT 
kAudioCodecRDFT 

Definition at line 111 of file bink.h.

Constructor & Destructor Documentation

◆ Bink()

Video::Bink::Bink ( Common::SeekableReadStream bink)

Definition at line 154 of file bink.cpp.

References _bink, and load().

Here is the call graph for this function:

◆ ~Bink()

Video::Bink::~Bink ( )

Definition at line 160 of file bink.cpp.

Member Function Documentation

◆ checkAudioBuffer()

void Video::Bink::checkAudioBuffer ( AudioTrack track,
const Common::Timestamp endTime 
)
protectedvirtual

Ensure that there is enough audio buffered in the given track to reach the given timestamp.

Reimplemented from Video::VideoDecoder.

Definition at line 199 of file bink.cpp.

References _audioTracks, _bink, and _frames.

◆ decodeNextTrackFrame()

void Video::Bink::decodeNextTrackFrame ( VideoTrack track)
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 163 of file bink.cpp.

References _audioTracks, _bink, _frames, Video::VideoDecoder::_needCopy, Video::VideoDecoder::_surface, Video::Bink::VideoFrame::bits, Video::Bink::BinkVideoTrack::decodePacket(), Common::ScopedPtrBase< T, Deallocator >::get(), Video::Bink::BinkVideoTrack::getCurFrame(), Video::Bink::VideoFrame::offset, and Video::Bink::VideoFrame::size.

Here is the call graph for this function:

◆ initAudioTrack()

void Video::Bink::initAudioTrack ( AudioInfo audio)
private

◆ load()

void Video::Bink::load ( )
private

Member Data Documentation

◆ _audioTrack

uint32 Video::Bink::_audioTrack
private

Audio track to use.

Definition at line 170 of file bink.h.

Referenced by load().

◆ _audioTracks

std::vector<AudioInfo> Video::Bink::_audioTracks
private

All audio tracks.

Definition at line 167 of file bink.h.

Referenced by checkAudioBuffer(), decodeNextTrackFrame(), and load().

◆ _bink

Common::ScopedPtr<Common::SeekableReadStream> Video::Bink::_bink
private

Definition at line 165 of file bink.h.

Referenced by Bink(), checkAudioBuffer(), decodeNextTrackFrame(), and load().

◆ _frames

std::vector<VideoFrame> Video::Bink::_frames
private

All video frames.

Definition at line 168 of file bink.h.

Referenced by checkAudioBuffer(), decodeNextTrackFrame(), and load().

◆ kAudioBlockSizeMax

const int Video::Bink::kAudioBlockSizeMax = (kAudioChannelsMax << 11)
staticprivate

Definition at line 109 of file bink.h.

◆ kAudioChannelsMax

const int Video::Bink::kAudioChannelsMax = 2
staticprivate

Definition at line 108 of file bink.h.

Referenced by initAudioTrack().


The documentation for this class was generated from the following files: