📄 umc_mp4_spl_int.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) 2004-2005 Intel Corporation. All Rights Reserved.//*/#ifndef __UMC_MP4_SPLITTER_INT_H__#define __UMC_MP4_SPLITTER_INT_H__#include "umc_mp4_parser.h"#include "umc_data_reader.h"#include "umc_splitter.h"#include "umc_mp4_spl.h"#include "umc_mutex.h"#define NUMBEROFFILLBUFFERS 8namespace UMC{ struct sBufferTrack { vm_semaphore VfrComprSemR, VfrComprSemW; unsigned char idTrak; // ID of trak in header of MPEG4 unsigned int numberOfSample_W; // for write unsigned int numberOfSample_R; // for read unsigned char flag_End; // end of data unsigned char flag_Close; // close thread unsigned char flag_Start; // flag of start stream, for get DecoderConfig unsigned char indW; unsigned char indR; vm_thread read_thread; DataReader *stream; unsigned char *bufersFrCompr[NUMBEROFFILLBUFFERS]; }; struct sParamThread { sBufferTrack *buf; info_atoms *atoms; Mutex *resource; };class SplitterMP4 : public Splitter{public: Status Init(SplitterParams& init); Status Close(); Status Stop() {return Close();} Status GetNextVideoData(MediaData* data, vm_var32 track_idx); Status GetNextAudioData(MediaData* data, vm_var32 track_idx); // random access Status SetPosition(double position); // pos from 0.0 to 1.0 Status GetPosition(double& position); // return current position // Valid after splitter initialization Status GetInfo(SplitterInfo* info); sInfo_sample GetSamplePositionAudio(vm_var32 track_idx, vm_var32 nsample); sInfo_sample GetSamplePositionVideo(vm_var32 track_idx, vm_var32 nsample); SplitterMP4(); ~SplitterMP4(); // CRITICAL_SECTION dcs;protected: sParamThread *buferAD; sParamThread *buferVC; info_atoms headerMPEG4; Mutex stream_resource; unsigned int ReadMPEG4File(); Status ParceMP4Header(); unsigned char total_audio; unsigned char total_video; unsigned long m_splitter_flags; long Get_24(DataReader *dr); int Read_mp4_descr_length(DataReader *dr); int Get_mp4_descr_length(DataReader *dr); T_trak_data* Add_trak(T_moov *moov); int Atom_Skip(DataReader *dr, T_atom_mp4 *atom); int Compare_Atom(T_atom_mp4 *atom, char *type); int Read_Atom(DataReader *dr, T_atom_mp4 *atom); int Read_moov(DataReader *dr, T_moov *moov, T_atom_mp4 *atom); int Read_mvhd(DataReader *dr, T_mvhd_data *mvhd_data); int Read_mdhd(DataReader *dr, T_mdhd_data *mdhd); int Read_iods(DataReader *dr, T_iods_data *iods); int Read_tkhd(DataReader *dr, T_tkhd_data *tkhd); int Read_mdia(DataReader *dr, T_mdia_data *mdia, T_atom_mp4 *trak_atom); int Read_minf(DataReader *dr, T_minf_data *minf, T_atom_mp4 *parent_atom); int Read_tref(DataReader *dr, T_tref_data *tref, T_atom_mp4 *atom); int Read_dpnd(DataReader *dr, T_dpnd_data *dpnd); int Read_hdlr(DataReader *dr, T_hdlr_data *hdlr); int Read_hmhd(DataReader *dr, T_hmhd_data *hmhd); int Read_vmhd(DataReader *dr, T_vmhd_data *vmhd); int Read_smhd(DataReader *dr, T_smhd_data *smhd); int Read_stbl(DataReader *dr, T_minf_data *minf, T_stbl_data *stbl, T_atom_mp4 *parent_atom); int Read_stts(DataReader *dr, T_stts_data *stts); int Read_stsd(DataReader *dr, T_minf_data *minf, T_stsd_data *stsd); int Read_stsc(DataReader *dr, T_stsc_data *stsc); int Read_stco(DataReader *dr, T_stco_data *stco); int Read_co64(DataReader *dr, T_co64_data *co64); int Read_stsz(DataReader *dr, T_stsz_data *stsz); int Read_ctts(DataReader *dr, T_ctts_data *ctts); int Read_stsd_table(DataReader *dr, T_minf_data *minf, T_stsd_table_data *table); int Read_trak(DataReader *dr, T_trak_data *trak, T_atom_mp4 *trak_atom); int Read_stsd_audio(DataReader *dr, T_stsd_table_data *table, T_atom_mp4 *parent_atom); int Read_stsd_video(DataReader *dr, T_stsd_table_data *table, T_atom_mp4 *parent_atom); int Read_stsd_hint(DataReader *dr, T_stsd_table_data *table, T_atom_mp4 *parent_atom); int Read_esds(DataReader *dr, T_esds_data *esds); int Read_dinf(DataReader *dr, T_dinf_data *dinf, T_atom_mp4 *dinf_atom); int Read_dref(DataReader *dr, T_dref_data *dref); int Read_dref_table(DataReader *dr, T_dref_table_data *table);public: unsigned long m_splitter_flags_real; // Type of stream (A/V/AV)};} // namespace UMC#endif //__UMC_MP4_SPLITTER_INT_H__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -