Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_BASE_VIDEO_DECODER_CONFIG_H_ | 5 #ifndef MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ |
| 6 #define MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ | 6 #define MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "base/optional.h" | |
| 14 #include "media/base/encryption_scheme.h" | 15 #include "media/base/encryption_scheme.h" |
| 16 #include "media/base/hdr_metadata.h" | |
| 15 #include "media/base/media_export.h" | 17 #include "media/base/media_export.h" |
| 16 #include "media/base/video_codecs.h" | 18 #include "media/base/video_codecs.h" |
| 17 #include "media/base/video_types.h" | 19 #include "media/base/video_types.h" |
| 20 #include "ui/gfx/color_space.h" | |
| 18 #include "ui/gfx/geometry/rect.h" | 21 #include "ui/gfx/geometry/rect.h" |
| 19 #include "ui/gfx/geometry/size.h" | 22 #include "ui/gfx/geometry/size.h" |
| 20 | 23 |
| 21 namespace media { | 24 namespace media { |
| 22 | 25 |
| 23 MEDIA_EXPORT VideoCodec | 26 MEDIA_EXPORT VideoCodec |
| 24 VideoCodecProfileToVideoCodec(VideoCodecProfile profile); | 27 VideoCodecProfileToVideoCodec(VideoCodecProfile profile); |
| 25 | 28 |
| 26 class MEDIA_EXPORT VideoDecoderConfig { | 29 class MEDIA_EXPORT VideoDecoderConfig { |
| 27 public: | 30 public: |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 88 gfx::Size coded_size() const { return coded_size_; } | 91 gfx::Size coded_size() const { return coded_size_; } |
| 89 | 92 |
| 90 // Region of |coded_size_| that is visible. | 93 // Region of |coded_size_| that is visible. |
| 91 gfx::Rect visible_rect() const { return visible_rect_; } | 94 gfx::Rect visible_rect() const { return visible_rect_; } |
| 92 | 95 |
| 93 // Final visible width and height of a video frame with aspect ratio taken | 96 // Final visible width and height of a video frame with aspect ratio taken |
| 94 // into account. | 97 // into account. |
| 95 gfx::Size natural_size() const { return natural_size_; } | 98 gfx::Size natural_size() const { return natural_size_; } |
| 96 | 99 |
| 97 // Optional byte data required to initialize video decoders, such as H.264 | 100 // Optional byte data required to initialize video decoders, such as H.264 |
| 98 // AAVC data. | 101 // AVCC data. |
| 99 const std::vector<uint8_t>& extra_data() const { return extra_data_; } | 102 const std::vector<uint8_t>& extra_data() const { return extra_data_; } |
| 100 | 103 |
| 101 // Whether the video stream is potentially encrypted. | 104 // Whether the video stream is potentially encrypted. |
| 102 // Note that in a potentially encrypted video stream, individual buffers | 105 // Note that in a potentially encrypted video stream, individual buffers |
| 103 // can be encrypted or not encrypted. | 106 // can be encrypted or not encrypted. |
| 104 bool is_encrypted() const { return encryption_scheme_.is_encrypted(); } | 107 bool is_encrypted() const { return encryption_scheme_.is_encrypted(); } |
| 105 | 108 |
| 106 // Encryption scheme used for encrypted buffers. | 109 // Encryption scheme used for encrypted buffers. |
| 107 const EncryptionScheme& encryption_scheme() const { | 110 const EncryptionScheme& encryption_scheme() const { |
| 108 return encryption_scheme_; | 111 return encryption_scheme_; |
| 109 } | 112 } |
| 110 | 113 |
| 114 void set_color_space_info(const gfx::ColorSpace& color_space_info); | |
| 115 base::Optional<gfx::ColorSpace> color_space_info() const; | |
| 116 | |
| 117 void set_hdr_metadata(const HDRMetadata& hdr_metadata); | |
| 118 base::Optional<HDRMetadata> hdr_metadata() const; | |
| 119 | |
| 111 private: | 120 private: |
| 112 VideoCodec codec_; | 121 VideoCodec codec_; |
| 113 VideoCodecProfile profile_; | 122 VideoCodecProfile profile_; |
| 114 | 123 |
| 115 VideoPixelFormat format_; | 124 VideoPixelFormat format_; |
| 125 | |
| 126 // TODO(servolk): Deprecated, use color_space_info_ instead. | |
| 116 ColorSpace color_space_; | 127 ColorSpace color_space_; |
| 117 | 128 |
| 118 gfx::Size coded_size_; | 129 gfx::Size coded_size_; |
| 119 gfx::Rect visible_rect_; | 130 gfx::Rect visible_rect_; |
| 120 gfx::Size natural_size_; | 131 gfx::Size natural_size_; |
| 121 | 132 |
| 122 std::vector<uint8_t> extra_data_; | 133 std::vector<uint8_t> extra_data_; |
| 123 | 134 |
| 124 EncryptionScheme encryption_scheme_; | 135 EncryptionScheme encryption_scheme_; |
| 125 | 136 |
| 137 base::Optional<gfx::ColorSpace> color_space_info_; | |
|
hubbe
2016/09/15 17:30:10
I don't think this needs to be optional.
gfx::Colo
servolk
2016/09/15 20:29:03
I've made it optional mostly because I wasn't sure
hubbe
2016/09/15 20:42:53
I'm not actually sure this is what we want to do g
servolk
2016/09/15 23:12:41
Ok, I've looked at all code paths that invoke Vide
| |
| 138 base::Optional<HDRMetadata> hdr_metadata_; | |
| 139 | |
| 126 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler | 140 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler |
| 127 // generated copy constructor and assignment operator. Since the extra data is | 141 // generated copy constructor and assignment operator. Since the extra data is |
| 128 // typically small, the performance impact is minimal. | 142 // typically small, the performance impact is minimal. |
| 129 }; | 143 }; |
| 130 | 144 |
| 131 } // namespace media | 145 } // namespace media |
| 132 | 146 |
| 133 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ | 147 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ |
| OLD | NEW |