dolby_vision.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. // Copyright 2017 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. #ifndef MEDIA_FORMATS_MP4_DOLBY_VISION_H_
  5. #define MEDIA_FORMATS_MP4_DOLBY_VISION_H_
  6. #include "base/memory/ref_counted.h"
  7. #include "media/base/media_export.h"
  8. #include "media/formats/mp4/box_definitions.h"
  9. namespace media {
  10. namespace mp4 {
  11. struct MEDIA_EXPORT DOVIDecoderConfigurationRecord {
  12. uint8_t dv_version_major = 0;
  13. uint8_t dv_version_minor = 0;
  14. uint8_t dv_profile = 0;
  15. uint8_t dv_level = 0;
  16. uint8_t rpu_present_flag = 0;
  17. uint8_t el_present_flag = 0;
  18. uint8_t bl_present_flag = 0;
  19. VideoCodecProfile codec_profile = VIDEO_CODEC_PROFILE_UNKNOWN;
  20. bool Parse(BufferReader* reader, MediaLog* media_log);
  21. // Parses DolbyVisionConfiguration data encoded in |data|.
  22. // Note: This method is intended to parse data outside the MP4StreamParser
  23. // context and therefore the box header is not expected to be present
  24. // in |data|.
  25. // Returns true if |data| was successfully parsed.
  26. bool ParseForTesting(const uint8_t* data, int data_size);
  27. };
  28. // The structures of the configuration is defined in Dolby Streams Within the
  29. // ISO Base Media File Format v2.0 section 3.1.
  30. // dvcC, used for profile 7 and earlier.
  31. struct MEDIA_EXPORT DolbyVisionConfiguration : Box {
  32. DECLARE_BOX_METHODS(DolbyVisionConfiguration);
  33. DOVIDecoderConfigurationRecord dovi_config;
  34. };
  35. // dvvC, used for profile 8 and later.
  36. struct MEDIA_EXPORT DolbyVisionConfiguration8 : Box {
  37. DECLARE_BOX_METHODS(DolbyVisionConfiguration8);
  38. DOVIDecoderConfigurationRecord dovi_config;
  39. };
  40. } // namespace mp4
  41. } // namespace media
  42. #endif // MEDIA_FORMATS_MP4_DOLBY_VISION_H_