Chromium Code Reviews| Index: content/renderer/media/crypto/encrypted_media_player_support.h |
| diff --git a/content/renderer/media/crypto/encrypted_media_player_support.h b/content/renderer/media/crypto/encrypted_media_player_support.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e762d9064fc84dc36e3d9f901e1564e41a1dfeb8 |
| --- /dev/null |
| +++ b/content/renderer/media/crypto/encrypted_media_player_support.h |
| @@ -0,0 +1,84 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CONTENT_RENDERER_MEDIA_CRYPTO_ENCRYPTED_MEDIA_PLAYER_SUPPORT_H_ |
| +#define CONTENT_RENDERER_MEDIA_CRYPTO_ENCRYPTED_MEDIA_PLAYER_SUPPORT_H_ |
| + |
| +#include "media/base/decryptor.h" |
| +#include "media/base/demuxer.h" |
| +#include "third_party/WebKit/public/platform/WebMediaPlayer.h" |
| + |
| +namespace blink { |
| +class WebContentDecryptionModule; |
| +class WebContentDecryptionModuleResult; |
| +class WebLocalFrame; |
| +class WebMediaPlayerClient; |
| +class WebString; |
| +} |
| + |
| +namespace content { |
| + |
| +class EncryptedMediaPlayerSupport { |
| + public: |
| + // Creates a new instance of EncryptedMediaPlayerSupport for |client|. This |
| + // method must always return a valid pointer. |
| + static scoped_ptr<EncryptedMediaPlayerSupport> create( |
|
xhwang
2014/08/23 00:31:57
s/create/Create
acolwell GONE FROM CHROMIUM
2014/08/25 18:10:43
Done.
|
| + blink::WebMediaPlayerClient* client); |
| + |
| + EncryptedMediaPlayerSupport() { } |
| + virtual ~EncryptedMediaPlayerSupport(); |
| + |
| + // Prefixed API methods. |
| + virtual blink::WebMediaPlayer::MediaKeyException GenerateKeyRequest( |
| + blink::WebLocalFrame* frame, |
| + const blink::WebString& key_system, |
| + const unsigned char* init_data, |
| + unsigned init_data_length) = 0; |
| + |
| + virtual blink::WebMediaPlayer::MediaKeyException AddKey( |
| + const blink::WebString& key_system, |
| + const unsigned char* key, |
| + unsigned key_length, |
| + const unsigned char* init_data, |
| + unsigned init_data_length, |
| + const blink::WebString& session_id) = 0; |
| + |
| + virtual blink::WebMediaPlayer::MediaKeyException CancelKeyRequest( |
| + const blink::WebString& key_system, |
| + const blink::WebString& session_id) = 0; |
| + |
| + |
| + // Unprefixed API methods. |
| + virtual void SetContentDecryptionModule( |
| + blink::WebContentDecryptionModule* cdm) = 0; |
| + virtual void SetContentDecryptionModule( |
| + blink::WebContentDecryptionModule* cdm, |
| + blink::WebContentDecryptionModuleResult result) = 0; |
| + virtual void SetContentDecryptionModuleSync( |
| + blink::WebContentDecryptionModule* cdm) = 0; |
|
xhwang
2014/08/23 00:31:57
For your info, later on when prefixed EME is depre
acolwell GONE FROM CHROMIUM
2014/08/25 18:10:43
Acknowledged.
|
| + |
| + |
| + // Callback factory and notification methods used by WebMediaPlayerImpl. |
| + |
| + // Creates a callback that Demuxers can use to signal that the content |
| + // requires a key. This method make sure the callback returned can be safely |
| + // invoked from any thread. |
| + virtual media::Demuxer::NeedKeyCB CreateNeedKeyCB() = 0; |
| + |
| + // Creates a callback that renderers can use to set decryptor |
| + // ready callback. This method make sure the callback returned can be safely |
| + // invoked from any thread. |
| + virtual media::SetDecryptorReadyCB CreateSetDecryptorReadyCB() = 0; |
| + |
| + // Called to inform this object that the media pipeline encountered |
| + // and handled a decryption error. |
| + virtual void OnPipelineDecryptError() = 0; |
| + |
| + private: |
| + DISALLOW_COPY_AND_ASSIGN(EncryptedMediaPlayerSupport); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_RENDERER_MEDIA_CRYPTO_ENCRYPTED_MEDIA_PLAYER_SUPPORT_H_ |