DtvKit_ATSC3.0
Loading...
Searching...
No Matches
atsc_core_streamer_isobmff_parser.h
Go to the documentation of this file.
1/*******************************************************************************
2 * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3 *
4 * This file is part of a DTVKit Software Component
5 * You are permitted to copy, modify or distribute this file subject to the terms
6 * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
7 *
8 * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
9 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
10 * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
11 *
12 * If you or your organisation is not a member of DTVKit then you have access
13 * to this source code outside of the terms of the licence agreement
14 * and you are expected to delete this and any associated files immediately.
15 * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
16 *******************************************************************************/
17
18#pragma once
19
20#include <string>
21#include <stdio.h>
22#include <stdlib.h>
23#include <string.h>
24#include <netinet/in.h>
25
27#include "atsc_core_utils_bitcalc.h"
28
37{
38public:
39 int32_t iDuration;
41 uint32_t iTimescale;
50
58
65 void Init(void);
66
73 int32_t PutMP4(char* pData, int32_t iLen);
74
81 int32_t get_duration( void ){return iDuration; }
82
89 uint32_t get_timescale( void ){return iTimescale;}
90
97 int32_t get_sample_duration( void ) { return mSampleDuration; }
98
105 int32_t get_mdat_size(char *pData, int32_t iDataLen);
106
113 int32_t set_mdat_size(char* pData, int32_t iDataLen, int32_t iMdatSize);
114
123 int32_t PutSidx(char *pData, int32_t iLen, Isobmff::sSidxH_t *sidx);
124
131 int32_t PutMdat(char *pData, int32_t iLen, int32_t remainLen, bool bHintTrackContainOffset, int32_t iId, int32_t iSeq);
132
139 int32_t GetDuration();
140
147 int32_t PutTraf(char* pData, int32_t iLen, Isobmff::sTrafH_t* traf);
148
155 int32_t PutTfhd(char* pData, int32_t iLen, Isobmff::sTfhdH_t* tfhd);
156
163 int32_t PutTrun(char* pData, int32_t iLen, Isobmff::sTrunH_t* trun);
164
171 int32_t PutTfdt(char* pData, int32_t iLen, Isobmff::sTfdtH_t* tfdt);
172
179 int32_t PutMdia(char* pData, int32_t iLen, Isobmff::sMdiaH_t* mdia);
180
187 int32_t PutFtyp(char *pData, int32_t iLen);
188
195 int32_t PutStyp(char *pData, int32_t iLen);
196
203 int32_t PutMehd(char* pData, int32_t iLen, Isobmff::sMehdH_t* mehd);
204
211 int32_t PutTrex(char* pData, int32_t iLen, Isobmff::sTrexH_t* trex);
212
219 int32_t PutTkhd(char* pData, int32_t iLen, Isobmff::sTkhdH_t* tkhd);
220
227 int32_t PutTrak(char* pData, int32_t iLen, Isobmff::sTrakH_t* trak);
228
235 int32_t GetBoxTypeLen(char *pData, int32_t *pType, int32_t *pLen);
236
243 int32_t PutMoov(char* pData, int32_t iLen, Isobmff::sMoovH_t* moov);
244
251 int32_t PutMvhd(char* pData, int32_t iLen, Isobmff::sMvhdH_t* mvhd);
252
259 int32_t PutMdhd(char* pData, int32_t iLen, Isobmff::sMdhdH_t* mdhd);
260
267 int32_t PutHdlr(char* pData, int32_t iLen, Isobmff::sHdlrH_t* hdlr);
268
275 int32_t PutMfhd(char* pData, int32_t iLen, Isobmff::sMfhdH_t* mfhd);
276
283 int32_t PutMoof(char* pData, int32_t iLen, Isobmff::sMoofH_t* moof);
284
291 int32_t PutMinf(char* pData, int32_t iLen, Isobmff::sMinfH_t* minf);
292
299 int32_t PutMvex(char* pData, int32_t iLen, Isobmff::sMvexH_t* mvex);
300
307 int32_t PutVmhd(char* pData, int32_t iLen, Isobmff::sVmhdH_t* vmhd);
308
315 int32_t PutStsd(char* pData, int32_t iLen, Isobmff::sStsdH_t* stsd);
316
323 int32_t PutStsz(char* pData, int32_t iLen, Isobmff::sStszH_t* stsz);
324
331 int32_t PutStsc(char* pData, int32_t iLen, Isobmff::sStscH_t* stsc);
332
339 int32_t PutStco(char* pData, int32_t iLen, Isobmff::sStcoH_t* stco);
340
347 int32_t PutStts(char* pData, int32_t iLen, Isobmff::sStsH_t* stts);
348
355 int32_t PutStbl(char* pData, int32_t iLen, Isobmff::sStblH_t* stbl);
356
363 sFindHdlrResult_t FindHdlrType(int32_t iHdlrType);
364};
Definition atsc_core_streamer_isobmff_parser.h:37
CIsoBmffParser()
Memset the Mp4 Header box.
int32_t mSampleDuration
Definition atsc_core_streamer_isobmff_parser.h:40
Isobmff::sMp4_t mp4
Definition atsc_core_streamer_isobmff_parser.h:115
int32_t PutMdia(char *pData, int32_t iLen, Isobmff::sMdiaH_t *mdia)
Parses and processes the 'Mdia' box.
int32_t PutFtyp(char *pData, int32_t iLen)
Parses and processes the 'Ftyp' box.
int32_t PutMvhd(char *pData, int32_t iLen, Isobmff::sMvhdH_t *mvhd)
Parses and processes the 'Mvhd' box.
int32_t GetDuration()
Get the Duration.
sFindHdlrResult_t FindHdlrType(int32_t iHdlrType)
Finds the handler type for the given track ID.
int32_t PutStsz(char *pData, int32_t iLen, Isobmff::sStszH_t *stsz)
NA.
int32_t PutMdhd(char *pData, int32_t iLen, Isobmff::sMdhdH_t *mdhd)
Parses and processes the 'Mdhd' box.
int32_t PutHdlr(char *pData, int32_t iLen, Isobmff::sHdlrH_t *hdlr)
Parses and processes the 'Hdlr' box.
int32_t get_mdat_size(char *pData, int32_t iDataLen)
Get the Mdat Size.
int32_t PutStts(char *pData, int32_t iLen, Isobmff::sStsH_t *stts)
NA.
int32_t PutStbl(char *pData, int32_t iLen, Isobmff::sStblH_t *stbl)
NA.
int32_t get_duration(void)
Get Duration.
Definition atsc_core_streamer_isobmff_parser.h:81
int32_t PutVmhd(char *pData, int32_t iLen, Isobmff::sVmhdH_t *vmhd)
NA.
int32_t iDuration
Definition atsc_core_streamer_isobmff_parser.h:39
int32_t PutStsd(char *pData, int32_t iLen, Isobmff::sStsdH_t *stsd)
NA.
uint32_t iTimescale
Definition atsc_core_streamer_isobmff_parser.h:41
int32_t PutTrex(char *pData, int32_t iLen, Isobmff::sTrexH_t *trex)
Parses and processes the 'Trex' box.
int32_t PutMehd(char *pData, int32_t iLen, Isobmff::sMehdH_t *mehd)
Parses and processes the 'Mehd' box.
uint32_t get_timescale(void)
Get TimeScale.
Definition atsc_core_streamer_isobmff_parser.h:89
int32_t set_mdat_size(char *pData, int32_t iDataLen, int32_t iMdatSize)
Set the Mdat Size.
int32_t PutTraf(char *pData, int32_t iLen, Isobmff::sTrafH_t *traf)
Parses and processes the 'Traf' box.
int32_t PutMP4(char *pData, int32_t iLen)
Provide Data to parse the data based on header type.
int32_t PutTfdt(char *pData, int32_t iLen, Isobmff::sTfdtH_t *tfdt)
Parses and processes the 'Tfdt' box.
int32_t get_sample_duration(void)
Get Sample Duration.
Definition atsc_core_streamer_isobmff_parser.h:97
int32_t PutTrak(char *pData, int32_t iLen, Isobmff::sTrakH_t *trak)
Parses and processes the 'Trak' box.
int32_t PutMvex(char *pData, int32_t iLen, Isobmff::sMvexH_t *mvex)
Parses and processes the 'Minf' box.
int32_t PutTkhd(char *pData, int32_t iLen, Isobmff::sTkhdH_t *tkhd)
Parses and processes the 'Tkhd' box.
int32_t PutStco(char *pData, int32_t iLen, Isobmff::sStcoH_t *stco)
NA.
void Init(void)
Reset the Variables with zero.
int32_t PutStyp(char *pData, int32_t iLen)
Parses and processes the 'Styp' box.
int32_t PutSidx(char *pData, int32_t iLen, Isobmff::sSidxH_t *sidx)
Parses and processes the 'Sidx' box.
int32_t PutMoof(char *pData, int32_t iLen, Isobmff::sMoofH_t *moof)
Parses and processes the 'Mfhd' box.
int32_t PutStsc(char *pData, int32_t iLen, Isobmff::sStscH_t *stsc)
NA.
int32_t PutMoov(char *pData, int32_t iLen, Isobmff::sMoovH_t *moov)
Parses and processes the 'Moov' box.
int32_t PutTfhd(char *pData, int32_t iLen, Isobmff::sTfhdH_t *tfhd)
Parses and processes the 'Tfhd' box.
int32_t PutMdat(char *pData, int32_t iLen, int32_t remainLen, bool bHintTrackContainOffset, int32_t iId, int32_t iSeq)
Parses and processes the 'Mdat' box.
int32_t GetBoxTypeLen(char *pData, int32_t *pType, int32_t *pLen)
Get Box Type of Mp4 Header.
int32_t PutTrun(char *pData, int32_t iLen, Isobmff::sTrunH_t *trun)
Parses and processes the 'Trun' box.
Definition atsc_core_streamer_isobmff.h:119
Definition atsc_core_streamer_isobmff.h:334
Definition atsc_core_streamer_isobmff.h:610
Definition atsc_core_streamer_isobmff.h:346
Definition atsc_core_streamer_isobmff.h:360
Definition atsc_core_streamer_isobmff.h:371
Definition atsc_core_streamer_isobmff.h:497
Definition atsc_core_streamer_isobmff.h:324
Definition atsc_core_streamer_isobmff.h:508
Definition atsc_core_streamer_isobmff.h:600
Definition atsc_core_streamer_isobmff.h:589
Definition atsc_core_streamer_isobmff.h:220
Definition atsc_core_streamer_isobmff.h:519
Definition atsc_core_streamer_isobmff.h:301
Definition atsc_core_streamer_isobmff.h:253
Definition atsc_core_streamer_isobmff.h:264
Definition atsc_core_streamer_isobmff.h:289
Definition atsc_core_streamer_isobmff.h:277
Definition atsc_core_streamer_isobmff.h:241
Definition atsc_core_streamer_isobmff.h:461
Definition atsc_core_streamer_isobmff.h:438
Definition atsc_core_streamer_isobmff.h:382
Definition atsc_core_streamer_isobmff.h:472
Definition atsc_core_streamer_isobmff.h:405
Definition atsc_core_streamer_isobmff.h:546
Definition atsc_core_streamer_isobmff.h:415
Definition atsc_core_streamer_isobmff.h:313