Classes | Public Types | Public Member Functions

cygnal::Flv Class Reference

#include <flv.h>

Collaboration diagram for cygnal::Flv:
Collaboration graph
[legend]

List of all members.

Classes

struct  flv_audio_t
struct  flv_header_t
struct  flv_tag_t
struct  flv_video_t

Public Types

enum  flv_type_e { FLV_VIDEO = 0x1, FLV_AUDIO = 0x4 }
enum  flv_tag_type_e { TAG_VIDEO = 0x8, TAG_AUDIO = 0x9, TAG_METADATA = 0x12 }
enum  flv_sound_type_e { AUDIO_MONO = 0x0, AUDIO_STEREO = 0x1 }
enum  flv_sound_size_e { AUDIO_8BIT = 0x0, AUDIO_16BIT = 0x1 }
enum  flv_sound_rate_e { AUDIO_55KHZ = 0x0, AUDIO_11KHZ = 0x1, AUDIO_22KHZ = 0x2, AUDIO_44KHZ = 0x3 }
enum  flv_sound_format_e {
  AUDIO_UNCOMPRESSED = 0x0, AUDIO_ADPCM = 0x1, AUDIO_MP3 = 0x2, AUDIO_NELLYMOSER_8KHZ = 0x5,
  AUDIO_NELLYMOSER = 0x6, AUDIO_VORBIS = 0x7
}
enum  flv_video_codec_e {
  VIDEO_NONE = 0x0, VIDEO_H263 = 0x2, VIDEO_SCREEN = 0x3, VIDEO_VP6 = 0x4,
  VIDEO_VP6_ALPHA = 0x5, VIDEO_SCREEN2 = 0x6, VIDEO_THEORA = 0x7, VIDEO_DIRAC = 0x8,
  VIDEO_SPEEX = 0x9
}
enum  flv_video_frame_type_e { NO_FRAME = 0x0, KEYFRAME = 0x1, INTERFRAME = 0x2, DISPOSABLE = 0x3 }
typedef boost::uint32_t previous_size_t

Public Member Functions

 Flv ()
 ~Flv ()
boost::shared_ptr< cygnal::BufferencodeHeader (boost::uint8_t type)
 Encode the file header into a Buffer.
boost::shared_ptr< flv_header_tdecodeHeader (boost::shared_ptr< cygnal::Buffer > buf)
 Decode a Buffer into a header.
boost::shared_ptr< flv_header_tdecodeHeader (boost::uint8_t *data)
boost::shared_ptr
< cygnal::Element
decodeMetaData (boost::shared_ptr< cygnal::Buffer > buf)
 Decode a MetaData object. This is after the header, but before all the other tags usually.
boost::shared_ptr
< cygnal::Element
decodeMetaData (boost::uint8_t *data, size_t size)
 Decode a MetaData object. This is after the header, but before all the other tags usually.
boost::shared_ptr< flv_audio_tdecodeAudioData (boost::uint8_t flags)
 Decode an Audio object.
boost::shared_ptr< flv_video_tdecodeVideoData (boost::uint8_t flags)
 Decode an Video object.
boost::shared_ptr< flv_tag_tdecodeTagHeader (boost::shared_ptr< cygnal::Buffer > &buf)
 Decode an MetaData object.
boost::shared_ptr< flv_tag_tdecodeTagHeader (boost::uint8_t *data)
boost::shared_ptr
< cygnal::Element
findProperty (const std::string &name)
 Find the named property for this Object.
void setProperties (std::vector< boost::shared_ptr< cygnal::Element > > array)
 Set all the properties from an array of Element classes.
boost::uint32_t convert24 (boost::uint8_t *)
 Convert a 24 bit integer to a 32 bit one so we can use it.
void dump ()
 Dump the internal data of this class in a human readable form.

Detailed Description

This class abstracts an FLV file into something usable by Gnash.


Member Typedef Documentation

This is the size in bytes of the previous MetaTag.


Member Enumeration Documentation

Enumerator:
AUDIO_UNCOMPRESSED 
AUDIO_ADPCM 
AUDIO_MP3 
AUDIO_NELLYMOSER_8KHZ 
AUDIO_NELLYMOSER 
AUDIO_VORBIS 
Enumerator:
AUDIO_55KHZ 
AUDIO_11KHZ 
AUDIO_22KHZ 
AUDIO_44KHZ 
Enumerator:
AUDIO_8BIT 
AUDIO_16BIT 
Enumerator:
AUDIO_MONO 
AUDIO_STEREO 
Enumerator:
TAG_VIDEO 
TAG_AUDIO 
TAG_METADATA 
Enumerator:
FLV_VIDEO 
FLV_AUDIO 
Enumerator:
VIDEO_NONE 
VIDEO_H263 
VIDEO_SCREEN 
VIDEO_VP6 
VIDEO_VP6_ALPHA 
VIDEO_SCREEN2 
VIDEO_THEORA 
VIDEO_DIRAC 
VIDEO_SPEEX 
Enumerator:
NO_FRAME 
KEYFRAME 
INTERFRAME 
DISPOSABLE 

Constructor & Destructor Documentation

cygnal::Flv::Flv (  ) 
cygnal::Flv::~Flv (  ) 

Member Function Documentation

boost::uint32_t cygnal::Flv::convert24 ( boost::uint8_t *  num  ) 

Convert a 24 bit integer to a 32 bit one so we can use it.

Returns:
An unsigned 32 bit integer

Referenced by main().

boost::shared_ptr< Flv::flv_audio_t > cygnal::Flv::decodeAudioData ( boost::uint8_t  flags  ) 

Decode an Audio object.

Parameters:
flags The data to deserialize.
Returns:
a smart pointer to an audio data structure that contains the data.

References AUDIO_11KHZ, AUDIO_16BIT, AUDIO_22KHZ, AUDIO_44KHZ, AUDIO_ADPCM, AUDIO_MP3, AUDIO_NELLYMOSER, AUDIO_NELLYMOSER_8KHZ, AUDIO_STEREO, and AUDIO_VORBIS.

Referenced by main().

boost::shared_ptr<flv_header_t> cygnal::Flv::decodeHeader ( boost::shared_ptr< cygnal::Buffer buf  )  [inline]

Decode a Buffer into a header.

Parameters:
buf a smart pointer to a Buffer containing the data.
Returns:
a smart pointer to data structure that contains the data.

References decodeHeader().

Referenced by decodeHeader(), and main().

boost::shared_ptr< Flv::flv_header_t > cygnal::Flv::decodeHeader ( boost::uint8_t *  data  ) 
boost::shared_ptr< cygnal::Element > cygnal::Flv::decodeMetaData ( boost::shared_ptr< cygnal::Buffer buf  ) 

Decode a MetaData object. This is after the header, but before all the other tags usually.

Parameters:
buf a smart pointer to a Buffer containing the data.
Returns:
a smart pointer to an Element that contains the data.

Referenced by main().

boost::shared_ptr< cygnal::Element > cygnal::Flv::decodeMetaData ( boost::uint8_t *  data,
size_t  size 
)

Decode a MetaData object. This is after the header, but before all the other tags usually.

Parameters:
data The data to serialize into big endian format
size The size of the data in bytes
Returns:
a smart pointer to an Element that contains the data.

References cygnal::AMF::extractAMF(), name, cygnal::SANE_STR_SIZE, cygnal::Element::STRING_AMF0, and cygnal::AMF::totalsize().

boost::shared_ptr< Flv::flv_tag_t > cygnal::Flv::decodeTagHeader ( boost::uint8_t *  data  ) 

References data, and cygnal::swapBytes().

boost::shared_ptr<flv_tag_t> cygnal::Flv::decodeTagHeader ( boost::shared_ptr< cygnal::Buffer > &  buf  )  [inline]

Decode an MetaData object.

Parameters:
flags The data to deserialize.
Returns:
a smart pointer to an video data structure that contains the data.

References decodeTagHeader().

Referenced by decodeTagHeader(), and main().

boost::shared_ptr< Flv::flv_video_t > cygnal::Flv::decodeVideoData ( boost::uint8_t  flags  ) 

Decode an Video object.

Parameters:
flags The data to deserialize.
Returns:
a smart pointer to an video data structure that contains the data.

References DISPOSABLE, INTERFRAME, KEYFRAME, VIDEO_DIRAC, VIDEO_H263, VIDEO_SCREEN, VIDEO_SCREEN2, VIDEO_SPEEX, VIDEO_THEORA, VIDEO_VP6, and VIDEO_VP6_ALPHA.

Referenced by main().

void cygnal::Flv::dump (  ) 

Dump the internal data of this class in a human readable form.

Remarks:
This should only be used for debugging purposes.

Referenced by main().

boost::shared_ptr< cygnal::Buffer > cygnal::Flv::encodeHeader ( boost::uint8_t  type  ) 

Encode the file header into a Buffer.

Parameters:
type The data type for the header
Returns:
a smart pointer to a Buffer containing the data in big endian format.
boost::shared_ptr< cygnal::Element > cygnal::Flv::findProperty ( const std::string &  name  ) 

Find the named property for this Object.

Parameters:
name An ASCII string that is the name of the property to search for.
Returns:
A smart pointer to the Element for this property.
void cygnal::Flv::setProperties ( std::vector< boost::shared_ptr< cygnal::Element > >  array  )  [inline]

Set all the properties from an array of Element classes.

Parameters:
array 
Returns:
nothing

References _properties.


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