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

Side by Side Diff: media/cdm/cdm_adapter.h

Issue 1673383002: Add allocator interface for use by cdm_adapter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add MEDIA_CDM_EXPORT for Windows Created 4 years, 10 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
« no previous file with comments | « media/cdm/aes_decryptor_unittest.cc ('k') | media/cdm/cdm_adapter.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 MEDIA_CDM_CDM_ADAPTER_H_ 5 #ifndef MEDIA_CDM_CDM_ADAPTER_H_
6 #define MEDIA_CDM_CDM_ADAPTER_H_ 6 #define MEDIA_CDM_CDM_ADAPTER_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 13 matching lines...) Expand all
24 #include "media/base/cdm_promise_adapter.h" 24 #include "media/base/cdm_promise_adapter.h"
25 #include "media/base/decryptor.h" 25 #include "media/base/decryptor.h"
26 #include "media/base/media_export.h" 26 #include "media/base/media_export.h"
27 #include "media/base/media_keys.h" 27 #include "media/base/media_keys.h"
28 #include "media/cdm/api/content_decryption_module.h" 28 #include "media/cdm/api/content_decryption_module.h"
29 #include "ui/gfx/geometry/size.h" 29 #include "ui/gfx/geometry/size.h"
30 30
31 namespace media { 31 namespace media {
32 32
33 class AudioFramesImpl; 33 class AudioFramesImpl;
34 class CdmAllocator;
34 class CdmWrapper; 35 class CdmWrapper;
35 36
36 class MEDIA_EXPORT CdmAdapter : public MediaKeys, 37 class MEDIA_EXPORT CdmAdapter : public MediaKeys,
37 public CdmContext, 38 public CdmContext,
38 public Decryptor, 39 public Decryptor,
39 NON_EXPORTED_BASE(public cdm::Host_7), 40 NON_EXPORTED_BASE(public cdm::Host_7),
40 NON_EXPORTED_BASE(public cdm::Host_8) { 41 NON_EXPORTED_BASE(public cdm::Host_8) {
41 public: 42 public:
42 // Create the CDM using |cdm_path| and initialize it using |key_system| and 43 // Create the CDM using |cdm_path| and initialize it using |key_system| and
43 // |cdm_config|. Callbacks will be used for events generated by the CDM. 44 // |cdm_config|. |allocator| is to be used whenever the CDM needs memory
44 // |cdm_created_cb| will be called when the CDM is loaded and initialized. 45 // and to create VideoFrames. Callbacks will be used for events generated
46 // by the CDM. |cdm_created_cb| will be called when the CDM is loaded and
47 // initialized.
45 static void Create( 48 static void Create(
46 const std::string& key_system, 49 const std::string& key_system,
47 const base::FilePath& cdm_path, 50 const base::FilePath& cdm_path,
48 const CdmConfig& cdm_config, 51 const CdmConfig& cdm_config,
52 scoped_ptr<CdmAllocator> allocator,
49 const SessionMessageCB& session_message_cb, 53 const SessionMessageCB& session_message_cb,
50 const SessionClosedCB& session_closed_cb, 54 const SessionClosedCB& session_closed_cb,
51 const LegacySessionErrorCB& legacy_session_error_cb, 55 const LegacySessionErrorCB& legacy_session_error_cb,
52 const SessionKeysChangeCB& session_keys_change_cb, 56 const SessionKeysChangeCB& session_keys_change_cb,
53 const SessionExpirationUpdateCB& session_expiration_update_cb, 57 const SessionExpirationUpdateCB& session_expiration_update_cb,
54 const CdmCreatedCB& cdm_created_cb); 58 const CdmCreatedCB& cdm_created_cb);
55 59
56 // MediaKeys implementation. 60 // MediaKeys implementation.
57 void SetServerCertificate(const std::vector<uint8_t>& certificate, 61 void SetServerCertificate(const std::vector<uint8_t>& certificate,
58 scoped_ptr<SimpleCdmPromise> promise) final; 62 scoped_ptr<SimpleCdmPromise> promise) final;
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 uint32_t challenge_size) override; 141 uint32_t challenge_size) override;
138 void EnableOutputProtection(uint32_t desired_protection_mask) override; 142 void EnableOutputProtection(uint32_t desired_protection_mask) override;
139 void QueryOutputProtectionStatus() override; 143 void QueryOutputProtectionStatus() override;
140 void OnDeferredInitializationDone(cdm::StreamType stream_type, 144 void OnDeferredInitializationDone(cdm::StreamType stream_type,
141 cdm::Status decoder_status) override; 145 cdm::Status decoder_status) override;
142 cdm::FileIO* CreateFileIO(cdm::FileIOClient* client) override; 146 cdm::FileIO* CreateFileIO(cdm::FileIOClient* client) override;
143 147
144 private: 148 private:
145 CdmAdapter(const std::string& key_system, 149 CdmAdapter(const std::string& key_system,
146 const CdmConfig& cdm_config, 150 const CdmConfig& cdm_config,
151 scoped_ptr<CdmAllocator> allocator,
147 const SessionMessageCB& session_message_cb, 152 const SessionMessageCB& session_message_cb,
148 const SessionClosedCB& session_closed_cb, 153 const SessionClosedCB& session_closed_cb,
149 const LegacySessionErrorCB& legacy_session_error_cb, 154 const LegacySessionErrorCB& legacy_session_error_cb,
150 const SessionKeysChangeCB& session_keys_change_cb, 155 const SessionKeysChangeCB& session_keys_change_cb,
151 const SessionExpirationUpdateCB& session_expiration_update_cb); 156 const SessionExpirationUpdateCB& session_expiration_update_cb);
152 ~CdmAdapter() final; 157 ~CdmAdapter() final;
153 158
154 // Load the CDM using |cdm_path| and initialize it. |promise| is resolved if 159 // Load the CDM using |cdm_path| and initialize it. |promise| is resolved if
155 // the CDM is successfully loaded and initialized, rejected otherwise. 160 // the CDM is successfully loaded and initialized, rejected otherwise.
156 void Initialize(const base::FilePath& cdm_path, 161 void Initialize(const base::FilePath& cdm_path,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 NewKeyCB new_video_key_cb_; 202 NewKeyCB new_video_key_cb_;
198 203
199 // Keep track of video frame natural size from the latest configuration 204 // Keep track of video frame natural size from the latest configuration
200 // as the CDM doesn't provide it. 205 // as the CDM doesn't provide it.
201 gfx::Size natural_size_; 206 gfx::Size natural_size_;
202 207
203 // Keep track of audio parameters. 208 // Keep track of audio parameters.
204 int audio_samples_per_second_; 209 int audio_samples_per_second_;
205 ChannelLayout audio_channel_layout_; 210 ChannelLayout audio_channel_layout_;
206 211
212 scoped_ptr<CdmAllocator> allocator_;
213
207 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 214 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
208 215
209 // NOTE: Weak pointers must be invalidated before all other member variables. 216 // NOTE: Weak pointers must be invalidated before all other member variables.
210 base::WeakPtrFactory<CdmAdapter> weak_factory_; 217 base::WeakPtrFactory<CdmAdapter> weak_factory_;
211 218
212 DISALLOW_COPY_AND_ASSIGN(CdmAdapter); 219 DISALLOW_COPY_AND_ASSIGN(CdmAdapter);
213 }; 220 };
214 221
215 } // namespace media 222 } // namespace media
216 223
217 #endif // MEDIA_CDM_CDM_ADAPTER_H_ 224 #endif // MEDIA_CDM_CDM_ADAPTER_H_
OLDNEW
« no previous file with comments | « media/cdm/aes_decryptor_unittest.cc ('k') | media/cdm/cdm_adapter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698