OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MEDIA_FORMATS_MP4_BOX_DEFINITIONS_H_ | 5 #ifndef MEDIA_FORMATS_MP4_BOX_DEFINITIONS_H_ |
6 #define MEDIA_FORMATS_MP4_BOX_DEFINITIONS_H_ | 6 #define MEDIA_FORMATS_MP4_BOX_DEFINITIONS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 | 348 |
349 // Returns the SampleDependsOn value for the |i|'th value | 349 // Returns the SampleDependsOn value for the |i|'th value |
350 // in the track. If no data was parsed for the |i|'th sample, | 350 // in the track. If no data was parsed for the |i|'th sample, |
351 // then |kSampleDependsOnUnknown| is returned. | 351 // then |kSampleDependsOnUnknown| is returned. |
352 SampleDependsOn sample_depends_on(size_t i) const; | 352 SampleDependsOn sample_depends_on(size_t i) const; |
353 | 353 |
354 private: | 354 private: |
355 std::vector<SampleDependsOn> sample_depends_on_; | 355 std::vector<SampleDependsOn> sample_depends_on_; |
356 }; | 356 }; |
357 | 357 |
| 358 struct MEDIA_EXPORT CencSampleEncryptionInfoEntry { |
| 359 CencSampleEncryptionInfoEntry(); |
| 360 ~CencSampleEncryptionInfoEntry(); |
| 361 |
| 362 bool is_encrypted; |
| 363 uint8 iv_size; |
| 364 std::vector<uint8> key_id; |
| 365 }; |
| 366 |
| 367 struct MEDIA_EXPORT SampleGroupDescription : Box { // 'sgpd'. |
| 368 DECLARE_BOX_METHODS(SampleGroupDescription); |
| 369 |
| 370 uint32 grouping_type; |
| 371 std::vector<CencSampleEncryptionInfoEntry> entries; |
| 372 }; |
| 373 |
| 374 struct MEDIA_EXPORT SampleToGroupEntry { |
| 375 enum GroupDescriptionIndexBase { |
| 376 kTrackGroupDescriptionIndexBase = 0, |
| 377 kFragmentGroupDescriptionIndexBase = 0x10000, |
| 378 }; |
| 379 |
| 380 uint32 sample_count; |
| 381 uint32 group_description_index; |
| 382 }; |
| 383 |
| 384 struct MEDIA_EXPORT SampleToGroup : Box { // 'sbgp'. |
| 385 DECLARE_BOX_METHODS(SampleToGroup); |
| 386 |
| 387 uint32 grouping_type; |
| 388 uint32 grouping_type_parameter; // Version 1 only. |
| 389 std::vector<SampleToGroupEntry> entries; |
| 390 }; |
| 391 |
358 struct MEDIA_EXPORT TrackFragment : Box { | 392 struct MEDIA_EXPORT TrackFragment : Box { |
359 DECLARE_BOX_METHODS(TrackFragment); | 393 DECLARE_BOX_METHODS(TrackFragment); |
360 | 394 |
361 TrackFragmentHeader header; | 395 TrackFragmentHeader header; |
362 std::vector<TrackFragmentRun> runs; | 396 std::vector<TrackFragmentRun> runs; |
363 TrackFragmentDecodeTime decode_time; | 397 TrackFragmentDecodeTime decode_time; |
364 SampleAuxiliaryInformationOffset auxiliary_offset; | 398 SampleAuxiliaryInformationOffset auxiliary_offset; |
365 SampleAuxiliaryInformationSize auxiliary_size; | 399 SampleAuxiliaryInformationSize auxiliary_size; |
366 IndependentAndDisposableSamples sdtp; | 400 IndependentAndDisposableSamples sdtp; |
| 401 SampleGroupDescription sample_group_description; |
| 402 SampleToGroup sample_to_group; |
367 }; | 403 }; |
368 | 404 |
369 struct MEDIA_EXPORT MovieFragment : Box { | 405 struct MEDIA_EXPORT MovieFragment : Box { |
370 DECLARE_BOX_METHODS(MovieFragment); | 406 DECLARE_BOX_METHODS(MovieFragment); |
371 | 407 |
372 MovieFragmentHeader header; | 408 MovieFragmentHeader header; |
373 std::vector<TrackFragment> tracks; | 409 std::vector<TrackFragment> tracks; |
374 std::vector<ProtectionSystemSpecificHeader> pssh; | 410 std::vector<ProtectionSystemSpecificHeader> pssh; |
375 }; | 411 }; |
376 | 412 |
377 #undef DECLARE_BOX | 413 #undef DECLARE_BOX |
378 | 414 |
379 } // namespace mp4 | 415 } // namespace mp4 |
380 } // namespace media | 416 } // namespace media |
381 | 417 |
382 #endif // MEDIA_FORMATS_MP4_BOX_DEFINITIONS_H_ | 418 #endif // MEDIA_FORMATS_MP4_BOX_DEFINITIONS_H_ |
OLD | NEW |