Chromium Code Reviews| Index: media/base/video_decoder_config.h |
| diff --git a/media/base/video_decoder_config.h b/media/base/video_decoder_config.h |
| index 2d3d3fe972930850811c0e7717b41e6f621bf22d..42b64db7c0df71c3e3186c551c3dae71251ea488 100644 |
| --- a/media/base/video_decoder_config.h |
| +++ b/media/base/video_decoder_config.h |
| @@ -15,6 +15,7 @@ |
| #include "media/base/encryption_scheme.h" |
| #include "media/base/hdr_metadata.h" |
| #include "media/base/media_export.h" |
| +#include "media/base/media_util.h" |
| #include "media/base/video_codecs.h" |
| #include "media/base/video_types.h" |
| #include "ui/gfx/color_space.h" |
| @@ -119,6 +120,25 @@ class MEDIA_EXPORT VideoDecoderConfig { |
| void set_hdr_metadata(const HDRMetadata& hdr_metadata); |
| base::Optional<HDRMetadata> hdr_metadata() const; |
| + // 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.
|
| + // useful for decryptors that decrypts an encrypted stream to a clear stream, |
| + // or for decoder selectors that wants to select decrypting decoders instead |
| + // of clear decoders. |
| + void set_is_encrypted(bool is_encrypted) { |
| + if (!is_encrypted) { |
| + DCHECK(encryption_scheme_.is_encrypted()) << "Config is already clear."; |
| + encryption_scheme_ = Unencrypted(); |
| + } else { |
| + DCHECK(!encryption_scheme_.is_encrypted()) |
| + << "Config is already encrypted."; |
| + // TODO(xhwang): This is only used to guide decoder selection, so set |
| + // a common encryption scheme that should be supported by all decrypting |
| + // decoders. We should be able to remove this when we support switching |
| + // decoders at run time. See http://crbug.com/695595 |
| + encryption_scheme_ = AesCtrEncryptionScheme(); |
| + } |
| + } |
| + |
| private: |
| VideoCodec codec_; |
| VideoCodecProfile profile_; |