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 CHROMECAST_MEDIA_CDM_cast_cdm_H_ | 5 #ifndef CHROMECAST_MEDIA_CDM_cast_cdm_H_ |
6 #define CHROMECAST_MEDIA_CDM_cast_cdm_H_ | 6 #define CHROMECAST_MEDIA_CDM_cast_cdm_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 // thread, | 43 // thread, |
44 // - or CastCdm implementations must use some locks. | 44 // - or CastCdm implementations must use some locks. |
45 // | 45 // |
46 class CastCdm : public ::media::MediaKeys { | 46 class CastCdm : public ::media::MediaKeys { |
47 public: | 47 public: |
48 explicit CastCdm(MediaResourceTracker* media_resource_tracker); | 48 explicit CastCdm(MediaResourceTracker* media_resource_tracker); |
49 | 49 |
50 void Initialize( | 50 void Initialize( |
51 const ::media::SessionMessageCB& session_message_cb, | 51 const ::media::SessionMessageCB& session_message_cb, |
52 const ::media::SessionClosedCB& session_closed_cb, | 52 const ::media::SessionClosedCB& session_closed_cb, |
53 const ::media::LegacySessionErrorCB& legacy_session_error_cb, | |
54 const ::media::SessionKeysChangeCB& session_keys_change_cb, | 53 const ::media::SessionKeysChangeCB& session_keys_change_cb, |
55 const ::media::SessionExpirationUpdateCB& session_expiration_update_cb); | 54 const ::media::SessionExpirationUpdateCB& session_expiration_update_cb); |
56 | 55 |
57 int RegisterPlayer(const base::Closure& new_key_cb, | 56 int RegisterPlayer(const base::Closure& new_key_cb, |
58 const base::Closure& cdm_unset_cb); | 57 const base::Closure& cdm_unset_cb); |
59 void UnregisterPlayer(int registration_id); | 58 void UnregisterPlayer(int registration_id); |
60 | 59 |
61 // Returns the decryption context needed to decrypt frames encrypted with | 60 // Returns the decryption context needed to decrypt frames encrypted with |
62 // |key_id|. Returns null if |key_id| is not available. | 61 // |key_id|. Returns null if |key_id| is not available. |
63 virtual std::unique_ptr<DecryptContextImpl> GetDecryptContext( | 62 virtual std::unique_ptr<DecryptContextImpl> GetDecryptContext( |
(...skipping 22 matching lines...) Expand all Loading... |
86 void KeyIdAndKeyPairsToInfo(const ::media::KeyIdAndKeyPairs& keys, | 85 void KeyIdAndKeyPairsToInfo(const ::media::KeyIdAndKeyPairs& keys, |
87 ::media::CdmKeysInfo* key_info); | 86 ::media::CdmKeysInfo* key_info); |
88 | 87 |
89 private: | 88 private: |
90 // Allow subclasses to override to provide key sysytem specific | 89 // Allow subclasses to override to provide key sysytem specific |
91 // initialization. | 90 // initialization. |
92 virtual void InitializeInternal(); | 91 virtual void InitializeInternal(); |
93 | 92 |
94 ::media::SessionMessageCB session_message_cb_; | 93 ::media::SessionMessageCB session_message_cb_; |
95 ::media::SessionClosedCB session_closed_cb_; | 94 ::media::SessionClosedCB session_closed_cb_; |
96 ::media::LegacySessionErrorCB legacy_session_error_cb_; | |
97 ::media::SessionKeysChangeCB session_keys_change_cb_; | 95 ::media::SessionKeysChangeCB session_keys_change_cb_; |
98 ::media::SessionExpirationUpdateCB session_expiration_update_cb_; | 96 ::media::SessionExpirationUpdateCB session_expiration_update_cb_; |
99 | 97 |
100 MediaResourceTracker* media_resource_tracker_; | 98 MediaResourceTracker* media_resource_tracker_; |
101 std::unique_ptr<::media::PlayerTrackerImpl> player_tracker_impl_; | 99 std::unique_ptr<::media::PlayerTrackerImpl> player_tracker_impl_; |
102 std::unique_ptr<CastCdmContext> cast_cdm_context_; | 100 std::unique_ptr<CastCdmContext> cast_cdm_context_; |
103 | 101 |
104 base::ThreadChecker thread_checker_; | 102 base::ThreadChecker thread_checker_; |
105 | 103 |
106 DISALLOW_COPY_AND_ASSIGN(CastCdm); | 104 DISALLOW_COPY_AND_ASSIGN(CastCdm); |
107 }; | 105 }; |
108 | 106 |
109 } // namespace media | 107 } // namespace media |
110 } // namespace chromecast | 108 } // namespace chromecast |
111 | 109 |
112 #endif // CHROMECAST_MEDIA_CDM_cast_cdm_H_ | 110 #endif // CHROMECAST_MEDIA_CDM_cast_cdm_H_ |
OLD | NEW |