Shaka Packager SDK
box_definitions.h
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef PACKAGER_MEDIA_FORMATS_MP4_BOX_DEFINITIONS_H_
6 #define PACKAGER_MEDIA_FORMATS_MP4_BOX_DEFINITIONS_H_
7 
8 #include <vector>
9 
10 #include "packager/media/base/decrypt_config.h"
11 #include "packager/media/base/fourccs.h"
12 #include "packager/media/codecs/aac_audio_specific_config.h"
13 #include "packager/media/codecs/es_descriptor.h"
14 #include "packager/media/formats/mp4/box.h"
15 
16 namespace shaka {
17 namespace media {
18 
19 class BufferReader;
20 
21 namespace mp4 {
22 
23 enum TrackType {
24  kInvalid = 0,
25  kVideo,
26  kAudio,
27  kHint,
28  kText,
29 };
30 
31 class BoxBuffer;
32 
33 #define DECLARE_BOX_METHODS(T) \
34  public: \
35  T(); \
36  ~T() override; \
37  \
38  FourCC BoxType() const override; \
39  \
40  private: \
41  bool ReadWriteInternal(BoxBuffer* buffer) override; \
42  size_t ComputeSizeInternal() override; \
43  \
44  public:
45 
46 struct FileType : Box {
47  DECLARE_BOX_METHODS(FileType);
48 
49  FourCC major_brand = FOURCC_NULL;
50  uint32_t minor_version = 0;
51  std::vector<FourCC> compatible_brands;
52 };
53 
55  FourCC BoxType() const override;
56 };
57 
59  DECLARE_BOX_METHODS(ProtectionSystemSpecificHeader);
60 
61  std::vector<uint8_t> raw_box;
62 };
63 
65  DECLARE_BOX_METHODS(SampleAuxiliaryInformationOffset);
66 
67  std::vector<uint64_t> offsets;
68 };
69 
71  DECLARE_BOX_METHODS(SampleAuxiliaryInformationSize);
72 
73  uint8_t default_sample_info_size = 0;
74  uint32_t sample_count = 0;
75  std::vector<uint8_t> sample_info_sizes;
76 };
77 
85  bool ReadWrite(uint8_t iv_size, bool has_subsamples, BoxBuffer* buffer);
92  bool ParseFromBuffer(uint8_t iv_size,
93  bool has_subsamples,
94  BufferReader* reader);
96  uint32_t ComputeSize() const;
99  uint32_t GetTotalSizeOfSubsamples() const;
100 
101  std::vector<uint8_t> initialization_vector;
102  std::vector<SubsampleEntry> subsamples;
103 };
104 
106  static const uint8_t kInvalidIvSize = 1;
107 
108  enum SampleEncryptionFlags {
109  kUseSubsampleEncryption = 2,
110  };
111 
112  DECLARE_BOX_METHODS(SampleEncryption);
118  bool ParseFromSampleEncryptionData(
119  uint8_t iv_size,
120  std::vector<SampleEncryptionEntry>* sample_encryption_entries) const;
121 
124  std::vector<uint8_t> sample_encryption_data;
125 
126  uint8_t iv_size = kInvalidIvSize;
127  std::vector<SampleEncryptionEntry> sample_encryption_entries;
128 };
129 
130 struct OriginalFormat : Box {
131  DECLARE_BOX_METHODS(OriginalFormat);
132 
133  FourCC format = FOURCC_NULL;
134 };
135 
136 struct SchemeType : FullBox {
137  DECLARE_BOX_METHODS(SchemeType);
138 
139  FourCC type = FOURCC_NULL;
140  uint32_t version = 0u;
141 };
142 
144  DECLARE_BOX_METHODS(TrackEncryption);
145 
146  uint8_t default_is_protected = 0;
147  uint8_t default_per_sample_iv_size = 0;
148  // Default to a vector of 16 zeros.
149  std::vector<uint8_t> default_kid = std::vector<uint8_t>(16, 0);
150 
151  // For pattern-based encryption.
152  uint8_t default_crypt_byte_block = 0;
153  uint8_t default_skip_byte_block = 0;
154 
155  // Present only if
156  // |default_is_protected == 1 && default_per_sample_iv_size == 0|.
157  std::vector<uint8_t> default_constant_iv;
158 };
159 
160 struct SchemeInfo : Box {
161  DECLARE_BOX_METHODS(SchemeInfo);
162 
163  TrackEncryption track_encryption;
164 };
165 
167  DECLARE_BOX_METHODS(ProtectionSchemeInfo);
168 
169  OriginalFormat format;
170  SchemeType type;
171  SchemeInfo info;
172 };
173 
175  DECLARE_BOX_METHODS(MovieHeader);
176 
177  uint64_t creation_time = 0;
178  uint64_t modification_time = 0;
179  uint32_t timescale = 0;
180  uint64_t duration = 0;
181  int32_t rate = 1 << 16;
182  int16_t volume = 1 << 8;
183  uint32_t next_track_id = 0;
184 };
185 
187  enum TrackHeaderFlags {
188  kTrackEnabled = 0x000001,
189  kTrackInMovie = 0x000002,
190  kTrackInPreview = 0x000004,
191  };
192 
193  DECLARE_BOX_METHODS(TrackHeader);
194 
195  uint64_t creation_time = 0;
196  uint64_t modification_time = 0;
197  uint32_t track_id = 0;
198  uint64_t duration = 0;
199  int16_t layer = 0;
200  int16_t alternate_group = 0;
201  int16_t volume = -1;
202  // width and height specify the track's visual presentation size as
203  // fixed-point 16.16 values.
204  uint32_t width = 0;
205  uint32_t height = 0;
206 };
207 
209  uint64_t segment_duration = 0;
210  int64_t media_time = 0;
211  int16_t media_rate_integer = 0;
212  int16_t media_rate_fraction = 0;
213 };
214 
215 struct EditList : FullBox {
216  DECLARE_BOX_METHODS(EditList);
217 
218  std::vector<EditListEntry> edits;
219 };
220 
221 struct Edit : Box {
222  DECLARE_BOX_METHODS(Edit);
223 
224  EditList list;
225 };
226 
228  DECLARE_BOX_METHODS(HandlerReference);
229 
230  FourCC handler_type = FOURCC_NULL;
231 };
232 
233 struct Language {
234  bool ReadWrite(BoxBuffer* buffer);
235  uint32_t ComputeSize() const;
236 
237  std::string code;
238 };
239 
241 struct ID3v2 : FullBox {
242  DECLARE_BOX_METHODS(ID3v2);
243 
244  Language language;
245  std::vector<uint8_t> id3v2_data;
246 };
247 
248 struct Metadata : FullBox {
249  DECLARE_BOX_METHODS(Metadata);
250 
251  HandlerReference handler;
252  ID3v2 id3v2;
253 };
254 
255 // This defines a common structure for various CodecConfiguration boxes:
256 // AVCConfiguration, HEVCConfiguration and VPCodecConfiguration.
257 // Note that unlike the other two CodecConfiguration boxes, VPCodecConfiguration
258 // box inherits from FullBox instead of Box, according to VP Codec ISO Media
259 // File Format Binding specification. It will be handled properly in the
260 // implementation.
262  DECLARE_BOX_METHODS(CodecConfiguration);
263 
264  FourCC box_type = FOURCC_NULL;
265  // Contains full codec configuration record, including possible extension
266  // boxes.
267  std::vector<uint8_t> data;
268 };
269 
271  DECLARE_BOX_METHODS(PixelAspectRatio);
272 
273  uint32_t h_spacing = 0u;
274  uint32_t v_spacing = 0u;
275 };
276 
278  DECLARE_BOX_METHODS(VideoSampleEntry);
279 
280  // Returns actual format of this sample entry.
281  FourCC GetActualFormat() const {
282  return format == FOURCC_encv ? sinf.format.format : format;
283  }
284  // Returns the box type of codec configuration box from video format.
285  FourCC GetCodecConfigurationBoxType(FourCC format) const;
286 
287  // Convert |extra_codec_configs| to vector.
288  std::vector<uint8_t> ExtraCodecConfigsAsVector() const;
289  // Parse |extra_codec_configs| from vector.
290  bool ParseExtraCodecConfigsVector(const std::vector<uint8_t>& data);
291 
292  FourCC format = FOURCC_NULL;
293  // data_reference_index is 1-based and "dref" box is mandatory so it is
294  // always present.
295  uint16_t data_reference_index = 1u;
296  uint16_t width = 0u;
297  uint16_t height = 0u;
298 
299  PixelAspectRatio pixel_aspect;
301  CodecConfiguration codec_configuration;
302  // Some codecs, e.g. Dolby Vision, have extra codec configuration boxes that
303  // need to be propagated to muxers.
304  std::vector<CodecConfiguration> extra_codec_configs;
305 };
306 
308  DECLARE_BOX_METHODS(ElementaryStreamDescriptor);
309 
310  AACAudioSpecificConfig aac_audio_specific_config;
311  ESDescriptor es_descriptor;
312 };
313 
314 struct DTSSpecific : Box {
315  DECLARE_BOX_METHODS(DTSSpecific);
316 
317  uint32_t sampling_frequency = 0u;
318  uint32_t max_bitrate = 0u;
319  uint32_t avg_bitrate = 0u;
320  uint8_t pcm_sample_depth = 0u;
321  std::vector<uint8_t> extra_data;
322 };
323 
324 struct AC3Specific : Box {
325  DECLARE_BOX_METHODS(AC3Specific);
326 
327  std::vector<uint8_t> data;
328 };
329 
330 struct EC3Specific : Box {
331  DECLARE_BOX_METHODS(EC3Specific);
332 
333  std::vector<uint8_t> data;
334 };
335 
336 struct OpusSpecific : Box {
337  DECLARE_BOX_METHODS(OpusSpecific);
338 
339  std::vector<uint8_t> opus_identification_header;
340  // The number of priming samples. Extracted from |opus_identification_header|.
341  uint16_t preskip = 0u;
342 };
343 
344 // FLAC specific decoder configuration box:
345 // https://github.com/xiph/flac/blob/master/doc/isoflac.txt
346 // We do not care about the actual data inside, which is simply copied over.
348  DECLARE_BOX_METHODS(FlacSpecific);
349 
350  std::vector<uint8_t> data;
351 };
352 
354  DECLARE_BOX_METHODS(AudioSampleEntry);
355 
356  // Returns actual format of this sample entry.
357  FourCC GetActualFormat() const {
358  return format == FOURCC_enca ? sinf.format.format : format;
359  }
360 
361  FourCC format = FOURCC_NULL;
362  // data_reference_index is 1-based and "dref" box is mandatory so it is
363  // always present.
364  uint16_t data_reference_index = 1u;
365  uint16_t channelcount = 2u;
366  uint16_t samplesize = 16u;
367  uint32_t samplerate = 0u;
368 
370 
372  DTSSpecific ddts;
373  AC3Specific dac3;
374  EC3Specific dec3;
375  OpusSpecific dops;
376  FlacSpecific dfla;
377 };
378 
380  DECLARE_BOX_METHODS(WebVTTConfigurationBox);
381 
382  std::string config;
383 };
384 
386  DECLARE_BOX_METHODS(WebVTTSourceLabelBox);
387 
388  std::string source_label;
389 };
390 
392  DECLARE_BOX_METHODS(TextSampleEntry);
393 
394  // Specifies fourcc of this sample entry. It needs to be set on write, e.g.
395  // set to 'wvtt' to write WVTTSampleEntry; On read, it is recovered from box
396  // header.
397  FourCC format = FOURCC_NULL;
398 
399  // data_reference_index is 1-based and "dref" box is mandatory so it is
400  // always present.
401  uint16_t data_reference_index = 1u;
402 
403  // Sub boxes for wvtt text sample entry.
404  WebVTTConfigurationBox config;
405  WebVTTSourceLabelBox label;
406  // Optional MPEG4BitRateBox.
407 };
408 
410  DECLARE_BOX_METHODS(SampleDescription);
411 
412  TrackType type = kInvalid;
413  // TODO(kqyang): Clean up the code to have one single member, e.g. by creating
414  // SampleEntry struct, std::vector<SampleEntry> sample_entries.
415  std::vector<VideoSampleEntry> video_entries;
416  std::vector<AudioSampleEntry> audio_entries;
417  std::vector<TextSampleEntry> text_entries;
418 };
419 
420 struct DecodingTime {
421  uint32_t sample_count;
422  uint32_t sample_delta;
423 };
424 
425 // stts.
427  DECLARE_BOX_METHODS(DecodingTimeToSample);
428 
429  std::vector<DecodingTime> decoding_time;
430 };
431 
433  uint32_t sample_count;
434  // If version == 0, sample_offset is uint32_t;
435  // If version == 1, sample_offset is int32_t.
436  // Use int64_t so both can be supported properly.
437  int64_t sample_offset;
438 };
439 
440 // ctts. Optional.
442  DECLARE_BOX_METHODS(CompositionTimeToSample);
443 
444  std::vector<CompositionOffset> composition_offset;
445 };
446 
447 struct ChunkInfo {
448  uint32_t first_chunk;
449  uint32_t samples_per_chunk;
450  uint32_t sample_description_index;
451 };
452 
453 // stsc.
455  DECLARE_BOX_METHODS(SampleToChunk);
456 
457  std::vector<ChunkInfo> chunk_info;
458 };
459 
460 // stsz.
461 struct SampleSize : FullBox {
462  DECLARE_BOX_METHODS(SampleSize);
463 
464  uint32_t sample_size = 0u;
465  uint32_t sample_count = 0u;
466  std::vector<uint32_t> sizes;
467 };
468 
469 // stz2.
471  DECLARE_BOX_METHODS(CompactSampleSize);
472 
473  uint8_t field_size = 0u;
474  std::vector<uint32_t> sizes;
475 };
476 
477 // co64.
479  DECLARE_BOX_METHODS(ChunkLargeOffset);
480 
481  std::vector<uint64_t> offsets;
482 };
483 
484 // stco.
486  DECLARE_BOX_METHODS(ChunkOffset);
487 };
488 
489 // stss. Optional.
490 struct SyncSample : FullBox {
491  DECLARE_BOX_METHODS(SyncSample);
492 
493  std::vector<uint32_t> sample_number;
494 };
495 
497  bool ReadWrite(BoxBuffer* buffer);
498  uint32_t ComputeSize() const;
499 
500  uint8_t is_protected = 0u;
501  uint8_t per_sample_iv_size = 0u;
502  std::vector<uint8_t> key_id;
503 
504  // For pattern-based encryption.
505  uint8_t crypt_byte_block = 0u;
506  uint8_t skip_byte_block = 0u;
507 
508  // Present only if |is_protected == 1 && per_sample_iv_size == 0|.
509  std::vector<uint8_t> constant_iv;
510 };
511 
513  bool ReadWrite(BoxBuffer* buffer);
514  uint32_t ComputeSize() const;
515 
516  int16_t roll_distance = 0;
517 };
518 
520  DECLARE_BOX_METHODS(SampleGroupDescription);
521 
522  template <typename T>
523  bool ReadWriteEntries(BoxBuffer* buffer, std::vector<T>* entries);
524 
525  uint32_t grouping_type = 0;
526  // Only present if grouping_type == 'seig'.
527  std::vector<CencSampleEncryptionInfoEntry>
528  cenc_sample_encryption_info_entries;
529  // Only present if grouping_type == 'roll'.
530  std::vector<AudioRollRecoveryEntry> audio_roll_recovery_entries;
531 };
532 
534  enum GroupDescriptionIndexBase {
535  kTrackGroupDescriptionIndexBase = 0,
536  kTrackFragmentGroupDescriptionIndexBase = 0x10000,
537  };
538 
539  uint32_t sample_count = 0u;
540  uint32_t group_description_index = 0u;
541 };
542 
544  DECLARE_BOX_METHODS(SampleToGroup);
545 
546  uint32_t grouping_type = 0u;
547  uint32_t grouping_type_parameter = 0u; // Version 1 only.
548  std::vector<SampleToGroupEntry> entries;
549 };
550 
551 struct SampleTable : Box {
552  DECLARE_BOX_METHODS(SampleTable);
553 
554  SampleDescription description;
555  DecodingTimeToSample decoding_time_to_sample;
556  CompositionTimeToSample composition_time_to_sample;
557  SampleToChunk sample_to_chunk;
558  // Either SampleSize or CompactSampleSize must present. Store in SampleSize.
559  SampleSize sample_size;
560  // Either ChunkOffset or ChunkLargeOffset must present. Store in
561  // ChunkLargeOffset.
562  ChunkLargeOffset chunk_large_offset;
563  SyncSample sync_sample;
564  std::vector<SampleGroupDescription> sample_group_descriptions;
565  std::vector<SampleToGroup> sample_to_groups;
566 };
567 
569  DECLARE_BOX_METHODS(MediaHeader);
570 
571  uint64_t creation_time = 0u;
572  uint64_t modification_time = 0u;
573  uint32_t timescale = 0u;
574  uint64_t duration = 0u;
575  Language language;
576 };
577 
579  DECLARE_BOX_METHODS(VideoMediaHeader);
580 
581  uint16_t graphicsmode = 0u;
582  uint16_t opcolor_red = 0u;
583  uint16_t opcolor_green = 0u;
584  uint16_t opcolor_blue = 0u;
585 };
586 
588  DECLARE_BOX_METHODS(SoundMediaHeader);
589 
590  uint16_t balance = 0u;
591 };
592 
594  DECLARE_BOX_METHODS(SubtitleMediaHeader);
595 };
596 
598  DECLARE_BOX_METHODS(DataEntryUrl);
599 
600  std::vector<uint8_t> location;
601 };
602 
604  DECLARE_BOX_METHODS(DataReference);
605 
606  // Can be either url or urn box. Fix to url box for now.
607  std::vector<DataEntryUrl> data_entry = std::vector<DataEntryUrl>(1);
608 };
609 
611  DECLARE_BOX_METHODS(DataInformation);
612 
613  DataReference dref;
614 };
615 
617  DECLARE_BOX_METHODS(MediaInformation);
618 
619  DataInformation dinf;
620  SampleTable sample_table;
621  // Exactly one specific meida header shall be present, vmhd, smhd, hmhd, nmhd.
622  VideoMediaHeader vmhd;
623  SoundMediaHeader smhd;
624  SubtitleMediaHeader sthd;
625 };
626 
627 struct Media : Box {
628  DECLARE_BOX_METHODS(Media);
629 
630  MediaHeader header;
631  HandlerReference handler;
632  MediaInformation information;
633 };
634 
635 struct Track : Box {
636  DECLARE_BOX_METHODS(Track);
637 
638  TrackHeader header;
639  Media media;
640  Edit edit;
641  SampleEncryption sample_encryption;
642 };
643 
645  DECLARE_BOX_METHODS(MovieExtendsHeader);
646 
647  uint64_t fragment_duration = 0u;
648 };
649 
651  DECLARE_BOX_METHODS(TrackExtends);
652 
653  uint32_t track_id = 0u;
654  uint32_t default_sample_description_index = 0u;
655  uint32_t default_sample_duration = 0u;
656  uint32_t default_sample_size = 0u;
657  uint32_t default_sample_flags = 0u;
658 };
659 
660 struct MovieExtends : Box {
661  DECLARE_BOX_METHODS(MovieExtends);
662 
663  MovieExtendsHeader header;
664  std::vector<TrackExtends> tracks;
665 };
666 
667 struct Movie : Box {
668  DECLARE_BOX_METHODS(Movie);
669 
670  MovieHeader header;
671  Metadata metadata; // Used to hold version information.
672  MovieExtends extends;
673  std::vector<Track> tracks;
674  std::vector<ProtectionSystemSpecificHeader> pssh;
675 };
676 
678  DECLARE_BOX_METHODS(TrackFragmentDecodeTime);
679 
680  uint64_t decode_time = 0u;
681 };
682 
684  DECLARE_BOX_METHODS(MovieFragmentHeader);
685 
686  uint32_t sequence_number = 0u;
687 };
688 
690  enum TrackFragmentFlagsMasks {
691  kBaseDataOffsetPresentMask = 0x000001,
692  kSampleDescriptionIndexPresentMask = 0x000002,
693  kDefaultSampleDurationPresentMask = 0x000008,
694  kDefaultSampleSizePresentMask = 0x000010,
695  kDefaultSampleFlagsPresentMask = 0x000020,
696  kDurationIsEmptyMask = 0x010000,
697  kDefaultBaseIsMoofMask = 0x020000,
698  };
699 
700  enum SampleFlagsMasks {
701  kReservedMask = 0xFC000000,
702  kSampleDependsOnMask = 0x03000000,
703  kSampleIsDependedOnMask = 0x00C00000,
704  kSampleHasRedundancyMask = 0x00300000,
705  kSamplePaddingValueMask = 0x000E0000,
706  kNonKeySampleMask = 0x00010000,
707  kSampleDegradationPriorityMask = 0x0000FFFF,
708  };
709 
710  DECLARE_BOX_METHODS(TrackFragmentHeader);
711 
712  uint32_t track_id = 0u;
713  uint32_t sample_description_index = 0u;
714  uint32_t default_sample_duration = 0u;
715  uint32_t default_sample_size = 0u;
716  uint32_t default_sample_flags = 0u;
717 };
718 
720  enum TrackFragmentFlagsMasks {
721  kDataOffsetPresentMask = 0x000001,
722  kFirstSampleFlagsPresentMask = 0x000004,
723  kSampleDurationPresentMask = 0x000100,
724  kSampleSizePresentMask = 0x000200,
725  kSampleFlagsPresentMask = 0x000400,
726  kSampleCompTimeOffsetsPresentMask = 0x000800,
727  };
728 
729  DECLARE_BOX_METHODS(TrackFragmentRun);
730 
731  uint32_t sample_count = 0u;
732  uint32_t data_offset = 0u;
733  std::vector<uint32_t> sample_flags;
734  std::vector<uint32_t> sample_sizes;
735  std::vector<uint32_t> sample_durations;
736  std::vector<int64_t> sample_composition_time_offsets;
737 };
738 
739 struct TrackFragment : Box {
740  DECLARE_BOX_METHODS(TrackFragment);
741 
742  TrackFragmentHeader header;
743  std::vector<TrackFragmentRun> runs;
744  bool decode_time_absent = false;
745  TrackFragmentDecodeTime decode_time;
746  std::vector<SampleGroupDescription> sample_group_descriptions;
747  std::vector<SampleToGroup> sample_to_groups;
748  SampleAuxiliaryInformationSize auxiliary_size;
749  SampleAuxiliaryInformationOffset auxiliary_offset;
750  SampleEncryption sample_encryption;
751 };
752 
753 struct MovieFragment : Box {
754  DECLARE_BOX_METHODS(MovieFragment);
755 
756  MovieFragmentHeader header;
757  std::vector<TrackFragment> tracks;
758  std::vector<ProtectionSystemSpecificHeader> pssh;
759 };
760 
762  enum SAPType {
763  TypeUnknown = 0,
764  Type1 = 1, // T(ept) = T(dec) = T(sap) = T(ptf)
765  Type2 = 2, // T(ept) = T(dec) = T(sap) < T(ptf)
766  Type3 = 3, // T(ept) < T(dec) = T(sap) <= T(ptf)
767  Type4 = 4, // T(ept) <= T(ptf) < T(dec) = T(sap)
768  Type5 = 5, // T(ept) = T(dec) < T(sap)
769  Type6 = 6, // T(ept) < T(dec) < T(sap)
770  };
771 
772  bool reference_type = false;
773  uint32_t referenced_size = 0u;
774  uint32_t subsegment_duration = 0u;
775  bool starts_with_sap = false;
776  SAPType sap_type = TypeUnknown;
777  uint32_t sap_delta_time = 0u;
778  // We add this field to keep track of earliest_presentation_time in this
779  // subsegment. It is not part of SegmentReference.
780  uint64_t earliest_presentation_time = 0u;
781 };
782 
784  DECLARE_BOX_METHODS(SegmentIndex);
785 
786  uint32_t reference_id = 0u;
787  uint32_t timescale = 0u;
788  uint64_t earliest_presentation_time = 0u;
789  uint64_t first_offset = 0u;
790  std::vector<SegmentReference> references;
791 };
792 
793 // The actual data is parsed and written separately.
794 struct MediaData : Box {
795  DECLARE_BOX_METHODS(MediaData);
796 
797  uint32_t data_size = 0u;
798 };
799 
800 // Using negative value as "not set". It is very unlikely that 2^31 cues happen
801 // at once.
802 const int kCueSourceIdNotSet = -1;
803 
804 struct CueSourceIDBox : Box {
805  DECLARE_BOX_METHODS(CueSourceIDBox);
806 
807  int32_t source_id = kCueSourceIdNotSet;
808 };
809 
810 struct CueTimeBox : Box {
811  DECLARE_BOX_METHODS(CueTimeBox);
812 
813  std::string cue_current_time;
814 };
815 
816 struct CueIDBox : Box {
817  DECLARE_BOX_METHODS(CueIDBox);
818 
819  std::string cue_id;
820 };
821 
822 struct CueSettingsBox : Box {
823  DECLARE_BOX_METHODS(CueSettingsBox);
824 
825  std::string settings;
826 };
827 
828 struct CuePayloadBox : Box {
829  DECLARE_BOX_METHODS(CuePayloadBox);
830 
831  std::string cue_text;
832 };
833 
834 struct VTTEmptyCueBox : Box {
835  DECLARE_BOX_METHODS(VTTEmptyCueBox);
836 };
837 
839  DECLARE_BOX_METHODS(VTTAdditionalTextBox);
840 
841  std::string cue_additional_text;
842 };
843 
844 struct VTTCueBox : Box {
845  DECLARE_BOX_METHODS(VTTCueBox);
846 
847  CueSourceIDBox cue_source_id;
848  CueIDBox cue_id;
849  CueTimeBox cue_time;
850  CueSettingsBox cue_settings;
851  CuePayloadBox cue_payload;
852 };
853 
854 #undef DECLARE_BOX
855 
856 } // namespace mp4
857 } // namespace media
858 } // namespace shaka
859 
860 #endif // PACKAGER_MEDIA_FORMATS_MP4_BOX_DEFINITIONS_H_
All the methods that are virtual are virtual for mocking.
uint32_t ComputeSize()
Definition: box.cc:50
std::vector< uint8_t > sample_encryption_data
Implemented per http://mp4ra.org/#/references.
FourCC BoxType() const override