Torque3D Documentation / _generateds / OggTheoraDecoder

OggTheoraDecoder

Engine/source/core/ogg/oggTheoraDecoder.h

Decodes a Theora substream into frame packets.

More...

Classes:

class

Descriptor for surface format that this stream should decode into.

libtheora Data

th_comment
th_info
th_setup_info *
th_dec_ctx *

Public Types

enum
EPixelFormat {
  PIXEL_FORMAT_444 
  PIXEL_FORMAT_422 
  PIXEL_FORMAT_420 
  PIXEL_FORMAT_Unknown 
}

Y'CbCr pixel format of the source video stream.

enum
ETranscoder {
  TRANSCODER_Auto 
  TRANSCODER_Generic 
  TRANSCODER_SSE2420RGBA 
}
Parent 

Protected Types

TimeSourceRef 

Protected Attributes

If this is set, the decoder will drop frames that are already outdated with respect to the time source.

Transcoder to use for color space conversion.

Protected Functions

bool
_detect(ogg_page * startPage)
_getPictureOffset(th_ycbcr_buffer buffer, U32 plane)
_getPixelOffset(th_ycbcr_buffer buffer, U32 plane, U32 x, U32 y)
U8 *
_getPixelPtr(th_ycbcr_buffer buffer, U32 plane, U32 offset, U32 x, U32 y)
bool
bool
_packetin(ogg_packet * packet)
_transcode(th_ycbcr_buffer ycbcr, U8 * buffer, U32 width, U32 height)

Generic transcoder going from any of the Y'CbCr pixel formats to any RGB format (that is supported by GFXFormatUtils).

Public Functions

Return the height of video image frames in pixels.

Return the width of video image frames in pixels.

const char *
read(OggTheoraFrame ** buffer, U32 num)

Set the reference time source.

Set the Y'CbCr->RGB transcoder to use.

Detailed Description

Decodes a Theora substream into frame packets.

Frame packets contain raw pixel data in the set pixel format (default is R8G8B8). Reading on a thread is safe, but remember to keep a reference to the OggInputStream master from the worker thread.

libtheora Data

th_comment mTheoraComment 
th_info mTheoraInfo 
th_setup_info * mTheoraSetup 
th_dec_ctx * mTheoraDecoder 

Public Types

EPixelFormat

Enumerator

PIXEL_FORMAT_444
PIXEL_FORMAT_422
PIXEL_FORMAT_420
PIXEL_FORMAT_Unknown

Y'CbCr pixel format of the source video stream.

For informational purposes only. Packet out is determined by PacketFormat.

ETranscoder

Enumerator

TRANSCODER_Auto

Auto-detect from current formats and processor capabilities.

TRANSCODER_Generic

Generic transcoder that handles all source and target formats; 32bit integer + lookup tables.

TRANSCODER_SSE2420RGBA

SSE2 transcoder with fixed 4:2:0 to RGBA conversion; 32bit integer + lookup tables.

typedef OggDecoder Parent 

Protected Types

typedef IPositionable< U32 > * TimeSourceRef 

Protected Attributes

U32 mCurrentFrameNumber 
F32 mCurrentFrameTime 
F32 mFrameDuration 
ThreadSafeDeque< OggTheoraFrame * > mFreePackets 
PacketFormat mPacketFormat 
TimeSourceRef mTimeSource 

If this is set, the decoder will drop frames that are already outdated with respect to the time source.

note:

Times are in milliseconds and in video time.

ETranscoder mTranscoder 

Transcoder to use for color space conversion.

If the current setting is invalid, will fall back to generic.

Protected Functions

_detect(ogg_page * startPage)

Reimplemented from: OggDecoder

_getPictureOffset(th_ycbcr_buffer buffer, U32 plane)

_getPixelOffset(th_ycbcr_buffer buffer, U32 plane, U32 x, U32 y)

_getPixelPtr(th_ycbcr_buffer buffer, U32 plane, U32 offset, U32 x, U32 y)

_init()

Reimplemented from: OggDecoder

_packetin(ogg_packet * packet)

Reimplemented from: OggDecoder

_transcode(th_ycbcr_buffer ycbcr, U8 * buffer, U32 width, U32 height)

Generic transcoder going from any of the Y'CbCr pixel formats to any RGB format (that is supported by GFXFormatUtils).

Public Functions

OggTheoraDecoder(const ThreadSafeRef< OggInputStream > & stream)

~OggTheoraDecoder()

getDecoderPixelFormat()

getFrameHeight()

Return the height of video image frames in pixels.

note:

This returns the actual picture height rather than Theora's internal encoded frame height.

getFramesPerSecond()

getFrameWidth()

Return the width of video image frames in pixels.

note:

This returns the actual picture width rather than Theora's internal encoded frame width.

getName()

Reimplemented from: OggDecoder

getPacketFormat()

read(OggTheoraFrame ** buffer, U32 num)

reusePacket(OggTheoraFrame * packet)

setPacketFormat(const PacketFormat & format)

setTimeSource(const TimeSourceRef & timeSource)

Set the reference time source.

Frames will be dropped if the decoder falls behind the time of this source.

note:

The time source must have at least the same lifetime as the decoder.

setTranscoder(ETranscoder transcoder)

Set the Y'CbCr->RGB transcoder to use.