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

Side by Side Diff: media/remoting/remoting_cdm.cc

Issue 2406483002: WIP - Add EME (Closed)
Patch Set: Rebase. Split RemotingSourceImpl. Addressed comments. Created 4 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
OLDNEW
(Empty)
1 // Copyright 2016 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/remoting/remoting_cdm.h"
6
7 #include "media/base/cdm_promise.h"
8
9 namespace media {
10
11 namespace {
12 // Used as an identifier for RemotingCdm::From().
13 void* const kClassIdentifier = const_cast<void**>(&kClassIdentifier);
14 } // namespace
15
16 // TODO(xjz): Merge this with Eric's implementation.
17 RemotingCdm::RemotingCdm(
18 const std::string& key_system,
19 const GURL& security_origin,
20 const CdmConfig& cdm_config,
21 const SessionMessageCB& session_message_cb,
22 const SessionClosedCB& session_closed_cb,
23 const SessionKeysChangeCB& session_keys_change_cb,
24 const SessionExpirationUpdateCB& session_expiration_update_cb,
25 const CdmCreatedCB& cdm_created_cb,
26 std::unique_ptr<RemotingCdmController> remoting_controller)
27 : remoting_controller_(std::move(remoting_controller)) {
28 NOTIMPLEMENTED();
miu 2016/10/25 04:21:25 nit: DCHECK(remoting_controller_); so we don't hav
xjz 2016/10/26 22:00:25 Done.
29 }
30
31 RemotingCdm::~RemotingCdm() {}
32
33 RemotingCdm* RemotingCdm::From(CdmContext* cdm) {
34 if (cdm && cdm->GetClassIdentifier() == kClassIdentifier)
35 return static_cast<RemotingCdm*>(cdm);
36 return nullptr;
37 }
38
39 void RemotingCdm::SetServerCertificate(
40 const std::vector<uint8_t>& certificate,
41 std::unique_ptr<SimpleCdmPromise> promise) {
42 // TODO(xjz): Merge with Eric's implementation.
43 NOTIMPLEMENTED();
44 }
45
46 void RemotingCdm::CreateSessionAndGenerateRequest(
47 SessionType session_type,
48 EmeInitDataType init_data_type,
49 const std::vector<uint8_t>& init_data,
50 std::unique_ptr<NewSessionCdmPromise> promise) {
51 // TODO(xjz): Merge with Eric's implementation.
52 NOTIMPLEMENTED();
53 }
54
55 void RemotingCdm::LoadSession(SessionType session_type,
56 const std::string& session_id,
57 std::unique_ptr<NewSessionCdmPromise> promise) {
58 // TODO(xjz): Merge with Eric's implementation.
59 NOTIMPLEMENTED();
60 }
61
62 void RemotingCdm::UpdateSession(const std::string& session_id,
63 const std::vector<uint8_t>& response,
64 std::unique_ptr<SimpleCdmPromise> promise) {
65 // TODO(xjz): Merge with Eric's implementation.
66 NOTIMPLEMENTED();
67 }
68
69 void RemotingCdm::CloseSession(const std::string& session_id,
70 std::unique_ptr<SimpleCdmPromise> promise) {
71 // TODO(xjz): Merge with Eric's implementation.
72 NOTIMPLEMENTED();
73 }
74
75 void RemotingCdm::RemoveSession(const std::string& session_id,
76 std::unique_ptr<SimpleCdmPromise> promise) {
77 // TODO(xjz): Merge with Eric's implementation.
78 NOTIMPLEMENTED();
79 }
80
81 CdmContext* RemotingCdm::GetCdmContext() {
82 return this;
83 }
84
85 Decryptor* RemotingCdm::GetDecryptor() {
86 // TODO(xjz): Merge with Eric's implementation.
87 return nullptr;
88 }
89
90 int RemotingCdm::GetCdmId() const {
91 // TODO(xjz): Merge with Eric's implementation.
92 return CdmContext::kInvalidCdmId;
93 }
94
95 void* RemotingCdm::GetClassIdentifier() const {
96 return kClassIdentifier;
97 }
98
99 scoped_refptr<RemotingSourceImpl> RemotingCdm::GetRemotingSource() {
100 return remoting_controller_->remoting_source();
101 }
102
103 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698