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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 | 358 |
359 // Returns the SampleDependsOn value for the |i|'th value | 359 // Returns the SampleDependsOn value for the |i|'th value |
360 // in the track. If no data was parsed for the |i|'th sample, | 360 // in the track. If no data was parsed for the |i|'th sample, |
361 // then |kSampleDependsOnUnknown| is returned. | 361 // then |kSampleDependsOnUnknown| is returned. |
362 SampleDependsOn sample_depends_on(size_t i) const; | 362 SampleDependsOn sample_depends_on(size_t i) const; |
363 | 363 |
364 private: | 364 private: |
365 std::vector<SampleDependsOn> sample_depends_on_; | 365 std::vector<SampleDependsOn> sample_depends_on_; |
366 }; | 366 }; |
367 | 367 |
| 368 struct MEDIA_EXPORT CencSampleEncryptionInfoEntry { |
| 369 CencSampleEncryptionInfoEntry(); |
| 370 ~CencSampleEncryptionInfoEntry(); |
| 371 |
| 372 bool is_encrypted; |
| 373 uint8 iv_size; |
| 374 std::vector<uint8> key_id; |
| 375 }; |
| 376 |
| 377 struct MEDIA_EXPORT SampleGroupDescription : Box { // 'sgpd'. |
| 378 DECLARE_BOX_METHODS(SampleGroupDescription); |
| 379 |
| 380 uint32 grouping_type; |
| 381 std::vector<CencSampleEncryptionInfoEntry> entries; |
| 382 }; |
| 383 |
| 384 struct MEDIA_EXPORT SampleToGroupEntry { |
| 385 enum GroupDescriptionIndexBase { |
| 386 kTrackGroupDescriptionIndexBase = 0, |
| 387 kFragmentGroupDescriptionIndexBase = 0x10000, |
| 388 }; |
| 389 |
| 390 uint32 sample_count; |
| 391 uint32 group_description_index; |
| 392 }; |
| 393 |
| 394 struct MEDIA_EXPORT SampleToGroup : Box { // 'sbgp'. |
| 395 DECLARE_BOX_METHODS(SampleToGroup); |
| 396 |
| 397 uint32 grouping_type; |
| 398 uint32 grouping_type_parameter; // Version 1 only. |
| 399 std::vector<SampleToGroupEntry> entries; |
| 400 }; |
| 401 |
368 struct MEDIA_EXPORT TrackFragment : Box { | 402 struct MEDIA_EXPORT TrackFragment : Box { |
369 DECLARE_BOX_METHODS(TrackFragment); | 403 DECLARE_BOX_METHODS(TrackFragment); |
370 | 404 |
371 TrackFragmentHeader header; | 405 TrackFragmentHeader header; |
372 std::vector<TrackFragmentRun> runs; | 406 std::vector<TrackFragmentRun> runs; |
373 TrackFragmentDecodeTime decode_time; | 407 TrackFragmentDecodeTime decode_time; |
374 SampleAuxiliaryInformationOffset auxiliary_offset; | 408 SampleAuxiliaryInformationOffset auxiliary_offset; |
375 SampleAuxiliaryInformationSize auxiliary_size; | 409 SampleAuxiliaryInformationSize auxiliary_size; |
376 IndependentAndDisposableSamples sdtp; | 410 IndependentAndDisposableSamples sdtp; |
| 411 SampleGroupDescription sample_group_description; |
| 412 SampleToGroup sample_to_group; |
377 }; | 413 }; |
378 | 414 |
379 struct MEDIA_EXPORT MovieFragment : Box { | 415 struct MEDIA_EXPORT MovieFragment : Box { |
380 DECLARE_BOX_METHODS(MovieFragment); | 416 DECLARE_BOX_METHODS(MovieFragment); |
381 | 417 |
382 MovieFragmentHeader header; | 418 MovieFragmentHeader header; |
383 std::vector<TrackFragment> tracks; | 419 std::vector<TrackFragment> tracks; |
384 std::vector<ProtectionSystemSpecificHeader> pssh; | 420 std::vector<ProtectionSystemSpecificHeader> pssh; |
385 }; | 421 }; |
386 | 422 |
387 #undef DECLARE_BOX | 423 #undef DECLARE_BOX |
388 | 424 |
389 } // namespace mp4 | 425 } // namespace mp4 |
390 } // namespace media | 426 } // namespace media |
391 | 427 |
392 #endif // MEDIA_FORMATS_MP4_BOX_DEFINITIONS_H_ | 428 #endif // MEDIA_FORMATS_MP4_BOX_DEFINITIONS_H_ |
OLD | NEW |