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

Unified Diff: media/remoting/remoting_cdm.cc

Issue 2406483002: WIP - Add EME (Closed)
Patch Set: Addressed miu's comments. Added more tests. 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/remoting/remoting_cdm.h ('k') | media/remoting/remoting_cdm_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/remoting/remoting_cdm.cc
diff --git a/media/remoting/remoting_cdm.cc b/media/remoting/remoting_cdm.cc
new file mode 100644
index 0000000000000000000000000000000000000000..acf739e2311c75b4eed993b1056d190d9d47f107
--- /dev/null
+++ b/media/remoting/remoting_cdm.cc
@@ -0,0 +1,105 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/remoting/remoting_cdm.h"
+
+#include "media/base/cdm_promise.h"
+
+namespace media {
+
+namespace {
+// Used as an identifier for RemotingCdm::From().
+void* const kClassIdentifier = const_cast<void**>(&kClassIdentifier);
+} // namespace
+
+// TODO(xjz): Merge this with Eric's implementation.
+RemotingCdm::RemotingCdm(
+ const std::string& key_system,
+ const GURL& security_origin,
+ const CdmConfig& cdm_config,
+ const SessionMessageCB& session_message_cb,
+ const SessionClosedCB& session_closed_cb,
+ const SessionKeysChangeCB& session_keys_change_cb,
+ const SessionExpirationUpdateCB& session_expiration_update_cb,
+ const CdmCreatedCB& cdm_created_cb,
+ std::unique_ptr<RemotingCdmController> remoting_controller)
+ : remoting_controller_(std::move(remoting_controller)) {
+ DCHECK(remoting_controller_);
+
+ // TODO(xjz): Not implemented. Need to merge with Eric's implementation.
+}
+
+RemotingCdm::~RemotingCdm() {}
+
+RemotingCdm* RemotingCdm::From(CdmContext* cdm) {
+ if (cdm && cdm->GetClassIdentifier() == kClassIdentifier)
+ return static_cast<RemotingCdm*>(cdm);
+ return nullptr;
+}
+
+void RemotingCdm::SetServerCertificate(
+ const std::vector<uint8_t>& certificate,
+ std::unique_ptr<SimpleCdmPromise> promise) {
+ // TODO(xjz): Merge with Eric's implementation.
+ NOTIMPLEMENTED();
+}
+
+void RemotingCdm::CreateSessionAndGenerateRequest(
+ SessionType session_type,
+ EmeInitDataType init_data_type,
+ const std::vector<uint8_t>& init_data,
+ std::unique_ptr<NewSessionCdmPromise> promise) {
+ // TODO(xjz): Merge with Eric's implementation.
+ NOTIMPLEMENTED();
+}
+
+void RemotingCdm::LoadSession(SessionType session_type,
+ const std::string& session_id,
+ std::unique_ptr<NewSessionCdmPromise> promise) {
+ // TODO(xjz): Merge with Eric's implementation.
+ NOTIMPLEMENTED();
+}
+
+void RemotingCdm::UpdateSession(const std::string& session_id,
+ const std::vector<uint8_t>& response,
+ std::unique_ptr<SimpleCdmPromise> promise) {
+ // TODO(xjz): Merge with Eric's implementation.
+ NOTIMPLEMENTED();
+}
+
+void RemotingCdm::CloseSession(const std::string& session_id,
+ std::unique_ptr<SimpleCdmPromise> promise) {
+ // TODO(xjz): Merge with Eric's implementation.
+ NOTIMPLEMENTED();
+}
+
+void RemotingCdm::RemoveSession(const std::string& session_id,
+ std::unique_ptr<SimpleCdmPromise> promise) {
+ // TODO(xjz): Merge with Eric's implementation.
+ NOTIMPLEMENTED();
+}
+
+CdmContext* RemotingCdm::GetCdmContext() {
+ return this;
+}
+
+Decryptor* RemotingCdm::GetDecryptor() {
+ // TODO(xjz): Merge with Eric's implementation.
+ return nullptr;
+}
+
+int RemotingCdm::GetCdmId() const {
+ // TODO(xjz): Merge with Eric's implementation.
+ return CdmContext::kInvalidCdmId;
+}
+
+void* RemotingCdm::GetClassIdentifier() const {
+ return kClassIdentifier;
+}
+
+RemotingSourceImpl* RemotingCdm::GetRemotingSource() {
+ return remoting_controller_->remoting_source().get();
+}
+
+} // namespace media
« no previous file with comments | « media/remoting/remoting_cdm.h ('k') | media/remoting/remoting_cdm_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698