Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cFLVFileReader Class Reference

#include <cFLVFile.h>

Inheritance diagram for GrayLib::cFLVFileReader:
GrayLib::cAVReader GrayLib::cFLVFile

Public Member Functions

 cFLVFileReader (cStreamInput &s, cAVSink *pAVSink)
 
virtual ~cFLVFileReader (void)
 
virtual HRESULT ReadStream () override
 
 UNITTEST_FRIEND (cFLVFileReader)
 
- Public Member Functions inherited from GrayLib::cAVReader
 cAVReader (cStreamInput &stmIn, cAVSink *pSink)
 
virtual ~cAVReader ()
 
- Public Member Functions inherited from GrayLib::cFLVFile
 cFLVFile ()
 
bool hasAudio () const
 
bool hasVideo () const
 

Public Attributes

BYTE m_bFormFlagsFound
 FLV_FORMFLAG_TYPE mask. What stream types have i got. More...
 
cArrayRef< cAVFramem_FramesQ
 
- Public Attributes inherited from GrayLib::cFLVFile
BYTE m_bFormFlags
 FLV_FORMFLAG_TYPE mask. More...
 
cFLVVideo m_FormVideo
 for the current frame. More...
 
cFLVAudio m_FormAudio
 for the current frame. More...
 

Static Public Attributes

static const BYTE k_FLAG_Header = 0x80
 We completed the header. FLV_FORMFLAG_TYPE. More...
 
- Static Public Attributes inherited from GrayLib::cFLVFile
static const BYTE k_VERSION_1 = 1
 
static const char k_bFLV [4] = "FLV"
 Main header id. More...
 

Protected Member Functions

HRESULT ReadUI16 (WORD &uVal)
 
HRESULT ReadUI24 (UINT32 &uVal)
 
HRESULT ReadUI32 (UINT32 &uVal)
 
HRESULT ReadTag (cFLVTag &tag)
 
HRESULT ReadMetaString (cString &sVal)
 
HRESULT ReadMeta (UINT32 uLenBlockMax, FLV_META_TYPE eTypeEnd, UINT32 uQtyMax)
 
HRESULT UpdateHeaderAudio (BYTE bFormFlag)
 
HRESULT UpdateHeaderVideo (BYTE bFormFlag)
 
HRESULT ReadFrame (const cFLVTag &tag)
 

Additional Inherited Members

- Public Types inherited from GrayLib::cFLVFile
enum  FLV_FORMFLAG_TYPE { FLV_FORMFLAG_VIDEO = 0x1 , FLV_FORMFLAG_AUDIO = 0x4 }
 
enum  FLV_META_TYPE {
  FLV_META_Number = 0 , FLV_META_Boolean , FLV_META_String , FLV_META_Object ,
  FLV_META_MovieClip , FLV_META_Null , FLV_META_Undef , FLV_META_Ref ,
  FLV_META_ECMA , FLV_META_END , FLV_META_StrictArray , FLV_META_Date ,
  FLV_META_LongString
}
 
- Protected Attributes inherited from GrayLib::cAVReader
cStreamInputm_pStreamInput
 read from this file or memory stream More...
 
cAVSinkm_pAVSink
 Output to this destination cAVSink. More...
 

Detailed Description

Read the FLV to cAVSink

Constructor & Destructor Documentation

◆ cFLVFileReader()

GrayLib::cFLVFileReader::cFLVFileReader ( cStreamInput s,
cAVSink pAVSink 
)
inline

◆ ~cFLVFileReader()

virtual GrayLib::cFLVFileReader::~cFLVFileReader ( void  )
inlinevirtual

Member Function Documentation

◆ ReadFrame()

HRESULT GrayLib::cFLVFileReader::ReadFrame ( const cFLVTag tag)
protected

Read a TAG_VIDEO or TAG_AUDIO frame. Each frame has its own complete header in bFormFlag.

Todo:
handle compression format change mid stream.

◆ ReadMeta()

HRESULT GrayLib::cFLVFileReader::ReadMeta ( UINT32  uLenBlockMax,
FLV_META_TYPE  eTypeEnd,
UINT32  uQtyMax 
)
protected

Read a SCRIPTDATAOBJECT array from TAG_META. defined in http://www.adobe.com/devnet/flv/pdf/video_file_format_spec_v9.pdf

Note
The public spec as of 4/2010 is wrong !

◆ ReadMetaString()

HRESULT GrayLib::cFLVFileReader::ReadMetaString ( cString sVal)
protected

◆ ReadStream()

HRESULT GrayLib::cFLVFileReader::ReadStream ( )
overridevirtual

Read a complete MIME_EXT_flv file read m_pStreamInput to m_pAVSink

Returns
# of frames.

Implements GrayLib::cAVReader.

◆ ReadTag()

HRESULT GrayLib::cFLVFileReader::ReadTag ( cFLVTag tag)
protected

Read the tag block in the FLV file.

◆ ReadUI16()

HRESULT GrayLib::cFLVFileReader::ReadUI16 ( WORD &  uVal)
protected

Read Network order bytes.

◆ ReadUI24()

HRESULT GrayLib::cFLVFileReader::ReadUI24 ( UINT32 &  uVal)
protected

Read Network order bytes.

◆ ReadUI32()

HRESULT GrayLib::cFLVFileReader::ReadUI32 ( UINT32 &  uVal)
protected

Read Network order bytes.

◆ UNITTEST_FRIEND()

GrayLib::cFLVFileReader::UNITTEST_FRIEND ( cFLVFileReader  )

◆ UpdateHeaderAudio()

HRESULT GrayLib::cFLVFileReader::UpdateHeaderAudio ( BYTE  bFormFlag)
protected

Update the stream with the new frame format header.

Returns
S_OK = ok.

◆ UpdateHeaderVideo()

HRESULT GrayLib::cFLVFileReader::UpdateHeaderVideo ( BYTE  bFormFlag)
protected

Update the stream with the new frame format header.

Member Data Documentation

◆ k_FLAG_Header

const BYTE GrayLib::cFLVFileReader::k_FLAG_Header = 0x80
static

We completed the header. FLV_FORMFLAG_TYPE.

◆ m_bFormFlagsFound

BYTE GrayLib::cFLVFileReader::m_bFormFlagsFound

FLV_FORMFLAG_TYPE mask. What stream types have i got.

◆ m_FramesQ

cArrayRef<cAVFrame> GrayLib::cFLVFileReader::m_FramesQ

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