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

Unified Diff: media/video/video_decode_accelerator.h

Issue 1438063002: media: Support SetCdm() on VideoDecodeAccelerator interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed Created 5 years, 1 month 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 | « content/common/gpu/media/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 2b71d65ab075926a56d690856d7de1b95a595406..a53e352b59d315d590dca759fc079a43bc0afbbc 100644
--- a/media/video/video_decode_accelerator.h
+++ b/media/video/video_decode_accelerator.h
@@ -60,6 +60,11 @@ class MEDIA_EXPORT VideoDecodeAccelerator {
// implements.
class MEDIA_EXPORT Client {
public:
+ // SetCdm completion callback 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 NotifyCdmAttached(bool success);
+
// Callback to tell client how many and what size of buffers to provide.
// Note that the actual count provided through AssignPictureBuffers() can be
// larger than the value requested.
@@ -97,12 +102,25 @@ class MEDIA_EXPORT VideoDecodeAccelerator {
// Initializes the video decoder with specific configuration. Called once per
// decoder construction. This call is synchronous and returns true iff
// initialization is successful.
+ //
+ // 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.
+ //
// Parameters:
// |profile| is the video stream's format profile.
- // |client| is the client of this video decoder. The provided pointer must
- // be valid until Destroy() is called.
+ // |client| is the client of this video decoder. Does not take ownership of
+ // |client| which must be valid until Destroy() is called.
virtual bool Initialize(VideoCodecProfile profile, 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 | « content/common/gpu/media/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