ps2ts.h

来自「可用该程序将avi的电影文件转化为TS流」· C头文件 代码 · 共 107 行

H
107
字号
/******************************************************************************** ps2ts.h: MPEG1 and MPEG2 PS to TS converter*-------------------------------------------------------------------------------* (c)1999-2001 VideoLAN* $Id: ps2ts.h,v 1.4 2002/05/14 22:10:08 bozo Exp $** Authors: Benoit Steiner <benny@via.ecp.fr>*          Arnaud de Bossoreille de Ribou <bozo@via.ecp.fr>** This program is free software; you can redistribute it and/or* modify it under the terms of the GNU General Public License* as published by the Free Software Foundation; either version 2* of the License, or (at your option) any later version.** This program is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the* GNU General Public License for more details.** You should have received a copy of the GNU General Public License* along with this program; if not, write to the Free Software* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.**-------------------------------------------------------------------------------* Note: since the compiler also need the generic implementation code of the* template to build the type specific byte code, the .cpp file must have to be* also included in the source file********************************************************************************/#ifndef _PS2TS_H_#define _PS2TS_H_template <class Reader, class TsProvider> class C_Ps2Ts{ public:  C_Ps2Ts(Reader* pReader, TsProvider* pTsProvider, unsigned int iMaxBufferedTs,          unsigned int iMpegVersion);  ~C_Ps2Ts();    // Find the first pack header in the stream  int Synch();  //   C_TsPacket* GetPacket();  // To check whenever GetPacket returns NULL  int GetStatus() { return m_iStatus; };  C_ProgramDescriptor* GetPgrmDescriptor() { return &m_cPgrmDescriptor; }; protected:  int FetchPackets();  int ParsePackHeader(C_TsPacket* pPacket, u8* iPosInTs);  int ParseSystemHeader(C_TsPacket* pPacket, u8* iPosInTs);  int ParsePrivate1Header(C_TsPacket* pPacket, u8* iPosInTs);  int ParsePES(C_TsPacket* pPacket, u8* iPosInTs);  int ParsePgrmMap(C_TsPacket* pPacket, u8* iPosInTs);  int SkipPES(C_TsPacket* pPacket, u8* iPosInTs); private:  Reader* m_pReader;  TsProvider* m_pTsProvider;  unsigned int m_iMaxBufferedTs;  // Parser configuration  u8 m_iPackHeaderLen;    // Parser state  u32 m_iDataType;  u16 m_iDataLen;  bool m_bPESStart;  byte m_bBuff[TS_PACKET_LEN];  // Output state  u32 m_iTSCounter;    bool m_bSendPSI;  bool m_bGenPat;  bool m_bGenPmt;  bool m_bResetPSI;  C_ElementDescriptor* m_pCurrentData;  C_ProgramDescriptor m_cPgrmDescriptor;  C_DvbPsiPat m_cPat;  C_DvbPsiPmt m_cPmt;  // Preparsed data (for efficiency reasons)  C_List<C_TsPacket> m_cPendingTS;  C_TsPacket *m_pDelayedPacket;  // Global status  int m_iStatus;  // discontinuity management  u64 m_iPrevSCR;  bool m_bDiscontinuity;};#else#error "Multiple inclusions of ps2ts.h"#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?