OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_BASE_CDM_CONTEXT_H_ |
| 6 #define MEDIA_BASE_CDM_CONTEXT_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "media/base/media_export.h" |
| 10 |
| 11 namespace media { |
| 12 |
| 13 class Decryptor; |
| 14 |
| 15 // An interface representing the context that a media pipeline needs from a |
| 16 // content decryption module (CDM) to decrypt (and decode) encrypted buffers. |
| 17 class MEDIA_EXPORT CdmContext { |
| 18 public: |
| 19 #if defined(ENABLE_BROWSER_CDMS) |
| 20 static const int kInvalidCdmId = 0; |
| 21 #endif |
| 22 |
| 23 virtual ~CdmContext(); |
| 24 |
| 25 // Gets the Decryptor object associated with the CDM. Returns NULL if no |
| 26 // Decryptor object is associated. The returned object is only guaranteed |
| 27 // to be valid during the CDM's lifetime. |
| 28 virtual Decryptor* GetDecryptor() = 0; |
| 29 |
| 30 #if defined(ENABLE_BROWSER_CDMS) |
| 31 // Returns the CDM ID associated with |this|. May be kInvalidCdmId if no CDM |
| 32 // ID is associated. |
| 33 virtual int GetCdmId() const = 0; |
| 34 #endif |
| 35 |
| 36 protected: |
| 37 CdmContext(); |
| 38 |
| 39 private: |
| 40 DISALLOW_COPY_AND_ASSIGN(CdmContext); |
| 41 }; |
| 42 |
| 43 } // namespace media |
| 44 |
| 45 #endif // MEDIA_BASE_CDM_CONTEXT_H_ |
OLD | NEW |