Support Forum       G3D Web Page     
Public Member Functions | Static Public Member Functions | Static Protected Member Functions | List of all members
G3D::VideoPlayer Class Reference

Play videos back at the correct speed and automatically update frame Textur or PixelTransferBuffer. More...

Inherits G3D::ReferenceCountedObject.

Public Member Functions

bool finished () const
 
float fps () const
 
shared_ptr< PixelTransferBufferframeBuffer () const
 
shared_ptr< TextureframeTexture () const
 
int height () const
 
RealTime length () const
 
void pause ()
 
bool paused () const
 
void unpause ()
 
bool update (RealTime timestep)
 Updates the video playback time and updates the frame texture or buffer if needed. More...
 
int width () const
 

Static Public Member Functions

static shared_ptr< VideoPlayerfromFile (const String &filename)
 Creates a Texture that each frame is automatically copied into. More...
 
static shared_ptr< VideoPlayerfromFile (const String &filename, shared_ptr< Texture > frameTexture)
 Sets the Texture that each frame is automatically copied into. More...
 
static shared_ptr< VideoPlayerfromFile (const String &filename, shared_ptr< PixelTransferBuffer > frameBuffer)
 Sets the PixelTransferBuffer that each frame is automatically copied into. More...
 

Static Protected Member Functions

template<class T , class ... ArgTypes>
static shared_ptr< T > createShared (ArgTypes &&... args)
 Like std::make_shared, but works for protected constructors. More...
 

Detailed Description

Play videos back at the correct speed and automatically update frame Textur or PixelTransferBuffer.

See also
VideoInput

Member Function Documentation

◆ createShared()

template<class T , class ... ArgTypes>
static shared_ptr<T> G3D::ReferenceCountedObject::createShared ( ArgTypes &&...  args)
inlinestaticprotectedinherited

Like std::make_shared, but works for protected constructors.

Call as createShared<myclass>.

◆ finished()

bool G3D::VideoPlayer::finished ( ) const
inline

◆ fps()

float G3D::VideoPlayer::fps ( ) const
inline

◆ frameBuffer()

shared_ptr<PixelTransferBuffer> G3D::VideoPlayer::frameBuffer ( ) const
inline

◆ frameTexture()

shared_ptr<Texture> G3D::VideoPlayer::frameTexture ( ) const
inline

◆ fromFile() [1/3]

static shared_ptr<VideoPlayer> G3D::VideoPlayer::fromFile ( const String filename)
static

Creates a Texture that each frame is automatically copied into.

The Texture can be accessed by calling frameTexture().

Returns
nullptr if unable to open file or video is not supported

◆ fromFile() [2/3]

static shared_ptr<VideoPlayer> G3D::VideoPlayer::fromFile ( const String filename,
shared_ptr< Texture frameTexture 
)
static

Sets the Texture that each frame is automatically copied into.

The Texture can be accessed by calling frameTexture().

Returns
nullptr if unable to open file or video is not supported

◆ fromFile() [3/3]

static shared_ptr<VideoPlayer> G3D::VideoPlayer::fromFile ( const String filename,
shared_ptr< PixelTransferBuffer frameBuffer 
)
static

Sets the PixelTransferBuffer that each frame is automatically copied into.

The buffer can be accessed by calling frameBuffer().

Returns
nullptr if unable to open file or video is not supported

◆ height()

int G3D::VideoPlayer::height ( ) const
inline

◆ length()

RealTime G3D::VideoPlayer::length ( ) const
inline

◆ pause()

void G3D::VideoPlayer::pause ( )
inline

◆ paused()

bool G3D::VideoPlayer::paused ( ) const
inline

◆ unpause()

void G3D::VideoPlayer::unpause ( )
inline

◆ update()

bool G3D::VideoPlayer::update ( RealTime  timestep)

Updates the video playback time and updates the frame texture or buffer if needed.

Returns
true if the frame was updated, false otherwise

◆ width()

int G3D::VideoPlayer::width ( ) const
inline

documentation generated on Wed Nov 24 2021 08:02:02 using doxygen 1.8.15