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 "base/optional.h" |
15 #include "media/base/encryption_scheme.h" | 15 #include "media/base/encryption_scheme.h" |
16 #include "media/base/hdr_metadata.h" | 16 #include "media/base/hdr_metadata.h" |
17 #include "media/base/media_export.h" | 17 #include "media/base/media_export.h" |
18 #include "media/base/video_codecs.h" | 18 #include "media/base/video_codecs.h" |
| 19 #include "media/base/video_color_space.h" |
19 #include "media/base/video_types.h" | 20 #include "media/base/video_types.h" |
20 #include "ui/gfx/color_space.h" | |
21 #include "ui/gfx/geometry/rect.h" | 21 #include "ui/gfx/geometry/rect.h" |
22 #include "ui/gfx/geometry/size.h" | 22 #include "ui/gfx/geometry/size.h" |
23 | 23 |
24 namespace media { | 24 namespace media { |
25 | 25 |
26 MEDIA_EXPORT VideoCodec | 26 MEDIA_EXPORT VideoCodec |
27 VideoCodecProfileToVideoCodec(VideoCodecProfile profile); | 27 VideoCodecProfileToVideoCodec(VideoCodecProfile profile); |
28 | 28 |
29 class MEDIA_EXPORT VideoDecoderConfig { | 29 class MEDIA_EXPORT VideoDecoderConfig { |
30 public: | 30 public: |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // Whether the video stream is potentially encrypted. | 106 // Whether the video stream is potentially encrypted. |
107 // Note that in a potentially encrypted video stream, individual buffers | 107 // Note that in a potentially encrypted video stream, individual buffers |
108 // can be encrypted or not encrypted. | 108 // can be encrypted or not encrypted. |
109 bool is_encrypted() const { return encryption_scheme_.is_encrypted(); } | 109 bool is_encrypted() const { return encryption_scheme_.is_encrypted(); } |
110 | 110 |
111 // Encryption scheme used for encrypted buffers. | 111 // Encryption scheme used for encrypted buffers. |
112 const EncryptionScheme& encryption_scheme() const { | 112 const EncryptionScheme& encryption_scheme() const { |
113 return encryption_scheme_; | 113 return encryption_scheme_; |
114 } | 114 } |
115 | 115 |
116 void set_color_space_info(const gfx::ColorSpace& color_space_info); | 116 void set_color_space_info(const VideoColorSpace& color_space_info); |
117 gfx::ColorSpace color_space_info() const; | 117 VideoColorSpace color_space_info() const; |
118 | 118 |
119 void set_hdr_metadata(const HDRMetadata& hdr_metadata); | 119 void set_hdr_metadata(const HDRMetadata& hdr_metadata); |
120 base::Optional<HDRMetadata> hdr_metadata() const; | 120 base::Optional<HDRMetadata> hdr_metadata() const; |
121 | 121 |
122 // Sets the config to be encrypted or not encrypted manually. This can be | 122 // Sets the config to be encrypted or not encrypted manually. This can be |
123 // useful for decryptors that decrypts an encrypted stream to a clear stream, | 123 // useful for decryptors that decrypts an encrypted stream to a clear stream, |
124 // or for decoder selectors that wants to select decrypting decoders instead | 124 // or for decoder selectors that wants to select decrypting decoders instead |
125 // of clear decoders. | 125 // of clear decoders. |
126 void SetIsEncrypted(bool is_encrypted); | 126 void SetIsEncrypted(bool is_encrypted); |
127 | 127 |
128 private: | 128 private: |
129 VideoCodec codec_; | 129 VideoCodec codec_; |
130 VideoCodecProfile profile_; | 130 VideoCodecProfile profile_; |
131 | 131 |
132 VideoPixelFormat format_; | 132 VideoPixelFormat format_; |
133 | 133 |
134 // TODO(servolk): Deprecated, use color_space_info_ instead. | 134 // TODO(servolk): Deprecated, use color_space_info_ instead. |
135 ColorSpace color_space_; | 135 ColorSpace color_space_; |
136 | 136 |
137 // Deprecated. TODO(wolenetz): Remove. See https://crbug.com/665539. | 137 // Deprecated. TODO(wolenetz): Remove. See https://crbug.com/665539. |
138 gfx::Size coded_size_; | 138 gfx::Size coded_size_; |
139 | 139 |
140 gfx::Rect visible_rect_; | 140 gfx::Rect visible_rect_; |
141 gfx::Size natural_size_; | 141 gfx::Size natural_size_; |
142 | 142 |
143 std::vector<uint8_t> extra_data_; | 143 std::vector<uint8_t> extra_data_; |
144 | 144 |
145 EncryptionScheme encryption_scheme_; | 145 EncryptionScheme encryption_scheme_; |
146 | 146 |
147 gfx::ColorSpace color_space_info_; | 147 VideoColorSpace color_space_info_; |
148 base::Optional<HDRMetadata> hdr_metadata_; | 148 base::Optional<HDRMetadata> hdr_metadata_; |
149 | 149 |
150 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler | 150 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler |
151 // generated copy constructor and assignment operator. Since the extra data is | 151 // generated copy constructor and assignment operator. Since the extra data is |
152 // typically small, the performance impact is minimal. | 152 // typically small, the performance impact is minimal. |
153 }; | 153 }; |
154 | 154 |
155 } // namespace media | 155 } // namespace media |
156 | 156 |
157 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ | 157 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ |
OLD | NEW |