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

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

Issue 11147032: Fake video decoder in clearkey CDM. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: oops, more fixes Created 8 years, 2 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
« no previous file with comments | « no previous file | webkit/media/crypto/ppapi/clear_key_cdm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/synchronization/lock.h" 13 #include "base/synchronization/lock.h"
14 #include "media/base/decryptor_client.h" 14 #include "media/base/decryptor_client.h"
15 #include "media/crypto/aes_decryptor.h" 15 #include "media/crypto/aes_decryptor.h"
16 #include "webkit/media/crypto/ppapi/content_decryption_module.h" 16 #include "webkit/media/crypto/ppapi/content_decryption_module.h"
17 17
18 // Enable this to use the fake decoder for testing.
19 // #define CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER
20
18 namespace media { 21 namespace media {
19 class DecoderBuffer; 22 class DecoderBuffer;
20 } 23 }
21 24
22 namespace webkit_media { 25 namespace webkit_media {
23 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 explicit ClearKeyCdm(cdm::Allocator* allocator, cdm::CdmHost*); 30 explicit ClearKeyCdm(cdm::Allocator* allocator, cdm::CdmHost*);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 int init_data_length) OVERRIDE; 94 int init_data_length) OVERRIDE;
92 95
93 private: 96 private:
94 Status status_; 97 Status status_;
95 std::string session_id_; 98 std::string session_id_;
96 scoped_array<uint8> key_message_; 99 scoped_array<uint8> key_message_;
97 int key_message_length_; 100 int key_message_length_;
98 std::string default_url_; 101 std::string default_url_;
99 }; 102 };
100 103
104 #if defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER)
105 void GenerateFakeVideoFrame(base::TimeDelta timestamp,
106 cdm::VideoFrame* video_frame);
107 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER
108
101 Client client_; 109 Client client_;
102 media::AesDecryptor decryptor_; 110 media::AesDecryptor decryptor_;
103 111
104 // Protects the |client_| from being accessed by the |decryptor_| 112 // Protects the |client_| from being accessed by the |decryptor_|
105 // simultaneously. 113 // simultaneously.
106 base::Lock client_lock_; 114 base::Lock client_lock_;
107 115
108 cdm::Allocator* const allocator_; 116 cdm::Allocator* const allocator_;
117
118 #if defined(CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER)
119 cdm::Size video_size_;
120 #endif // CLEAR_KEY_CDM_USE_FAKE_VIDEO_DECODER
109 }; 121 };
110 122
111 } // namespace webkit_media 123 } // namespace webkit_media
112 124
113 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_ 125 #endif // WEBKIT_MEDIA_CRYPTO_PPAPI_CLEAR_KEY_CDM_H_
OLDNEW
« no previous file with comments | « no previous file | webkit/media/crypto/ppapi/clear_key_cdm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698