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" |
(...skipping 16 matching lines...) Expand all Loading... |
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 |
33 // serves as a proxy to the remote one. Returns kInvalidCdmId when remote CDM | 33 // serves as a proxy to the remote one. Returns kInvalidCdmId when remote CDM |
34 // is not supported (e.g. this CDM is a local CDM). | 34 // is not supported (e.g. this CDM is a local CDM). |
35 virtual int GetCdmId() const = 0; | 35 virtual int GetCdmId() const = 0; |
36 | 36 |
| 37 // Returns a unique class identifier. Some subclasses override and use this |
| 38 // method to provide safe down-casting to their type. |
| 39 virtual void* GetClassIdentifier() const; |
| 40 |
37 protected: | 41 protected: |
38 CdmContext(); | 42 CdmContext(); |
39 | 43 |
40 private: | 44 private: |
41 DISALLOW_COPY_AND_ASSIGN(CdmContext); | 45 DISALLOW_COPY_AND_ASSIGN(CdmContext); |
42 }; | 46 }; |
43 | 47 |
44 // Callback to notify that the CdmContext has been completely attached to | 48 // Callback to notify that the CdmContext has been completely attached to |
45 // the media pipeline. Parameter indicates whether the operation succeeded. | 49 // the media pipeline. Parameter indicates whether the operation succeeded. |
46 typedef base::Callback<void(bool)> CdmAttachedCB; | 50 typedef base::Callback<void(bool)> CdmAttachedCB; |
47 | 51 |
48 // A dummy implementation of CdmAttachedCB. | 52 // A dummy implementation of CdmAttachedCB. |
49 MEDIA_EXPORT void IgnoreCdmAttached(bool success); | 53 MEDIA_EXPORT void IgnoreCdmAttached(bool success); |
50 | 54 |
51 } // namespace media | 55 } // namespace media |
52 | 56 |
53 #endif // MEDIA_BASE_CDM_CONTEXT_H_ | 57 #endif // MEDIA_BASE_CDM_CONTEXT_H_ |
OLD | NEW |