OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CDM_PPAPI_CLEAR_KEY_CDM_H_ | 5 #ifndef MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_H_ |
6 #define MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_H_ | 6 #define MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 const cdm::PlatformChallengeResponse& response) OVERRIDE; | 65 const cdm::PlatformChallengeResponse& response) OVERRIDE; |
66 virtual void OnQueryOutputProtectionStatus( | 66 virtual void OnQueryOutputProtectionStatus( |
67 uint32_t link_mask, uint32_t output_protection_mask) OVERRIDE; | 67 uint32_t link_mask, uint32_t output_protection_mask) OVERRIDE; |
68 | 68 |
69 private: | 69 private: |
70 // TODO(xhwang): After we removed DecryptorClient. We probably can also remove | 70 // TODO(xhwang): After we removed DecryptorClient. We probably can also remove |
71 // this Client class as well. Investigate this possibility. | 71 // this Client class as well. Investigate this possibility. |
72 class Client { | 72 class Client { |
73 public: | 73 public: |
74 // TODO(jrummell): Remove bitmask and rename kNone to kInvalid once CDM | 74 // TODO(jrummell): Remove bitmask and rename kNone to kInvalid once CDM |
75 // interface supports reference_id passing completely. | 75 // interface supports session_id passing completely. |
76 enum Status { | 76 enum Status { |
77 kNone = 0, | 77 kNone = 0, |
78 kCreated = 1 << 0, | 78 kCreated = 1 << 0, |
79 kMessage = 1 << 1, | 79 kMessage = 1 << 1, |
80 kReady = 1 << 2, | 80 kReady = 1 << 2, |
81 kClosed = 1 << 3, | 81 kClosed = 1 << 3, |
82 kError = 1 << 4 | 82 kError = 1 << 4 |
83 }; | 83 }; |
84 | 84 |
85 Client(); | 85 Client(); |
86 virtual ~Client(); | 86 virtual ~Client(); |
87 | 87 |
88 Status status() { return status_; } | 88 Status status() { return status_; } |
89 const std::string& session_id() { return session_id_; } | 89 const std::string& web_session_id() { return web_session_id_; } |
90 const std::vector<uint8>& message() { return message_; } | 90 const std::vector<uint8>& message() { return message_; } |
91 const std::string& destination_url() { return destination_url_; } | 91 const std::string& destination_url() { return destination_url_; } |
92 MediaKeys::KeyError error_code() { return error_code_; } | 92 MediaKeys::KeyError error_code() { return error_code_; } |
93 int system_code() { return system_code_; } | 93 int system_code() { return system_code_; } |
94 | 94 |
95 // Resets the Client to a clean state. | 95 // Resets the Client to a clean state. |
96 void Reset(); | 96 void Reset(); |
97 | 97 |
98 void OnSessionCreated(uint32 reference_id, const std::string& session_id); | 98 void OnSessionCreated(uint32 session_id, const std::string& web_session_id); |
99 void OnSessionMessage(uint32 reference_id, | 99 void OnSessionMessage(uint32 session_id, |
100 const std::vector<uint8>& message, | 100 const std::vector<uint8>& message, |
101 const std::string& destination_url); | 101 const std::string& destination_url); |
102 void OnSessionReady(uint32 reference_id); | 102 void OnSessionReady(uint32 session_id); |
103 void OnSessionClosed(uint32 reference_id); | 103 void OnSessionClosed(uint32 session_id); |
104 void OnSessionError(uint32 reference_id, | 104 void OnSessionError(uint32 session_id, |
105 MediaKeys::KeyError error_code, | 105 MediaKeys::KeyError error_code, |
106 int system_code); | 106 int system_code); |
107 | 107 |
108 private: | 108 private: |
109 Status status_; | 109 Status status_; |
110 std::string session_id_; | 110 std::string web_session_id_; |
111 std::vector<uint8> message_; | 111 std::vector<uint8> message_; |
112 std::string destination_url_; | 112 std::string destination_url_; |
113 MediaKeys::KeyError error_code_; | 113 MediaKeys::KeyError error_code_; |
114 int system_code_; | 114 int system_code_; |
115 }; | 115 }; |
116 | 116 |
117 // Prepares next heartbeat message and sets a timer for it. | 117 // Prepares next heartbeat message and sets a timer for it. |
118 void ScheduleNextHeartBeat(); | 118 void ScheduleNextHeartBeat(); |
119 | 119 |
120 // Decrypts the |encrypted_buffer| and puts the result in |decrypted_buffer|. | 120 // Decrypts the |encrypted_buffer| and puts the result in |decrypted_buffer|. |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER | 177 #endif // CLEAR_KEY_CDM_USE_FFMPEG_DECODER |
178 | 178 |
179 scoped_ptr<CdmVideoDecoder> video_decoder_; | 179 scoped_ptr<CdmVideoDecoder> video_decoder_; |
180 | 180 |
181 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); | 181 DISALLOW_COPY_AND_ASSIGN(ClearKeyCdm); |
182 }; | 182 }; |
183 | 183 |
184 } // namespace media | 184 } // namespace media |
185 | 185 |
186 #endif // MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_H_ | 186 #endif // MEDIA_CDM_PPAPI_CLEAR_KEY_CDM_H_ |
OLD | NEW |