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

Side by Side Diff: media/mojo/services/mojo_cdm_factory.cc

Issue 840473002: media: Support creation and SetCdm() for mojo based CDM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "media/mojo/services/mojo_cdm_factory.h"
6
7 #include "media/mojo/services/mojo_cdm.h"
8
9 namespace media {
10
11 int MojoCdmFactory::next_cdm_id_ = MojoCdm::kInvalidCdmId + 1;
12
13 MojoCdmFactory::MojoCdmFactory(
14 mojo::ContentDecryptionModuleFactoryPtr remote_factory)
15 : remote_factory_(remote_factory.Pass()) {
16 DCHECK(remote_factory_);
17 }
18
19 MojoCdmFactory::~MojoCdmFactory() {
20 }
21
22 scoped_ptr<MediaKeys> MojoCdmFactory::Create(
23 const std::string& key_system,
24 const GURL& security_origin,
25 const SessionMessageCB& session_message_cb,
26 const SessionClosedCB& session_closed_cb,
27 const SessionErrorCB& session_error_cb,
28 const SessionKeysChangeCB& session_keys_change_cb,
29 const SessionExpirationUpdateCB& session_expiration_update_cb) {
30 DVLOG(2) << __FUNCTION__ << ": " << key_system;
31 int32_t cdm_id = next_cdm_id_++;
32 mojo::ContentDecryptionModulePtr cdm_service;
33 remote_factory_->Create(key_system, security_origin.spec(), cdm_id,
34 GetProxy(&cdm_service));
35
36 return make_scoped_ptr(new MojoCdm(
37 cdm_service.Pass(), cdm_id, session_message_cb, session_closed_cb,
38 session_error_cb, session_keys_change_cb, session_expiration_update_cb));
39 }
40
41 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698