mpa_frame_header.h
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:1k
- /*============================================================================*
- *
- * (c) 1995-2002 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- *============================================================================*/
-
- #ifndef MPA_FRAME_HEADER_H__
- #define MPA_FRAME_HEADER_H__
- #define MPA_FRAME_HDR_SZ 4 // size of packed frame header
- #define MPA_SAMPLES_PER_FRAME 1152 // all frames contain 1152 samples
- #define MPA_VERSION1 3 // MPEG1 version is 11
- #define MPA_VERSION2 2 // MPEG2 version is 10
- #define MPA_VERSION_RESERVED 1 // Reserved version is 01
- #define MPA_VERSION25 0 // MPEG2.5 version is 00
- #define MPA_LAYER1 3 // Layer I id is 11
- #define MPA_LAYER2 2 // Layer II id is 10
- #define MPA_LAYER3 1 // Layer III id is 01
- #define MPA_LAYER_RESERVED 0 // Reserved Layer id is 00
- class MPAFrameHeader
- {
- public:
- int m_version;
- int m_layer;
- int m_hasCRC;
- int m_bitRate;
- int m_sampleRate;
- int m_pad;
- int m_chnlMode;
- int m_chnlModeEx;
- int m_frameSize;
- int m_samplesPerFrame;
- int m_channels;
- static bool IsSync(const unsigned char* p);
- bool Unpack(const unsigned char* p);
- //void DumpFrameInfo() const;
- private:
- void ComputeFrameSize();
- };
- #endif // MPA_FRAME_HEADER_H__