OLD | NEW |
(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_context.h" |
| 6 |
| 7 #include "media/remoting/remoting_cdm.h" |
| 8 #include "media/remoting/remoting_source_impl.h" |
| 9 |
| 10 namespace media { |
| 11 |
| 12 namespace { |
| 13 // Used as an identifier for RemotingCdmContext::From(). |
| 14 void* const kClassIdentifier = const_cast<void**>(&kClassIdentifier); |
| 15 } // namespace |
| 16 |
| 17 // TODO(xjz): Merge this with erickung's implementation. |
| 18 RemotingCdmContext::RemotingCdmContext(RemotingCdm* remoting_cdm) |
| 19 : remoting_cdm_(remoting_cdm) {} |
| 20 |
| 21 RemotingCdmContext::~RemotingCdmContext() {} |
| 22 |
| 23 RemotingCdmContext* RemotingCdmContext::From(CdmContext* cdm_context) { |
| 24 if (cdm_context && cdm_context->GetClassIdentifier() == kClassIdentifier) |
| 25 return static_cast<RemotingCdmContext*>(cdm_context); |
| 26 return nullptr; |
| 27 } |
| 28 |
| 29 Decryptor* RemotingCdmContext::GetDecryptor() { |
| 30 // TODO(xjz): Merge with erickung's implementation. |
| 31 return nullptr; |
| 32 } |
| 33 |
| 34 int RemotingCdmContext::GetCdmId() const { |
| 35 // TODO(xjz): Merge with erickung's implementation. |
| 36 return CdmContext::kInvalidCdmId; |
| 37 } |
| 38 |
| 39 void* RemotingCdmContext::GetClassIdentifier() const { |
| 40 return kClassIdentifier; |
| 41 } |
| 42 |
| 43 RemotingSourceImpl* RemotingCdmContext::GetRemotingSource() { |
| 44 return remoting_cdm_->GetRemotingSource(); |
| 45 } |
| 46 |
| 47 } // namespace media |
OLD | NEW |