Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(26)

Unified Diff: media/video/video_decode_accelerator.h

Issue 1963903002: Remove VideoDecodeAccelerator::SetCdm() and pass the cdm in Initialize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add cdm_id to paramtraits Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/gpu/ipc/service/gpu_video_decode_accelerator.cc ('k') | media/video/video_decode_accelerator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..84f14fdce42bfc12c5e9d4cc0caf866507b9ac99 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,24 @@ class MEDIA_EXPORT VideoDecodeAccelerator {
};
Config() = default;
+
+ // Intentional converting constructor.
+ // TODO(watk): Make this explicit.
Config(VideoCodecProfile profile);
- Config(const VideoDecoderConfig& video_decoder_config);
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 +210,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 +220,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.
« no previous file with comments | « media/gpu/ipc/service/gpu_video_decode_accelerator.cc ('k') | media/video/video_decode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698