OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 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_REMOTING_REMOTING_CDM_CONTEXT_H_ | 5 #ifndef MEDIA_REMOTING_REMOTING_CDM_CONTEXT_H_ |
6 #define MEDIA_REMOTING_REMOTING_CDM_CONTEXT_H_ | 6 #define MEDIA_REMOTING_REMOTING_CDM_CONTEXT_H_ |
7 | 7 |
8 #include "media/base/cdm_context.h" | 8 #include "media/base/cdm_context.h" |
9 | 9 |
10 namespace media { | 10 namespace media { |
| 11 namespace remoting { |
11 | 12 |
12 class RemotingCdm; | 13 class RemotingCdm; |
13 class RemotingSourceImpl; | |
14 | 14 |
15 // TODO(xjz): Merge this with erickung's implementation. | 15 // TODO(xjz): Merge this with erickung's implementation. |
| 16 // TODO(miu): This class should just be merged into RemotingCdm and implement |
| 17 // both the CDM and CdmContext interfaces. |
16 class RemotingCdmContext : public CdmContext { | 18 class RemotingCdmContext : public CdmContext { |
17 public: | 19 public: |
18 explicit RemotingCdmContext(RemotingCdm* remoting_cdm); | 20 explicit RemotingCdmContext(RemotingCdm* remoting_cdm); |
19 ~RemotingCdmContext() override; | 21 ~RemotingCdmContext() override; |
20 | 22 |
21 // If |cdm_context| is an instance of RemotingCdmContext, return a type-casted | 23 // If |cdm_context| is an instance of RemotingCdmContext, return a type-casted |
22 // pointer to it. Otherwise, return nullptr. | 24 // pointer to it. Otherwise, return nullptr. |
23 static RemotingCdmContext* From(CdmContext* cdm_context); | 25 static RemotingCdmContext* From(CdmContext* cdm_context); |
24 | 26 |
25 RemotingSourceImpl* GetRemotingSource(); | 27 RemotingCdm* cdm() const { return remoting_cdm_; } |
26 | 28 |
27 // CdmContext implementations. | 29 // CdmContext implementations. |
28 Decryptor* GetDecryptor() override; | 30 Decryptor* GetDecryptor() override; |
29 int GetCdmId() const override; | 31 int GetCdmId() const override; |
30 void* GetClassIdentifier() const override; | 32 void* GetClassIdentifier() const override; |
31 | 33 |
32 private: | 34 private: |
33 RemotingCdm* const remoting_cdm_; // Outlives this class. | 35 RemotingCdm* const remoting_cdm_; // Outlives this class. |
34 | 36 |
35 DISALLOW_COPY_AND_ASSIGN(RemotingCdmContext); | 37 DISALLOW_COPY_AND_ASSIGN(RemotingCdmContext); |
36 }; | 38 }; |
37 | 39 |
| 40 } // namespace remoting |
38 } // namespace media | 41 } // namespace media |
39 | 42 |
40 #endif // MEDIA_REMOTING_REMOTING_CDM_CONTEXT_H_ | 43 #endif // MEDIA_REMOTING_REMOTING_CDM_CONTEXT_H_ |
OLD | NEW |