OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_BASE_CDM_CONTEXT_H_ | 5 #ifndef MEDIA_BASE_CDM_CONTEXT_H_ |
6 #define MEDIA_BASE_CDM_CONTEXT_H_ | 6 #define MEDIA_BASE_CDM_CONTEXT_H_ |
7 | 7 |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
11 | 11 |
12 namespace media { | 12 namespace media { |
13 | 13 |
14 class Decryptor; | 14 class Decryptor; |
15 | 15 |
16 // An interface representing the context that a media player needs from a | 16 // An interface representing the context that a media player needs from a |
17 // content decryption module (CDM) to decrypt (and decode) encrypted buffers. | 17 // content decryption module (CDM) to decrypt (and decode) encrypted buffers. |
18 // This is used to pass the CDM to the media player (e.g. SetCdm()). | 18 // This is used to pass the CDM to the media player (e.g. SetCdm()). |
19 class MEDIA_EXPORT CdmContext { | 19 class MEDIA_EXPORT CdmContext { |
20 public: | 20 public: |
21 // Indicates an invalid CDM ID. See GetCdmId() for details. | 21 // Indicates an invalid CDM ID. See GetCdmId() for details. |
22 static const int kInvalidCdmId; | 22 enum { kInvalidCdmId = 0 }; |
23 | 23 |
24 virtual ~CdmContext(); | 24 virtual ~CdmContext(); |
25 | 25 |
26 // Gets the Decryptor object associated with the CDM. Returns nullptr if the | 26 // Gets the Decryptor object associated with the CDM. Returns nullptr if the |
27 // CDM does not support a Decryptor (i.e. platform-based CDMs where decryption | 27 // CDM does not support a Decryptor (i.e. platform-based CDMs where decryption |
28 // occurs implicitly along with decoding). The returned object is only | 28 // occurs implicitly along with decoding). The returned object is only |
29 // guaranteed to be valid during the CDM's lifetime. | 29 // guaranteed to be valid during the CDM's lifetime. |
30 virtual Decryptor* GetDecryptor() = 0; | 30 virtual Decryptor* GetDecryptor() = 0; |
31 | 31 |
32 // Returns an ID that can be used to find a remote CDM, in which case this CDM | 32 // Returns an ID that can be used to find a remote CDM, in which case this CDM |
(...skipping 15 matching lines...) Expand all Loading... |
48 // Callback to notify that the CdmContext has been completely attached to | 48 // Callback to notify that the CdmContext has been completely attached to |
49 // the media pipeline. Parameter indicates whether the operation succeeded. | 49 // the media pipeline. Parameter indicates whether the operation succeeded. |
50 typedef base::Callback<void(bool)> CdmAttachedCB; | 50 typedef base::Callback<void(bool)> CdmAttachedCB; |
51 | 51 |
52 // A dummy implementation of CdmAttachedCB. | 52 // A dummy implementation of CdmAttachedCB. |
53 MEDIA_EXPORT void IgnoreCdmAttached(bool success); | 53 MEDIA_EXPORT void IgnoreCdmAttached(bool success); |
54 | 54 |
55 } // namespace media | 55 } // namespace media |
56 | 56 |
57 #endif // MEDIA_BASE_CDM_CONTEXT_H_ | 57 #endif // MEDIA_BASE_CDM_CONTEXT_H_ |
OLD | NEW |