Chromium Code Reviews| Index: media/video/video_decode_accelerator.h |
| diff --git a/media/video/video_decode_accelerator.h b/media/video/video_decode_accelerator.h |
| index a00c9514d59f42de11dfc4a7b510ebf3c0739574..2e18c30f5d3c0f38e101569a0c2b450a3cbc1bca 100644 |
| --- a/media/video/video_decode_accelerator.h |
| +++ b/media/video/video_decode_accelerator.h |
| @@ -13,6 +13,7 @@ |
| #include "base/memory/ref_counted.h" |
| #include "base/memory/weak_ptr.h" |
| #include "media/base/bitstream_buffer.h" |
| +#include "media/base/cdm_context.h" |
| #include "media/base/surface_manager.h" |
| #include "media/base/video_decoder_config.h" |
| #include "media/video/picture.h" |
| @@ -115,19 +116,22 @@ class MEDIA_EXPORT VideoDecodeAccelerator { |
| }; |
| Config() = default; |
| + // Intentional converting constructor. |
|
sandersd (OOO until July 31)
2016/05/10 00:09:54
Newline before comment. Add a TODO.
|
| Config(VideoCodecProfile profile); |
| - Config(const VideoDecoderConfig& video_decoder_config); |
|
watk
2016/05/09 23:39:59
I removed this because it felt clearer to initiali
|
| std::string AsHumanReadableString() const; |
| - // |profile| combines the information about the codec and its profile. |
| + // The video codec and profile. |
| VideoCodecProfile profile = VIDEO_CODEC_PROFILE_UNKNOWN; |
| - // The flag indicating whether the stream is encrypted. |
| + // Whether the stream is encrypted. |
| bool is_encrypted = false; |
| - // The flag indicating whether the client supports deferred initialization |
| - // or not. |
| + // The CDM that the VDA should use to decode encrypted streams. Must be |
| + // set to a valid ID if |is_encrypted|. |
| + int cdm_id = CdmContext::kInvalidCdmId; |
| + |
| + // Whether the client supports deferred initialization. |
| bool is_deferred_initialization_allowed = false; |
| // An optional graphics surface that the VDA should render to. For setting |
| @@ -204,13 +208,9 @@ class MEDIA_EXPORT VideoDecodeAccelerator { |
| // NotifyInitializationComplete with the actual success / failure of |
| // initialization. Note that a return value of false from VDA::Initialize |
| // indicates that initialization definitely failed, and no callback is needed. |
| - // TODO(liberato): should we say that encrypted video requires deferred? |
| // |
| - // For encrpyted video, the decoder needs a CDM to be able to decode encrypted |
| - // buffers. SetCdm() should be called after Initialize() to set such a CDM. |
| - // Client::NotifyCdmAttached() will then be called to indicate whether the CDM |
| - // is successfully attached to the decoder. Only when a CDM is successfully |
| - // attached can we start to decode. |
| + // For encrypted video, only deferred initialization is supported and |config| |
| + // must contain a valid |cdm_id|. |
| // |
| // Parameters: |
| // |config| contains the initialization parameters. |
| @@ -218,12 +218,6 @@ class MEDIA_EXPORT VideoDecodeAccelerator { |
| // |client| which must be valid until Destroy() is called. |
| virtual bool Initialize(const Config& config, Client* client) = 0; |
| - // Sets a CDM to be used by the decoder to decode encrypted buffers. |
| - // Client::NotifyCdmAttached() will then be called to indicate whether the CDM |
| - // is successfully attached to the decoder. The default implementation is a |
| - // no-op since most VDAs don't support encrypted video. |
| - virtual void SetCdm(int cdm_id); |
| - |
| // Decodes given bitstream buffer that contains at most one frame. Once |
| // decoder is done with processing |bitstream_buffer| it will call |
| // NotifyEndOfBitstreamBuffer() with the bitstream buffer id. |