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

Side by Side Diff: webkit/media/crypto/ppapi/clear_key_cdm.h

Issue 10899021: Add CDM video decoder. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ 5 #ifndef WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_
6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ 6 #define WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/compiler_specific.h" 11 #include "base/compiler_specific.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h"
13 #include "base/synchronization/lock.h" 14 #include "base/synchronization/lock.h"
14 #include "media/base/decryptor_client.h" 15 #include "media/base/decryptor_client.h"
15 #include "media/crypto/aes_decryptor.h" 16 #include "media/crypto/aes_decryptor.h"
16 #include "webkit/media/crypto/ppapi/content_decryption_module.h" 17 #include "webkit/media/crypto/ppapi/content_decryption_module.h"
17 18
18 namespace media { 19 namespace media {
19 class DecoderBuffer; 20 class DecoderBuffer;
20 } 21 }
21 22
22 namespace webkit_media { 23 namespace webkit_media {
23 24
25 class FFmpegVideoDecoder;
26
24 // Clear key implementation of the cdm::ContentDecryptionModule interface. 27 // Clear key implementation of the cdm::ContentDecryptionModule interface.
25 class ClearKeyCdm : public cdm::ContentDecryptionModule { 28 class ClearKeyCdm : public cdm::ContentDecryptionModule {
26 public: 29 public:
27 ClearKeyCdm(); 30 ClearKeyCdm();
28 virtual ~ClearKeyCdm(); 31 virtual ~ClearKeyCdm();
29 32
30 // ContentDecryptionModule implementation. 33 // ContentDecryptionModule implementation.
31 virtual cdm::Status GenerateKeyRequest(const uint8_t* init_data, 34 virtual cdm::Status GenerateKeyRequest(const uint8_t* init_data,
32 int init_data_size, 35 int init_data_size,
33 cdm::KeyMessage* key_request) OVERRIDE; 36 cdm::KeyMessage* key_request) OVERRIDE;
34 37
35 virtual cdm::Status AddKey(const char* session_id, 38 virtual cdm::Status AddKey(const char* session_id,
36 int session_id_size, 39 int session_id_size,
37 const uint8_t* key, 40 const uint8_t* key,
38 int key_size, 41 int key_size,
39 const uint8_t* key_id, 42 const uint8_t* key_id,
40 int key_id_size) OVERRIDE; 43 int key_id_size) OVERRIDE;
41 44
42 virtual cdm::Status CancelKeyRequest(const char* session_id, 45 virtual cdm::Status CancelKeyRequest(const char* session_id,
43 int session_id_size) OVERRIDE; 46 int session_id_size) OVERRIDE;
44 47
45 virtual cdm::Status Decrypt(const cdm::InputBuffer& encrypted_buffer, 48 virtual cdm::Status Decrypt(const cdm::InputBuffer& encrypted_buffer,
46 cdm::OutputBuffer* decrypted_buffer) OVERRIDE; 49 cdm::OutputBuffer* decrypted_buffer) OVERRIDE;
47 50
51 virtual cdm::Status InitializeVideoDecoder(
52 const cdm::VideoDecoderConfig& video_decoder_config) OVERRIDE;
53
54 virtual cdm::Status DecryptAndDecode(const cdm::InputBuffer& encrypted_buffer,
55 cdm::VideoFrame* video_frame) OVERRIDE;
56
48 private: 57 private:
49 class Client : public media::DecryptorClient { 58 class Client : public media::DecryptorClient {
50 public: 59 public:
51 enum Status { 60 enum Status {
52 kKeyAdded, 61 kKeyAdded,
53 kKeyError, 62 kKeyError,
54 kKeyMessage, 63 kKeyMessage,
55 kNeedKey 64 kNeedKey
56 }; 65 };
57 66
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 scoped_array<uint8> key_message_; 99 scoped_array<uint8> key_message_;
91 int key_message_length_; 100 int key_message_length_;
92 std::string default_url_; 101 std::string default_url_;
93 }; 102 };
94 103
95 Client client_; 104 Client client_;
96 media::AesDecryptor decryptor_; 105 media::AesDecryptor decryptor_;
97 // Protects the |client_| from being accessed by the |decryptor_| 106 // Protects the |client_| from being accessed by the |decryptor_|
98 // simultaneously. 107 // simultaneously.
99 base::Lock client_lock_; 108 base::Lock client_lock_;
109
110 scoped_ptr<FFmpegVideoDecoder> video_decoder_;
ddorwin 2012/08/29 17:33:49 Why do we have a base class if even this header fi
Tom Finegan 2012/08/30 17:09:23 base::scoped_ptr<T> seems to be working fine w/for
ddorwin 2012/09/02 21:39:07 My point is that we never use the VideoDecoder cla
Tom Finegan 2012/09/27 22:16:24 Done.
100 }; 111 };
101 112
102 } // namespace webkit_media 113 } // namespace webkit_media
103 114
104 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ 115 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698