RDK Documentation (Open Sourced RDK Components)
isobmffbox.h
Go to the documentation of this file.
1 /*
2  * If not stated otherwise in this file or this component's license file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2019 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 /**
21 * @file isobmffbox.h
22 * @brief Header file for ISO Base Media File Format Boxes
23 */
24 
25 #ifndef __ISOBMFFBOX_H__
26 #define __ISOBMFFBOX_H__
27 
28 #include <cstdint>
29 #include <vector>
30 #include <string.h>
31 #include <string>
32 #include "AampLogManager.h"
33 
34 #define READ_U32(buf) \
35  (buf[0] << 24) | (buf[1] << 16) | (buf[2] << 8) | buf[3]; buf+=4;
36 
37 #define WRITE_U64(buf, val) \
38  buf[0]= val>>56; buf[1]= val>>48; buf[2]= val>>40; buf[3]= val>>32; buf[4]= val>>24; buf[5]= val>>16; buf[6]= val>>8; buf[7]= val;
39 
40 #define WRITE_U32(buf, val) \
41  buf[0]= val>>24; buf[1]= val>>16; buf[2]= val>>8; buf[3]= val;
42 
43 #define READ_U8(dst, src, sz) \
44  memcpy(dst, src, sz); src+=sz;
45 
46 #define READ_VERSION(buf) \
47  buf[0]; buf++;
48 
49 #define READ_FLAGS(buf) \
50  (buf[0] << 16) | (buf[1] << 8) | buf[2]; buf+=3;
51 
52 /**
53  * @fn ReadUint64
54  *
55  * @param[in] buf - buffer pointer
56  * @return bytes read from buffer
57  */
58 uint64_t ReadUint64(uint8_t *buf);
59 
60 /**
61  * @fn WriteUint64
62  *
63  * @param[in] dst - buffer pointer
64  * @param[in] val - value to write
65  * @return void
66  */
67 void WriteUint64(uint8_t *dst, uint64_t val);
68 
69 /**
70  * @fn ReadCStringLen
71  * @param[in] buffer Buffer to read
72  * @param[in] bufferLen String length
73  */
74 uint32_t ReadCStringLen(const uint8_t* buffer, uint32_t bufferLen);
75 
76 #define READ_BMDT64(buf) \
77  ReadUint64(buf); buf+=8;
78 
79 #define READ_64(buf) \
80  ReadUint64(buf); buf+=8;
81 
82 #define IS_TYPE(value, type) \
83  (value[0]==type[0] && value[1]==type[1] && value[2]==type[2] && value[3]==type[3])
84 
85 
86 /**
87  * @class Box
88  * @brief Base Class for ISO BMFF Box
89  */
90 class Box
91 {
92 private:
93  uint32_t offset; /**< Offset from the beginning of the segment */
94  uint32_t size; /**< Box Size */
95  char type[5]; /**< Box Type Including \0 */
96 
97 /*TODO: Handle special cases separately */
98 public:
99  static constexpr const char *FTYP = "ftyp";
100  static constexpr const char *MOOV = "moov";
101  static constexpr const char *MVHD = "mvhd";
102  static constexpr const char *TRAK = "trak";
103  static constexpr const char *MDIA = "mdia";
104  static constexpr const char *MDHD = "mdhd";
105  static constexpr const char *EMSG = "emsg";
106 
107  static constexpr const char *MOOF = "moof";
108  static constexpr const char *TFHD = "tfhd";
109  static constexpr const char *TRAF = "traf";
110  static constexpr const char *TFDT = "tfdt";
111  static constexpr const char *TRUN = "trun";
112  static constexpr const char *MDAT = "mdat";
113  static constexpr const char *TKHD = "tkhd";
114 
115  static constexpr const char *STYP = "styp";
116  static constexpr const char *SIDX = "sidx";
117  static constexpr const char *PRFT = "prft";
118 
119  /**
120  * @fn Box
121  *
122  * @param[in] sz - box size
123  * @param[in] btype - box type
124  */
125  Box(uint32_t sz, const char btype[4]);
126 
127  /**
128  * @brief Box destructor
129  */
130  virtual ~Box()
131  {
132 
133  }
134 
135  /**
136  * @fn setOffset
137  *
138  * @param[in] os - offset
139  * @return void
140  */
141  void setOffset(uint32_t os);
142 
143  /**
144  * @fn getOffset
145  *
146  * @return offset of box
147  */
148  uint32_t getOffset() const;
149 
150  /**
151  * @fn hasChildren
152  * @return true if this box has other boxes as children
153  */
154  virtual bool hasChildren();
155 
156  /**
157  * @fn getChildren
158  *
159  * @return array of child boxes
160  */
161  virtual const std::vector<Box*> *getChildren();
162 
163  /**
164  * @fn getSize
165  *
166  * @return box size
167  */
168  uint32_t getSize() const;
169 
170  /**
171  * @fn getType
172  *
173  * @return box type
174  */
175  const char *getType();
176 
177  /**
178  * @fn getBoxType
179  *
180  * @return box type if parsed. "unknown" otherwise
181  */
182  const char *getBoxType() const;
183 
184  /**
185  * @fn constructBox
186  *
187  * @param[in] hdr - pointer to box
188  * @param[in] maxSz - box size
189  * @param[in] mLOgObj - log object
190  * @param[in] correctBoxSize - flag to check if box size needs to be corrected
191  * @param[in] newTrackId - new track id to overwrite the existing track id, when value is -1, it will not override
192  * @return newly constructed Box object
193  */
194  static Box* constructBox(uint8_t *hdr, uint32_t maxSz, AampLogManager *mLOgObj=NULL, bool correctBoxSize = false, int newTrackId = -1);
195 };
196 
197 
198 /**
199  * @class GenericContainerBox
200  * @brief Class for ISO BMFF Box container
201  * Eg: MOOV, MOOF, TRAK, MDIA
202  */
203 class GenericContainerBox : public Box
204 {
205 private:
206  std::vector<Box*> children; // array of child boxes
207 
208 public:
209  /**
210  * @fn GenericContainerBox
211  *
212  * @param[in] sz - box size
213  * @param[in] btype - box type
214  */
215  GenericContainerBox(uint32_t sz, const char btype[4]);
216 
217  /**
218  * @fn ~GenericContainerBox
219  */
220  virtual ~GenericContainerBox();
221 
222  /**
223  * @fn addChildren
224  *
225  * @param[in] box - child box object
226  * @return void
227  */
228  void addChildren(Box *box);
229 
230  /**
231  * @fn hasChildren
232  *
233  * @return true if this box has other boxes as children
234  */
235  bool hasChildren() override;
236 
237  /**
238  * @fn getChildren
239  *
240  * @return array of child boxes
241  */
242  const std::vector<Box*> *getChildren() override;
243 
244  /**
245  * @fn constructContainer
246  *
247  * @param[in] sz - box size
248  * @param[in] btype - box type
249  * @param[in] ptr - pointer to box
250  * @param[in] newTrackId - new track id to overwrite the existing track id, when value is -1, it will not override
251  * @return newly constructed GenericContainerBox object
252  */
253  static GenericContainerBox* constructContainer(uint32_t sz, const char btype[4], uint8_t *ptr, int newTrackId = -1);
254 };
255 
256 /**
257  * @class TrakBox
258  * @brief Class for ISO BMFF TRAK container
259  */
261 {
262 private:
263  uint32_t track_id;
264 public:
265  /**
266  * @brief Trak constructor
267  *
268  * @param[in] sz - box size
269  */
270  TrakBox(uint32_t sz) : GenericContainerBox(sz, TRAK), track_id(0)
271  {
272  }
273  /**
274  * @fn constructTrakBox
275  *
276  * @param[in] sz - box size
277  * @param[in] ptr - pointer to box
278  * @param[in] newTrackId - new track id to overwrite the existing track id, when value is -1, it will not override
279  * @return newly constructed trak object
280  */
281  static TrakBox* constructTrakBox(uint32_t sz, uint8_t *ptr, int newTrackId = -1);
282 
283  /**
284  * @brief track_id getter
285  *
286  * @return trak_id
287  */
288  uint32_t getTrack_Id() { return track_id; }
289 };
290 /**
291  * @class FullBox
292  * @brief Class for single ISO BMFF Box
293  * Eg: FTYP, MDHD, MVHD, TFDT
294  */
295 class FullBox : public Box
296 {
297 protected:
298  uint8_t version;
299  uint32_t flags;
300 
301 public:
302  /**
303  * @fn FullBox
304  *
305  * @param[in] sz - box size
306  * @param[in] btype - box type
307  * @param[in] ver - version value
308  * @param[in] f - flag value
309  */
310  FullBox(uint32_t sz, const char btype[4], uint8_t ver, uint32_t f);
311 };
312 
313 
314 /**
315  * @class MvhdBox
316  * @brief Class for ISO BMFF MVHD Box
317  */
318 class MvhdBox : public FullBox
319 {
320 private:
321  uint32_t timeScale;
322 
323 public:
324  /**
325  * @fn MvhdBox
326  *
327  * @param[in] sz - box size
328  * @param[in] tScale - TimeScale value
329  */
330  MvhdBox(uint32_t sz, uint32_t tScale);
331 
332  /**
333  * @fn MvhdBox
334  * @param[in] fbox - box object
335  * @param[in] tScale - TimeScale value
336  */
337  MvhdBox(FullBox &fbox, uint32_t tScale);
338 
339  /**
340  * @fn setTimeScale
341  *
342  * @param[in] tScale - TimeScale value
343  * @return void
344  */
345  void setTimeScale(uint32_t tScale);
346 
347  /**
348  * @fn getTimeScale
349  *
350  * @return TimeScale value
351  */
352  uint32_t getTimeScale();
353 
354  /**
355  * @fn constructMvhdBox
356  *
357  * @param[in] sz - box size
358  * @param[in] ptr - pointer to box
359  * @return newly constructed MvhdBox object
360  */
361  static MvhdBox* constructMvhdBox(uint32_t sz, uint8_t *ptr);
362 };
363 
364 
365 /**
366  * @class MdhdBox
367  * @brief Class for ISO BMFF MDHD Box
368  */
369 class MdhdBox : public FullBox
370 {
371 private:
372  uint32_t timeScale;
373 
374 public:
375  /**
376  * @fn MdhdBox
377  *
378  * @param[in] sz - box size
379  * @param[in] tScale - TimeScale value
380  */
381  MdhdBox(uint32_t sz, uint32_t tScale);
382 
383  /**
384  * @fn MdhdBox
385  *
386  * @param[in] fbox - box object
387  * @param[in] tScale - TimeScale value
388  */
389  MdhdBox(FullBox &fbox, uint32_t tScale);
390 
391  /**
392  * @fn setTimeScale
393  *
394  * @param[in] tScale - TimeScale value
395  * @return void
396  */
397  void setTimeScale(uint32_t tScale);
398 
399  /**
400  * @fn getTimeScale
401  *
402  * @return TimeScale value
403  */
404  uint32_t getTimeScale();
405 
406  /**
407  * @fn constructMdhdBox
408  *
409  * @param[in] sz - box size
410  * @param[in] ptr - pointer to box
411  * @return newly constructed MdhdBox object
412  */
413  static MdhdBox* constructMdhdBox(uint32_t sz, uint8_t *ptr);
414 };
415 
416 
417 /**
418  * @class TfdtBox
419  * @brief Class for ISO BMFF TFDT Box
420  */
421 class TfdtBox : public FullBox
422 {
423 private:
424  uint64_t baseMDT; //BaseMediaDecodeTime value
425 
426 public:
427  /**
428  * @fn TfdtBox
429  *
430  * @param[in] sz - box size
431  * @param[in] mdt - BaseMediaDecodeTime value
432  */
433  TfdtBox(uint32_t sz, uint64_t mdt);
434 
435  /**
436  * @fn TfdtBox
437  *
438  * @param[in] fbox - box object
439  * @param[in] mdt - BaseMediaDecodeTime value
440  */
441  TfdtBox(FullBox &fbox, uint64_t mdt);
442 
443  /**
444  * @fn setBaseMDT
445  *
446  * @param[in] mdt - BaseMediaDecodeTime value
447  * @return void
448  */
449  void setBaseMDT(uint64_t mdt);
450 
451  /**
452  * @fn getBaseMDT
453  *
454  * @return BaseMediaDecodeTime value
455  */
456  uint64_t getBaseMDT();
457 
458  /**
459  * @fn constructTfdtBox
460  *
461  * @param[in] sz - box size
462  * @param[in] ptr - pointer to box
463  * @return newly constructed TfdtBox object
464  */
465  static TfdtBox* constructTfdtBox(uint32_t sz, uint8_t *ptr);
466 };
467 
468 /**
469  * @class EmsgBox
470  * @brief Class for ISO BMFF EMSG Box
471  */
472 class EmsgBox : public FullBox
473 {
474 private:
475  uint32_t timeScale;
476  uint32_t eventDuration;
477  uint32_t id;
478  uint32_t presentationTimeDelta; // This is added in emsg box v1
479  uint64_t presentationTime; // This is included in emsg box v0
480  uint8_t* schemeIdUri;
481  uint8_t* value;
482  // Message data
483  uint8_t* messageData;
484  uint32_t messageLen;
485 
486 public:
487  /**
488  * @fn EmsgBox
489  *
490  * @param[in] sz - box size
491  * @param[in] tScale - TimeScale value
492  * @param[in] evtDur - eventDuration value
493  * @param[in] _id - id value
494  */
495  EmsgBox(uint32_t sz, uint32_t tScale, uint32_t evtDur, uint32_t _id);
496 
497  /**
498  * @fn EmsgBox
499  *
500  * @param[in] fbox - box object
501  * @param[in] tScale - TimeScale value
502  * @param[in] evtDur - eventDuration value
503  * @param[in] _id - id value
504  * @param[in] presTime - presentationTime value
505  * @param[in] presTimeDelta - presentationTimeDelta value
506  */
507  EmsgBox(FullBox &fbox, uint32_t tScale, uint32_t evtDur, uint32_t _id, uint64_t presTime, uint32_t presTimeDelta);
508 
509  /**
510  * @fn ~EmsgBox
511  */
512  ~EmsgBox();
513 
514  /**
515  * @brief EmsgBox copy constructor
516  */
517  EmsgBox(const EmsgBox&) = delete;
518 
519  /**
520  * @brief EmsgBox =operator overloading
521  */
522  EmsgBox& operator=(const EmsgBox&) = delete;
523 
524  /**
525  * @fn setTimeScale
526  *
527  * @param[in] tScale - TimeScale value
528  * @return void
529  */
530  void setTimeScale(uint32_t tScale);
531 
532  /**
533  * @fn getTimeScale
534  *
535  * @return TimeScale value
536  */
537  uint32_t getTimeScale();
538 
539  /**
540  * @fn setEventDuration
541  *
542  * @param[in] evtDur - eventDuration value
543  * @return void
544  */
545  void setEventDuration(uint32_t evtDur);
546 
547  /**
548  * @fn getEventDuration
549  *
550  * @return eventDuration value
551  */
552  uint32_t getEventDuration();
553 
554  /**
555  * @fn setId
556  *
557  * @param[in] _id - id
558  * @return void
559  */
560  void setId(uint32_t _id);
561 
562  /**
563  * @fn getId
564  *
565  * @return id value
566  */
567  uint32_t getId();
568 
569  /**
570  * @fn setPresentationTimeDelta
571  *
572  * @param[in] presTimeDelta - presTimeDelta
573  * @return void
574  */
575  void setPresentationTimeDelta(uint32_t presTimeDelta);
576 
577  /**
578  * @fn getPresentationTimeDelta
579  *
580  * @return presentationTimeDelta value
581  */
582  uint32_t getPresentationTimeDelta();
583 
584  /**
585  * @fn setPresentationTime
586  *
587  * @param[in] presTime - presTime
588  * @return void
589  */
590  void setPresentationTime(uint64_t presTime);
591 
592  /**
593  * @fn getPresentationTime
594  *
595  * @return presentationTime value
596  */
597  uint64_t getPresentationTime();
598 
599  /**
600  * @fn setSchemeIdUri
601  *
602  * @param[in] schemeIdUri - schemeIdUri pointer
603  * @return void
604  */
605  void setSchemeIdUri(uint8_t* schemeIdURI);
606 
607  /**
608  * @fn getSchemeIdUri
609  *
610  * @return schemeIdUri value
611  */
612  uint8_t* getSchemeIdUri();
613 
614  /**
615  * @fn setValue
616  *
617  * @param[in] value - value pointer
618  * @return void
619  */
620  void setValue(uint8_t* schemeIdValue);
621 
622  /**
623  * @fn getValue
624  *
625  * @return schemeIdUri value
626  */
627  uint8_t* getValue();
628 
629  /**
630  * @fn setMessage
631  *
632  * @param[in] message - Message pointer
633  * @param[in] len - Message length
634  * @return void
635  */
636  void setMessage(uint8_t* message, uint32_t len);
637 
638  /**
639  * @fn getMessage
640  *
641  * @return messageData
642  */
643  uint8_t* getMessage();
644 
645  /**
646  * @fn getMessageLen
647  *
648  * @return messageLen
649  */
650  uint32_t getMessageLen();
651 
652  /**
653  * @fn constructEmsgBox
654  *
655  * @param[in] sz - box size
656  * @param[in] ptr - pointer to box
657  * @return newly constructed EmsgBox object
658  */
659  static EmsgBox* constructEmsgBox(uint32_t sz, uint8_t *ptr);
660 };
661 
662 /**
663  * @class TrunBox
664  * @brief Class for ISO BMFF TRUN Box
665  */
666 class TrunBox : public FullBox
667 {
668 private:
669  uint64_t duration; //Sample Duration value
670 
671 
672 public:
673  struct Entry {
674  Entry() : sample_duration(0), sample_size(0), sample_flags(0), sample_composition_time_offset(0) {}
675  uint32_t sample_duration;
676  uint32_t sample_size;
677  uint32_t sample_flags;
678  uint32_t sample_composition_time_offset;
679  };
680  /**
681  * @fn TrunBox
682  *
683  * @param[in] sz - box size
684  * @param[in] mdt - sampleDuration value
685  */
686  TrunBox(uint32_t sz, uint64_t sampleDuration);
687 
688  /**
689  * @fn TrunBox
690  *
691  * @param[in] fbox - box object
692  * @param[in] mdt - BaseMediaDecodeTime value
693  */
694  TrunBox(FullBox &fbox, uint64_t sampleDuration);
695 
696  /**
697  * @fn setSampleDuration
698  *
699  * @param[in] sampleDuration - Sample Duration value
700  * @return void
701  */
702  void setSampleDuration(uint64_t sampleDuration);
703 
704  /**
705  * @fn getSampleDuration
706  *
707  * @return sampleDuration value
708  */
709  uint64_t getSampleDuration();
710 
711  /**
712  * @fn constructTrunBox
713  *
714  * @param[in] sz - box size
715  * @param[in] ptr - pointer to box
716  * @return newly constructed TrunBox object
717  */
718  static TrunBox* constructTrunBox(uint32_t sz, uint8_t *ptr);
719 };
720 
721 /**
722  * @class TfhdBox
723  * @brief Class for ISO BMFF TFHD Box
724  */
725 class TfhdBox : public FullBox
726 {
727 private:
728  uint64_t duration;
729 
730 public:
731  /**
732  * @fn TfhdBox
733  *
734  * @param[in] sz - box size
735  * @param[in] sample_duration - Sample Duration value
736  */
737  TfhdBox(uint32_t sz, uint64_t sample_duration);
738 
739  /**
740  * @fn TfhdBox
741  *
742  * @param[in] fbox - box object
743  * @param[in] sample_duration - Sample Duration value
744  */
745  TfhdBox(FullBox &fbox, uint64_t sample_duration);
746 
747  /**
748  * @fn setSampleDuration
749  *
750  * @param[in] sample_duration - SampleDuration value
751  * @return void
752  */
753  void setSampleDuration(uint64_t sample_duration);
754 
755  /**
756  * @fn getSampleDuration
757  *
758  * @return SampleDuration value
759  */
760  uint64_t getSampleDuration();
761 
762  /**
763  * @fn constructTfhdBox
764  *
765  * @param[in] sz - box size
766  * @param[in] ptr - pointer to box
767  * @return newly constructed TfhdBox object
768  */
769  static TfhdBox* constructTfhdBox(uint32_t sz, uint8_t *ptr);
770 };
771 
772 /**
773  * @class PrftBox
774  * @brief Class for ISO BMFF TFHD Box
775  */
776 class PrftBox : public FullBox
777 {
778 private:
779  uint32_t track_id;
780  uint64_t ntp_ts;
781  uint64_t media_time;
782 
783 public:
784  /**
785  * @fn PrftBox
786  *
787  * @param[in] sz - box size
788  * @param[in] trackId - media time
789  * @param[in] ntpTs - media time
790  * @param[in] mediaTime - media time
791  */
792  PrftBox(uint32_t sz, uint32_t trackId, uint64_t ntpTs, uint64_t mediaTime);
793 
794  /**
795  * @fn PrftBox
796  *
797  * @param[in] fbox - box object
798  * @param[in] trackId - media time
799  * @param[in] ntpTs - media time
800  * @param[in] mediaTime - media time
801  */
802  PrftBox(FullBox &fbox, uint32_t trackId, uint64_t ntpTs, uint64_t mediaTime);
803 
804  /**
805  * @fn setTrackId
806  *
807  * @param[in] trackId - Track Id value
808  * @return void
809  */
810  void setTrackId(uint32_t trackId);
811 
812  /**
813  * @fn getTrackId
814  *
815  * @return track_id value
816  */
817  uint32_t getTrackId();
818 
819  /**
820  * @fn setNtpTs
821  *
822  * @param[in] ntpTs - ntp timestamp value
823  * @return void
824  */
825  void setNtpTs(uint64_t ntpTs);
826 
827  /**
828  * @fn getNtpTs
829  *
830  * @return ntp_ts value
831  */
832  uint64_t getNtpTs();
833 
834  /**
835  * @fn setMediaTime
836  *
837  * @param[in] mediaTime - metia time value
838  * @return void
839  */
840  void setMediaTime(uint64_t mediaTime);
841 
842  /**
843  * @fn getMediaTime
844  *
845  * @return media_time value
846  */
847  uint64_t getMediaTime();
848 
849  /**
850  * @fn constructPrftBox
851  *
852  * @param[in] sz - box size
853  * @param[in] ptr - pointer to box
854  * @return newly constructed PrftBox object
855  */
856  static PrftBox* constructPrftBox(uint32_t sz, uint8_t *ptr);
857 };
858 
859 #endif /* __ISOBMFFBOX_H__ */
MvhdBox::setTimeScale
void setTimeScale(uint32_t tScale)
Set TimeScale value.
Definition: isobmffbox.cpp:352
GenericContainerBox::addChildren
void addChildren(Box *box)
Add a box as a child box.
Definition: isobmffbox.cpp:279
TfdtBox::setBaseMDT
void setBaseMDT(uint64_t mdt)
Set BaseMediaDecodeTime value.
Definition: isobmffbox.cpp:462
AampLogManager.h
Log managed for Aamp.
TfdtBox::getBaseMDT
uint64_t getBaseMDT()
Get BaseMediaDecodeTime value.
Definition: isobmffbox.cpp:470
EmsgBox::setId
void setId(uint32_t _id)
Set id.
Definition: isobmffbox.cpp:574
GenericContainerBox::constructContainer
static GenericContainerBox * constructContainer(uint32_t sz, const char btype[4], uint8_t *ptr, int newTrackId=-1)
Definition: isobmffbox.cpp:310
PrftBox::setNtpTs
void setNtpTs(uint64_t ntpTs)
Set NTP Ts value.
Definition: isobmffbox.cpp:1015
EmsgBox::getSchemeIdUri
uint8_t * getSchemeIdUri()
Get schemeIdUri.
Definition: isobmffbox.cpp:630
EmsgBox::getPresentationTimeDelta
uint32_t getPresentationTimeDelta()
Get presentationTimeDelta.
Definition: isobmffbox.cpp:598
MdhdBox::constructMdhdBox
static MdhdBox * constructMdhdBox(uint32_t sz, uint8_t *ptr)
Static function to construct a MdhdBox object.
Definition: isobmffbox.cpp:423
EmsgBox
Class for ISO BMFF EMSG Box.
Definition: isobmffbox.h:472
Box::Box
Box(uint32_t sz, const char btype[4])
Box constructor.
Definition: isobmffbox.cpp:74
TrunBox::TrunBox
TrunBox(uint32_t sz, uint64_t sampleDuration)
TrunBox constructor.
Definition: isobmffbox.cpp:801
MdhdBox
Class for ISO BMFF MDHD Box.
Definition: isobmffbox.h:369
FullBox::FullBox
FullBox(uint32_t sz, const char btype[4], uint8_t ver, uint32_t f)
FullBox constructor.
Definition: isobmffbox.cpp:328
PrftBox::PrftBox
PrftBox(uint32_t sz, uint32_t trackId, uint64_t ntpTs, uint64_t mediaTime)
PrftBox constructor.
Definition: isobmffbox.cpp:983
Box::getBoxType
const char * getBoxType() const
Get box type.
Definition: isobmffbox.cpp:130
TrakBox::constructTrakBox
static TrakBox * constructTrakBox(uint32_t sz, uint8_t *ptr, int newTrackId=-1)
Definition: isobmffbox.cpp:1073
Box::~Box
virtual ~Box()
Box destructor.
Definition: isobmffbox.h:130
Box::type
char type[5]
Definition: isobmffbox.h:95
EmsgBox::~EmsgBox
~EmsgBox()
EmsgBox dtor.
Definition: isobmffbox.cpp:521
Box::offset
uint32_t offset
Definition: isobmffbox.h:93
Box::size
uint32_t size
Definition: isobmffbox.h:94
EmsgBox::EmsgBox
EmsgBox(uint32_t sz, uint32_t tScale, uint32_t evtDur, uint32_t _id)
EmsgBox constructor.
Definition: isobmffbox.cpp:499
Box::constructBox
static Box * constructBox(uint8_t *hdr, uint32_t maxSz, AampLogManager *mLOgObj=NULL, bool correctBoxSize=false, int newTrackId=-1)
Definition: isobmffbox.cpp:161
EmsgBox::setTimeScale
void setTimeScale(uint32_t tScale)
Set TimeScale value.
Definition: isobmffbox.cpp:542
TfdtBox
Class for ISO BMFF TFDT Box.
Definition: isobmffbox.h:421
Box::hasChildren
virtual bool hasChildren()
To check if box has any child boxes.
Definition: isobmffbox.cpp:98
PrftBox::constructPrftBox
static PrftBox * constructPrftBox(uint32_t sz, uint8_t *ptr)
Static function to construct a PrftBox object.
Definition: isobmffbox.cpp:1047
AampLogManager
AampLogManager Class.
Definition: AampLogManager.h:150
EmsgBox::getEventDuration
uint32_t getEventDuration()
Get eventDuration.
Definition: isobmffbox.cpp:566
MvhdBox::MvhdBox
MvhdBox(uint32_t sz, uint32_t tScale)
MvhdBox constructor.
Definition: isobmffbox.cpp:336
EmsgBox::getMessageLen
uint32_t getMessageLen()
Get Message length.
Definition: isobmffbox.cpp:671
EmsgBox::setEventDuration
void setEventDuration(uint32_t evtDur)
Set eventDuration value.
Definition: isobmffbox.cpp:558
ReadCStringLen
uint32_t ReadCStringLen(const uint8_t *buffer, uint32_t bufferLen)
Read a string from buffer and return it.
Definition: isobmffbox.cpp:34
Box
Base Class for ISO BMFF Box.
Definition: isobmffbox.h:90
EmsgBox::getId
uint32_t getId()
Get id.
Definition: isobmffbox.cpp:582
ReadUint64
uint64_t ReadUint64(uint8_t *buf)
Utility function to read 8 bytes from a buffer.
Definition: isobmffbox.cpp:54
TfhdBox::TfhdBox
TfhdBox(uint32_t sz, uint64_t sample_duration)
TfhdBox constructor.
Definition: isobmffbox.cpp:890
Box::getOffset
uint32_t getOffset() const
Get box offset.
Definition: isobmffbox.cpp:90
GenericContainerBox
Class for ISO BMFF Box container Eg: MOOV, MOOF, TRAK, MDIA.
Definition: isobmffbox.h:203
TrunBox::constructTrunBox
static TrunBox * constructTrunBox(uint32_t sz, uint8_t *ptr)
Static function to construct a TrunBox object.
Definition: isobmffbox.cpp:831
EmsgBox::getTimeScale
uint32_t getTimeScale()
Get schemeIdUri.
Definition: isobmffbox.cpp:550
PrftBox::getNtpTs
uint64_t getNtpTs()
Get ntp Timestamp value.
Definition: isobmffbox.cpp:1023
Box::setOffset
void setOffset(uint32_t os)
Set box's offset from the beginning of the buffer.
Definition: isobmffbox.cpp:82
EmsgBox::setPresentationTimeDelta
void setPresentationTimeDelta(uint32_t presTimeDelta)
Set presentationTimeDelta.
Definition: isobmffbox.cpp:590
EmsgBox::setPresentationTime
void setPresentationTime(uint64_t presTime)
Set presentationTime.
Definition: isobmffbox.cpp:606
GenericContainerBox::hasChildren
bool hasChildren() override
To check if box has any child boxes.
Definition: isobmffbox.cpp:287
Box::getSize
uint32_t getSize() const
Get box size.
Definition: isobmffbox.cpp:114
TrakBox::TrakBox
TrakBox(uint32_t sz)
Trak constructor.
Definition: isobmffbox.h:270
TfhdBox::setSampleDuration
void setSampleDuration(uint64_t sample_duration)
Set Sample Duration value.
Definition: isobmffbox.cpp:906
GenericContainerBox::~GenericContainerBox
virtual ~GenericContainerBox()
GenericContainerBox destructor.
Definition: isobmffbox.cpp:265
TrunBox::Entry
Definition: isobmffbox.h:673
TfhdBox
Class for ISO BMFF TFHD Box.
Definition: isobmffbox.h:725
WriteUint64
void WriteUint64(uint8_t *dst, uint64_t val)
Utility function to write 8 bytes to a buffer.
Definition: isobmffbox.cpp:64
EmsgBox::getMessage
uint8_t * getMessage()
Get Message.
Definition: isobmffbox.cpp:663
GenericContainerBox::GenericContainerBox
GenericContainerBox(uint32_t sz, const char btype[4])
GenericContainerBox constructor.
Definition: isobmffbox.cpp:257
MvhdBox::constructMvhdBox
static MvhdBox * constructMvhdBox(uint32_t sz, uint8_t *ptr)
Static function to construct a MvhdBox object.
Definition: isobmffbox.cpp:368
TfdtBox::TfdtBox
TfdtBox(uint32_t sz, uint64_t mdt)
TfdtBox constructor.
Definition: isobmffbox.cpp:446
GenericContainerBox::getChildren
const std::vector< Box * > * getChildren() override
Get children of this box.
Definition: isobmffbox.cpp:295
PrftBox::setMediaTime
void setMediaTime(uint64_t mediaTime)
Set Sample Duration value.
Definition: isobmffbox.cpp:1031
EmsgBox::setValue
void setValue(uint8_t *schemeIdValue)
Set value.
Definition: isobmffbox.cpp:638
TfhdBox::constructTfhdBox
static TfhdBox * constructTfhdBox(uint32_t sz, uint8_t *ptr)
Static function to construct a TfdtBox object.
Definition: isobmffbox.cpp:922
Box::getChildren
virtual const std::vector< Box * > * getChildren()
Get children of this box.
Definition: isobmffbox.cpp:106
MvhdBox
Class for ISO BMFF MVHD Box.
Definition: isobmffbox.h:318
PrftBox::getMediaTime
uint64_t getMediaTime()
Get SampleDuration value.
Definition: isobmffbox.cpp:1039
EmsgBox::getValue
uint8_t * getValue()
Get value.
Definition: isobmffbox.cpp:646
PrftBox::getTrackId
uint32_t getTrackId()
Get Track id value.
Definition: isobmffbox.cpp:1007
TrunBox::setSampleDuration
void setSampleDuration(uint64_t sampleDuration)
Set SampleDuration value.
Definition: isobmffbox.cpp:815
TrakBox
Class for ISO BMFF TRAK container.
Definition: isobmffbox.h:260
Box::getType
const char * getType()
Get box type.
Definition: isobmffbox.cpp:122
EmsgBox::setSchemeIdUri
void setSchemeIdUri(uint8_t *schemeIdURI)
Set schemeIdUri.
Definition: isobmffbox.cpp:622
FullBox
Class for single ISO BMFF Box Eg: FTYP, MDHD, MVHD, TFDT.
Definition: isobmffbox.h:295
TrunBox::getSampleDuration
uint64_t getSampleDuration()
Get sampleDuration value.
Definition: isobmffbox.cpp:823
PrftBox::setTrackId
void setTrackId(uint32_t trackId)
Set Track Id value.
Definition: isobmffbox.cpp:999
MdhdBox::setTimeScale
void setTimeScale(uint32_t tScale)
Set TimeScale value.
Definition: isobmffbox.cpp:407
EmsgBox::operator=
EmsgBox & operator=(const EmsgBox &)=delete
EmsgBox =operator overloading.
PrftBox
Class for ISO BMFF TFHD Box.
Definition: isobmffbox.h:776
EmsgBox::constructEmsgBox
static EmsgBox * constructEmsgBox(uint32_t sz, uint8_t *ptr)
Static function to construct a EmsgBox object.
Definition: isobmffbox.cpp:679
MvhdBox::getTimeScale
uint32_t getTimeScale()
Get TimeScale value.
Definition: isobmffbox.cpp:360
MdhdBox::MdhdBox
MdhdBox(uint32_t sz, uint32_t tScale)
MdhdBox constructor.
Definition: isobmffbox.cpp:391
EmsgBox::getPresentationTime
uint64_t getPresentationTime()
Get presentationTime.
Definition: isobmffbox.cpp:614
TrakBox::getTrack_Id
uint32_t getTrack_Id()
track_id getter
Definition: isobmffbox.h:288
TrunBox
Class for ISO BMFF TRUN Box.
Definition: isobmffbox.h:666
MdhdBox::getTimeScale
uint32_t getTimeScale()
Get TimeScale value.
Definition: isobmffbox.cpp:415
TfhdBox::getSampleDuration
uint64_t getSampleDuration()
Get SampleDuration value.
Definition: isobmffbox.cpp:914
TfdtBox::constructTfdtBox
static TfdtBox * constructTfdtBox(uint32_t sz, uint8_t *ptr)
Static function to construct a TfdtBox object.
Definition: isobmffbox.cpp:478
EmsgBox::setMessage
void setMessage(uint8_t *message, uint32_t len)
Set Message.
Definition: isobmffbox.cpp:654