📄 umc_mpeg2pes_spl.h
字号:
/*////////////////////////////////////////////////////////////////////////////////// INTEL CORPORATION PROPRIETARY INFORMATION// This software is supplied under the terms of a license agreement or// nondisclosure agreement with Intel Corporation and may not be copied// or disclosed except in accordance with the terms of that agreement.// Copyright(c) 2003-2005 Intel Corporation. All Rights Reserved.//*/#ifndef __UMC_MPEG2PES_SPL_H__#define __UMC_MPEG2PES_SPL_H__#include "umc_mpeg2_spl_av.h"//MPEG2 PES stream splitter, it can be used as is for//PES packet stream like//"E0..data..""C0..data..""E0..data..""C0..data.."namespace UMC{ class MPEG2PESSplitter : public MPEG2AVSplitter { public: MPEG2PESSplitter() { //no data was skipped m_uiSkippedDataSize = 0; //need to find first audio frame and detect audio type m_bFistAudioFrame[0] = true; m_bFistAudioFrame[1] = true; } ~MPEG2PESSplitter() { } Status virtual GetPosition (double& pos); Status virtual GetInfo (SplitterInfo* pSplInfo); protected: //here must be implemented real packet processing, //it is specific for each format //this function witll return control if reading error //or end of stream happen Status virtual ProcessPackets(int count = -1); //read one packet (or size bytes of pure stream) and //return control, for PS, TS streams size parameter must be 0 //returned UMC_OK means next frame was formed and ready //to output //UMC_NOT_ENOUGH_DATA means packed was processed but frame //is not ready //all other is errors Status virtual ProcessOnePacket(int size = 0); //initialization of subprocessing, call before ProcessOnePacket Status virtual InitProcessing(); //de-initialization of subprocessing, call after ProcessOnePacket Status virtual CloseProcessing(); //here must be implemented pointer positioning to first //valid start code after repositioning Status virtual MoveToNextSyncWord(); protected: Status virtual MPEG2PSPackHeader(); //PES packet as described in ISO/IEC 13818-1 //PES packet contains //PES packet header //and data bytes //size = 0 means PS //TS otherwise Status virtual MPEG2PESPack(int size = 0, int index = -1, int PID = -1); //PES packet header extracts PST if it presents Status virtual MPEG2PESPacketHeader( double* out_pts, //take and calculate PTS double* out_dts, //take and calculate PTS int &gotBytes); //and skip remain header //check if new elementary stream int virtual CheckIfNewES(bool isAudio, int streamID, int index = -1); Status virtual GetAudioTime(double* time, double timeStamp); Status virtual GetVideoTime(double* time, double timeStamp); protected: //DVD AC3 packet header parsing Status ParseAC3PacketHeader(ElementaryStream* pES); //DVD LPCM packet header parsing Status ParseLPCMPacketHeader(ElementaryStream* pES); protected: //counts size of padding, auxiliary data and etc //it is not audio or video and was skipped unsigned int m_uiSkippedDataSize; };} // namespace UMC#endif /* __UMC_MPEG2PES_SPL_H__ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -