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/media_util.h" | |
18 #include "media/base/video_codecs.h" | 19 #include "media/base/video_codecs.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/color_space.h" |
21 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
22 #include "ui/gfx/geometry/size.h" | 23 #include "ui/gfx/geometry/size.h" |
23 | 24 |
24 namespace media { | 25 namespace media { |
25 | 26 |
26 MEDIA_EXPORT VideoCodec | 27 MEDIA_EXPORT VideoCodec |
27 VideoCodecProfileToVideoCodec(VideoCodecProfile profile); | 28 VideoCodecProfileToVideoCodec(VideoCodecProfile profile); |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
112 const EncryptionScheme& encryption_scheme() const { | 113 const EncryptionScheme& encryption_scheme() const { |
113 return encryption_scheme_; | 114 return encryption_scheme_; |
114 } | 115 } |
115 | 116 |
116 void set_color_space_info(const gfx::ColorSpace& color_space_info); | 117 void set_color_space_info(const gfx::ColorSpace& color_space_info); |
117 gfx::ColorSpace color_space_info() const; | 118 gfx::ColorSpace color_space_info() const; |
118 | 119 |
119 void set_hdr_metadata(const HDRMetadata& hdr_metadata); | 120 void set_hdr_metadata(const HDRMetadata& hdr_metadata); |
120 base::Optional<HDRMetadata> hdr_metadata() const; | 121 base::Optional<HDRMetadata> hdr_metadata() const; |
121 | 122 |
123 // Sets the config to be encrypted or not encrypted manually. This can be | |
DaleCurtis
2017/02/24 18:03:50
Ditto.
xhwang
2017/02/24 18:18:15
Done.
| |
124 // useful for decryptors that decrypts an encrypted stream to a clear stream, | |
125 // or for decoder selectors that wants to select decrypting decoders instead | |
126 // of clear decoders. | |
127 void set_is_encrypted(bool is_encrypted) { | |
128 if (!is_encrypted) { | |
129 DCHECK(encryption_scheme_.is_encrypted()) << "Config is already clear."; | |
130 encryption_scheme_ = Unencrypted(); | |
131 } else { | |
132 DCHECK(!encryption_scheme_.is_encrypted()) | |
133 << "Config is already encrypted."; | |
134 // TODO(xhwang): This is only used to guide decoder selection, so set | |
135 // a common encryption scheme that should be supported by all decrypting | |
136 // decoders. We should be able to remove this when we support switching | |
137 // decoders at run time. See http://crbug.com/695595 | |
138 encryption_scheme_ = AesCtrEncryptionScheme(); | |
139 } | |
140 } | |
141 | |
122 private: | 142 private: |
123 VideoCodec codec_; | 143 VideoCodec codec_; |
124 VideoCodecProfile profile_; | 144 VideoCodecProfile profile_; |
125 | 145 |
126 VideoPixelFormat format_; | 146 VideoPixelFormat format_; |
127 | 147 |
128 // TODO(servolk): Deprecated, use color_space_info_ instead. | 148 // TODO(servolk): Deprecated, use color_space_info_ instead. |
129 ColorSpace color_space_; | 149 ColorSpace color_space_; |
130 | 150 |
131 // Deprecated. TODO(wolenetz): Remove. See https://crbug.com/665539. | 151 // Deprecated. TODO(wolenetz): Remove. See https://crbug.com/665539. |
(...skipping 10 matching lines...) Expand all Loading... | |
142 base::Optional<HDRMetadata> hdr_metadata_; | 162 base::Optional<HDRMetadata> hdr_metadata_; |
143 | 163 |
144 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler | 164 // Not using DISALLOW_COPY_AND_ASSIGN here intentionally to allow the compiler |
145 // generated copy constructor and assignment operator. Since the extra data is | 165 // generated copy constructor and assignment operator. Since the extra data is |
146 // typically small, the performance impact is minimal. | 166 // typically small, the performance impact is minimal. |
147 }; | 167 }; |
148 | 168 |
149 } // namespace media | 169 } // namespace media |
150 | 170 |
151 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ | 171 #endif // MEDIA_BASE_VIDEO_DECODER_CONFIG_H_ |
OLD | NEW |