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  FourCC format = FOURCC_NULL;
288  // data_reference_index is 1-based and "dref" box is mandatory so it is
289  // always present.
290  uint16_t data_reference_index = 1u;
291  uint16_t width = 0u;
292  uint16_t height = 0u;
293 
294  PixelAspectRatio pixel_aspect;
296  CodecConfiguration codec_configuration;
297 };
298 
300  DECLARE_BOX_METHODS(ElementaryStreamDescriptor);
301 
302  AACAudioSpecificConfig aac_audio_specific_config;
303  ESDescriptor es_descriptor;
304 };
305 
306 struct DTSSpecific : Box {
307  DECLARE_BOX_METHODS(DTSSpecific);
308 
309  uint32_t sampling_frequency = 0u;
310  uint32_t max_bitrate = 0u;
311  uint32_t avg_bitrate = 0u;
312  uint8_t pcm_sample_depth = 0u;
313  std::vector<uint8_t> extra_data;
314 };
315 
316 struct AC3Specific : Box {
317  DECLARE_BOX_METHODS(AC3Specific);
318 
319  std::vector<uint8_t> data;
320 };
321 
322 struct EC3Specific : Box {
323  DECLARE_BOX_METHODS(EC3Specific);
324 
325  std::vector<uint8_t> data;
326 };
327 
328 struct OpusSpecific : Box {
329  DECLARE_BOX_METHODS(OpusSpecific);
330 
331  std::vector<uint8_t> opus_identification_header;
332  // The number of priming samples. Extracted from |opus_identification_header|.
333  uint16_t preskip = 0u;
334 };
335 
336 // FLAC specific decoder configuration box:
337 // https://github.com/xiph/flac/blob/master/doc/isoflac.txt
338 // We do not care about the actual data inside, which is simply copied over.
340  DECLARE_BOX_METHODS(FlacSpecific);
341 
342  std::vector<uint8_t> data;
343 };
344 
346  DECLARE_BOX_METHODS(AudioSampleEntry);
347 
348  // Returns actual format of this sample entry.
349  FourCC GetActualFormat() const {
350  return format == FOURCC_enca ? sinf.format.format : format;
351  }
352 
353  FourCC format = FOURCC_NULL;
354  // data_reference_index is 1-based and "dref" box is mandatory so it is
355  // always present.
356  uint16_t data_reference_index = 1u;
357  uint16_t channelcount = 2u;
358  uint16_t samplesize = 16u;
359  uint32_t samplerate = 0u;
360 
362 
364  DTSSpecific ddts;
365  AC3Specific dac3;
366  EC3Specific dec3;
367  OpusSpecific dops;
368  FlacSpecific dfla;
369 };
370 
372  DECLARE_BOX_METHODS(WebVTTConfigurationBox);
373 
374  std::string config;
375 };
376 
378  DECLARE_BOX_METHODS(WebVTTSourceLabelBox);
379 
380  std::string source_label;
381 };
382 
384  DECLARE_BOX_METHODS(TextSampleEntry);
385 
386  // Specifies fourcc of this sample entry. It needs to be set on write, e.g.
387  // set to 'wvtt' to write WVTTSampleEntry; On read, it is recovered from box
388  // header.
389  FourCC format = FOURCC_NULL;
390 
391  // data_reference_index is 1-based and "dref" box is mandatory so it is
392  // always present.
393  uint16_t data_reference_index = 1u;
394 
395  // Sub boxes for wvtt text sample entry.
396  WebVTTConfigurationBox config;
397  WebVTTSourceLabelBox label;
398  // Optional MPEG4BitRateBox.
399 };
400 
402  DECLARE_BOX_METHODS(SampleDescription);
403 
404  TrackType type = kInvalid;
405  // TODO(kqyang): Clean up the code to have one single member, e.g. by creating
406  // SampleEntry struct, std::vector<SampleEntry> sample_entries.
407  std::vector<VideoSampleEntry> video_entries;
408  std::vector<AudioSampleEntry> audio_entries;
409  std::vector<TextSampleEntry> text_entries;
410 };
411 
412 struct DecodingTime {
413  uint32_t sample_count;
414  uint32_t sample_delta;
415 };
416 
417 // stts.
419  DECLARE_BOX_METHODS(DecodingTimeToSample);
420 
421  std::vector<DecodingTime> decoding_time;
422 };
423 
425  uint32_t sample_count;
426  // If version == 0, sample_offset is uint32_t;
427  // If version == 1, sample_offset is int32_t.
428  // Use int64_t so both can be supported properly.
429  int64_t sample_offset;
430 };
431 
432 // ctts. Optional.
434  DECLARE_BOX_METHODS(CompositionTimeToSample);
435 
436  std::vector<CompositionOffset> composition_offset;
437 };
438 
439 struct ChunkInfo {
440  uint32_t first_chunk;
441  uint32_t samples_per_chunk;
442  uint32_t sample_description_index;
443 };
444 
445 // stsc.
447  DECLARE_BOX_METHODS(SampleToChunk);
448 
449  std::vector<ChunkInfo> chunk_info;
450 };
451 
452 // stsz.
453 struct SampleSize : FullBox {
454  DECLARE_BOX_METHODS(SampleSize);
455 
456  uint32_t sample_size = 0u;
457  uint32_t sample_count = 0u;
458  std::vector<uint32_t> sizes;
459 };
460 
461 // stz2.
463  DECLARE_BOX_METHODS(CompactSampleSize);
464 
465  uint8_t field_size = 0u;
466  std::vector<uint32_t> sizes;
467 };
468 
469 // co64.
471  DECLARE_BOX_METHODS(ChunkLargeOffset);
472 
473  std::vector<uint64_t> offsets;
474 };
475 
476 // stco.
478  DECLARE_BOX_METHODS(ChunkOffset);
479 };
480 
481 // stss. Optional.
482 struct SyncSample : FullBox {
483  DECLARE_BOX_METHODS(SyncSample);
484 
485  std::vector<uint32_t> sample_number;
486 };
487 
489  bool ReadWrite(BoxBuffer* buffer);
490  uint32_t ComputeSize() const;
491 
492  uint8_t is_protected = 0u;
493  uint8_t per_sample_iv_size = 0u;
494  std::vector<uint8_t> key_id;
495 
496  // For pattern-based encryption.
497  uint8_t crypt_byte_block = 0u;
498  uint8_t skip_byte_block = 0u;
499 
500  // Present only if |is_protected == 1 && per_sample_iv_size == 0|.
501  std::vector<uint8_t> constant_iv;
502 };
503 
505  bool ReadWrite(BoxBuffer* buffer);
506  uint32_t ComputeSize() const;
507 
508  int16_t roll_distance = 0;
509 };
510 
512  DECLARE_BOX_METHODS(SampleGroupDescription);
513 
514  template <typename T>
515  bool ReadWriteEntries(BoxBuffer* buffer, std::vector<T>* entries);
516 
517  uint32_t grouping_type = 0;
518  // Only present if grouping_type == 'seig'.
519  std::vector<CencSampleEncryptionInfoEntry>
520  cenc_sample_encryption_info_entries;
521  // Only present if grouping_type == 'roll'.
522  std::vector<AudioRollRecoveryEntry> audio_roll_recovery_entries;
523 };
524 
526  enum GroupDescriptionIndexBase {
527  kTrackGroupDescriptionIndexBase = 0,
528  kTrackFragmentGroupDescriptionIndexBase = 0x10000,
529  };
530 
531  uint32_t sample_count = 0u;
532  uint32_t group_description_index = 0u;
533 };
534 
536  DECLARE_BOX_METHODS(SampleToGroup);
537 
538  uint32_t grouping_type = 0u;
539  uint32_t grouping_type_parameter = 0u; // Version 1 only.
540  std::vector<SampleToGroupEntry> entries;
541 };
542 
543 struct SampleTable : Box {
544  DECLARE_BOX_METHODS(SampleTable);
545 
546  SampleDescription description;
547  DecodingTimeToSample decoding_time_to_sample;
548  CompositionTimeToSample composition_time_to_sample;
549  SampleToChunk sample_to_chunk;
550  // Either SampleSize or CompactSampleSize must present. Store in SampleSize.
551  SampleSize sample_size;
552  // Either ChunkOffset or ChunkLargeOffset must present. Store in
553  // ChunkLargeOffset.
554  ChunkLargeOffset chunk_large_offset;
555  SyncSample sync_sample;
556  std::vector<SampleGroupDescription> sample_group_descriptions;
557  std::vector<SampleToGroup> sample_to_groups;
558 };
559 
561  DECLARE_BOX_METHODS(MediaHeader);
562 
563  uint64_t creation_time = 0u;
564  uint64_t modification_time = 0u;
565  uint32_t timescale = 0u;
566  uint64_t duration = 0u;
567  Language language;
568 };
569 
571  DECLARE_BOX_METHODS(VideoMediaHeader);
572 
573  uint16_t graphicsmode = 0u;
574  uint16_t opcolor_red = 0u;
575  uint16_t opcolor_green = 0u;
576  uint16_t opcolor_blue = 0u;
577 };
578 
580  DECLARE_BOX_METHODS(SoundMediaHeader);
581 
582  uint16_t balance = 0u;
583 };
584 
586  DECLARE_BOX_METHODS(SubtitleMediaHeader);
587 };
588 
590  DECLARE_BOX_METHODS(DataEntryUrl);
591 
592  std::vector<uint8_t> location;
593 };
594 
596  DECLARE_BOX_METHODS(DataReference);
597 
598  // Can be either url or urn box. Fix to url box for now.
599  std::vector<DataEntryUrl> data_entry = std::vector<DataEntryUrl>(1);
600 };
601 
603  DECLARE_BOX_METHODS(DataInformation);
604 
605  DataReference dref;
606 };
607 
609  DECLARE_BOX_METHODS(MediaInformation);
610 
611  DataInformation dinf;
612  SampleTable sample_table;
613  // Exactly one specific meida header shall be present, vmhd, smhd, hmhd, nmhd.
614  VideoMediaHeader vmhd;
615  SoundMediaHeader smhd;
616  SubtitleMediaHeader sthd;
617 };
618 
619 struct Media : Box {
620  DECLARE_BOX_METHODS(Media);
621 
622  MediaHeader header;
623  HandlerReference handler;
624  MediaInformation information;
625 };
626 
627 struct Track : Box {
628  DECLARE_BOX_METHODS(Track);
629 
630  TrackHeader header;
631  Media media;
632  Edit edit;
633  SampleEncryption sample_encryption;
634 };
635 
637  DECLARE_BOX_METHODS(MovieExtendsHeader);
638 
639  uint64_t fragment_duration = 0u;
640 };
641 
643  DECLARE_BOX_METHODS(TrackExtends);
644 
645  uint32_t track_id = 0u;
646  uint32_t default_sample_description_index = 0u;
647  uint32_t default_sample_duration = 0u;
648  uint32_t default_sample_size = 0u;
649  uint32_t default_sample_flags = 0u;
650 };
651 
652 struct MovieExtends : Box {
653  DECLARE_BOX_METHODS(MovieExtends);
654 
655  MovieExtendsHeader header;
656  std::vector<TrackExtends> tracks;
657 };
658 
659 struct Movie : Box {
660  DECLARE_BOX_METHODS(Movie);
661 
662  MovieHeader header;
663  Metadata metadata; // Used to hold version information.
664  MovieExtends extends;
665  std::vector<Track> tracks;
666  std::vector<ProtectionSystemSpecificHeader> pssh;
667 };
668 
670  DECLARE_BOX_METHODS(TrackFragmentDecodeTime);
671 
672  uint64_t decode_time = 0u;
673 };
674 
676  DECLARE_BOX_METHODS(MovieFragmentHeader);
677 
678  uint32_t sequence_number = 0u;
679 };
680 
682  enum TrackFragmentFlagsMasks {
683  kBaseDataOffsetPresentMask = 0x000001,
684  kSampleDescriptionIndexPresentMask = 0x000002,
685  kDefaultSampleDurationPresentMask = 0x000008,
686  kDefaultSampleSizePresentMask = 0x000010,
687  kDefaultSampleFlagsPresentMask = 0x000020,
688  kDurationIsEmptyMask = 0x010000,
689  kDefaultBaseIsMoofMask = 0x020000,
690  };
691 
692  enum SampleFlagsMasks {
693  kReservedMask = 0xFC000000,
694  kSampleDependsOnMask = 0x03000000,
695  kSampleIsDependedOnMask = 0x00C00000,
696  kSampleHasRedundancyMask = 0x00300000,
697  kSamplePaddingValueMask = 0x000E0000,
698  kNonKeySampleMask = 0x00010000,
699  kSampleDegradationPriorityMask = 0x0000FFFF,
700  };
701 
702  DECLARE_BOX_METHODS(TrackFragmentHeader);
703 
704  uint32_t track_id = 0u;
705  uint32_t sample_description_index = 0u;
706  uint32_t default_sample_duration = 0u;
707  uint32_t default_sample_size = 0u;
708  uint32_t default_sample_flags = 0u;
709 };
710 
712  enum TrackFragmentFlagsMasks {
713  kDataOffsetPresentMask = 0x000001,
714  kFirstSampleFlagsPresentMask = 0x000004,
715  kSampleDurationPresentMask = 0x000100,
716  kSampleSizePresentMask = 0x000200,
717  kSampleFlagsPresentMask = 0x000400,
718  kSampleCompTimeOffsetsPresentMask = 0x000800,
719  };
720 
721  DECLARE_BOX_METHODS(TrackFragmentRun);
722 
723  uint32_t sample_count = 0u;
724  uint32_t data_offset = 0u;
725  std::vector<uint32_t> sample_flags;
726  std::vector<uint32_t> sample_sizes;
727  std::vector<uint32_t> sample_durations;
728  std::vector<int64_t> sample_composition_time_offsets;
729 };
730 
731 struct TrackFragment : Box {
732  DECLARE_BOX_METHODS(TrackFragment);
733 
734  TrackFragmentHeader header;
735  std::vector<TrackFragmentRun> runs;
736  bool decode_time_absent = false;
737  TrackFragmentDecodeTime decode_time;
738  std::vector<SampleGroupDescription> sample_group_descriptions;
739  std::vector<SampleToGroup> sample_to_groups;
740  SampleAuxiliaryInformationSize auxiliary_size;
741  SampleAuxiliaryInformationOffset auxiliary_offset;
742  SampleEncryption sample_encryption;
743 };
744 
745 struct MovieFragment : Box {
746  DECLARE_BOX_METHODS(MovieFragment);
747 
748  MovieFragmentHeader header;
749  std::vector<TrackFragment> tracks;
750  std::vector<ProtectionSystemSpecificHeader> pssh;
751 };
752 
754  enum SAPType {
755  TypeUnknown = 0,
756  Type1 = 1, // T(ept) = T(dec) = T(sap) = T(ptf)
757  Type2 = 2, // T(ept) = T(dec) = T(sap) < T(ptf)
758  Type3 = 3, // T(ept) < T(dec) = T(sap) <= T(ptf)
759  Type4 = 4, // T(ept) <= T(ptf) < T(dec) = T(sap)
760  Type5 = 5, // T(ept) = T(dec) < T(sap)
761  Type6 = 6, // T(ept) < T(dec) < T(sap)
762  };
763 
764  bool reference_type = false;
765  uint32_t referenced_size = 0u;
766  uint32_t subsegment_duration = 0u;
767  bool starts_with_sap = false;
768  SAPType sap_type = TypeUnknown;
769  uint32_t sap_delta_time = 0u;
770  // We add this field to keep track of earliest_presentation_time in this
771  // subsegment. It is not part of SegmentReference.
772  uint64_t earliest_presentation_time = 0u;
773 };
774 
776  DECLARE_BOX_METHODS(SegmentIndex);
777 
778  uint32_t reference_id = 0u;
779  uint32_t timescale = 0u;
780  uint64_t earliest_presentation_time = 0u;
781  uint64_t first_offset = 0u;
782  std::vector<SegmentReference> references;
783 };
784 
785 // The actual data is parsed and written separately.
786 struct MediaData : Box {
787  DECLARE_BOX_METHODS(MediaData);
788 
789  uint32_t data_size = 0u;
790 };
791 
792 // Using negative value as "not set". It is very unlikely that 2^31 cues happen
793 // at once.
794 const int kCueSourceIdNotSet = -1;
795 
796 struct CueSourceIDBox : Box {
797  DECLARE_BOX_METHODS(CueSourceIDBox);
798 
799  int32_t source_id = kCueSourceIdNotSet;
800 };
801 
802 struct CueTimeBox : Box {
803  DECLARE_BOX_METHODS(CueTimeBox);
804 
805  std::string cue_current_time;
806 };
807 
808 struct CueIDBox : Box {
809  DECLARE_BOX_METHODS(CueIDBox);
810 
811  std::string cue_id;
812 };
813 
814 struct CueSettingsBox : Box {
815  DECLARE_BOX_METHODS(CueSettingsBox);
816 
817  std::string settings;
818 };
819 
820 struct CuePayloadBox : Box {
821  DECLARE_BOX_METHODS(CuePayloadBox);
822 
823  std::string cue_text;
824 };
825 
826 struct VTTEmptyCueBox : Box {
827  DECLARE_BOX_METHODS(VTTEmptyCueBox);
828 };
829 
831  DECLARE_BOX_METHODS(VTTAdditionalTextBox);
832 
833  std::string cue_additional_text;
834 };
835 
836 struct VTTCueBox : Box {
837  DECLARE_BOX_METHODS(VTTCueBox);
838 
839  CueSourceIDBox cue_source_id;
840  CueIDBox cue_id;
841  CueTimeBox cue_time;
842  CueSettingsBox cue_settings;
843  CuePayloadBox cue_payload;
844 };
845 
846 #undef DECLARE_BOX
847 
848 } // namespace mp4
849 } // namespace media
850 } // namespace shaka
851 
852 #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