media_types.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2018 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_BASE_MEDIA_TYPES_H_
  5. #define MEDIA_BASE_MEDIA_TYPES_H_
  6. #include "media/base/audio_codecs.h"
  7. #include "media/base/audio_decoder_config.h"
  8. #include "media/base/media_export.h"
  9. #include "media/base/video_codecs.h"
  10. #include "media/base/video_color_space.h"
  11. #include "media/base/video_decoder_config.h"
  12. namespace media {
  13. // These structures represent parsed audio/video content types (mime strings).
  14. // These are generally a subset of {Audio|Video}DecoderConfig classes, which can
  15. // only be created after demuxing.
  16. struct MEDIA_EXPORT AudioType {
  17. static AudioType FromDecoderConfig(const AudioDecoderConfig& config);
  18. AudioCodec codec;
  19. AudioCodecProfile profile;
  20. bool spatial_rendering;
  21. };
  22. struct MEDIA_EXPORT VideoType {
  23. static VideoType FromDecoderConfig(const VideoDecoderConfig& config);
  24. VideoCodec codec;
  25. VideoCodecProfile profile;
  26. int level;
  27. VideoColorSpace color_space;
  28. gfx::HdrMetadataType hdr_metadata_type;
  29. };
  30. MEDIA_EXPORT bool operator==(const AudioType& x, const AudioType& y);
  31. MEDIA_EXPORT bool operator!=(const AudioType& x, const AudioType& y);
  32. MEDIA_EXPORT bool operator==(const VideoType& x, const VideoType& y);
  33. MEDIA_EXPORT bool operator!=(const VideoType& x, const VideoType& y);
  34. } // namespace media
  35. #endif // MEDIA_BASE_MEDIA_TYPES_H_