H3D::H3DVideoClipDecoderNode Class Reference
[Abstract nodes.]

H3DVideoClipDecoderNode is a virtual base class for classes decoding video clips making new frames available to render. More...

#include <H3DVideoClipDecoderNode.h>

Inheritance diagram for H3D::H3DVideoClipDecoderNode:

Inheritance graph
List of all members.

Public Types

typedef H3DVideoClipDecoderNode *(* CreateNodeFunc )()
typedef bool(* SupportsFileFunc )(const string &url)
 Function ptr type for.

Public Member Functions

 H3DVideoClipDecoderNode ()
 Constructor.
virtual bool loadClip (const string &url)=0
 Pure virtual function to load an video clip from a url.
virtual bool haveNewFrame ()=0
 Returns true when a new frame is available.
virtual void getNewFrame (unsigned char *buffer)=0
 Get the new frame. The buffer must be at least getFrameSize() bytes.
virtual unsigned int getFrameSize ()=0
 The size in bytes of the current frame.
virtual unsigned int getFrameWidth ()=0
 The width in pixels of the current frame.
virtual unsigned int getFrameHeight ()=0
 The height in pixels of the current frame.
virtual Image::PixelType getFramePixelType ()=0
 The pixel type of the current frame.
virtual Image::PixelComponentType getFramePixelComponentType ()=0
 The pixel component type of the current frame.
virtual unsigned int getFrameBitsPerPixel ()=0
 Get the number of bits per pixel in the current frame.
virtual void startPlaying ()=0
 Start decoding the video clip.
virtual void stopPlaying ()=0
 Stop decoding the video clip and set the position to the start position.
virtual void pausePlaying ()=0
 Pause the decoding of the video clip.
virtual void setLooping (bool on)=0
 Set whether the clip should loop and start from the start again when the end has been reached.
virtual H3DTime getPosition ()=0
 Get the current position in the clip (in seconds from start position).
virtual void setPosition (H3DTime pos)=0
 Set the current position in the clip(in seconds from start position).
virtual bool setRate (double r)=0
 Set the playback rate.
virtual H3DTime getDuration ()=0
 Returns the duration in seconds at normal play rate of the currently loaded video clip.
PlayStatus getPlayStatus ()
 Returns the current play status.
virtual string defaultXMLContainerField ()
 Returns the default xml containerField attribute value.

Static Public Member Functions

template<class N>
static H3DVideoClipDecoderNodenewImageLoaderNode ()
static H3DVideoClipDecoderNodegetSupportedDecoder (const string &url)
 Given an url to a file, it returns an instance of a H3DVideoClipDecoderNode class that can handle that file type.
static void registerDecoder (const string &name, CreateNodeFunc create, SupportsFileFunc supports)
 Register a decoder that can then be returned by getSupportedDecoder().
static void registerDecoder (const DecoderRegistration &fr)
 Register a file reader that can then be returned by getSupportedDecoder().

Protected Types

enum  PlayStatus { PLAYING = 0, STOPPED = 1, PAUSED = 2 }

Protected Attributes

PlayStatus status

Static Protected Attributes

static list< DecoderRegistration > * registered_decoders
static bool initialized = false

Classes

struct  DecoderRegistration
 Class used to register a class to the registered file readers. More...

Detailed Description

H3DVideoClipDecoderNode is a virtual base class for classes decoding video clips making new frames available to render.


Member Function Documentation

virtual string H3D::H3DVideoClipDecoderNode::defaultXMLContainerField  )  [inline, virtual]
 

Returns the default xml containerField attribute value.

For this node it is "imageLoader".

Reimplemented from H3D::Node.

H3DVideoClipDecoderNode * H3DVideoClipDecoderNode::getSupportedDecoder const string &  url  )  [static]
 

Given an url to a file, it returns an instance of a H3DVideoClipDecoderNode class that can handle that file type.

If no such class is registered NULL is returns.

virtual bool H3D::H3DVideoClipDecoderNode::loadClip const string &  url  )  [pure virtual]
 

Pure virtual function to load an video clip from a url.

Returns true on success.

static void H3D::H3DVideoClipDecoderNode::registerDecoder const string &  name,
CreateNodeFunc  create,
SupportsFileFunc  supports
[inline, static]
 

Register a decoder that can then be returned by getSupportedDecoder().

Parameters:
name The name of the class
create A function for creating an instance of that class.
supports A function to determine if the class supports a given file type.

virtual bool H3D::H3DVideoClipDecoderNode::setRate double  r  )  [pure virtual]
 

Set the playback rate.

A rate of 1 means normal playback speed, 2 double. Negative values means playing backwards.

Returns:
true if the new rate is supported by the decoder.


Generated on Thu Aug 24 12:39:22 2006 for H3D API by  doxygen 1.4.5