| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "content/renderer/media/webmediaplayer_proxy_impl_android.h" | 5 #include "content/renderer/media/webmediaplayer_proxy_impl_android.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "content/common/media/media_player_messages_android.h" | 9 #include "content/common/media/media_player_messages_android.h" |
| 10 #include "webkit/renderer/media/android/webmediaplayer_android.h" | 10 #include "webkit/renderer/media/android/webmediaplayer_android.h" |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 | 178 |
| 179 void WebMediaPlayerProxyImplAndroid::ReadFromDemuxerAck( | 179 void WebMediaPlayerProxyImplAndroid::ReadFromDemuxerAck( |
| 180 int player_id, | 180 int player_id, |
| 181 const media::MediaPlayerHostMsg_ReadFromDemuxerAck_Params& params) { | 181 const media::MediaPlayerHostMsg_ReadFromDemuxerAck_Params& params) { |
| 182 Send(new MediaPlayerHostMsg_ReadFromDemuxerAck( | 182 Send(new MediaPlayerHostMsg_ReadFromDemuxerAck( |
| 183 routing_id(), player_id, params)); | 183 routing_id(), player_id, params)); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void WebMediaPlayerProxyImplAndroid::GenerateKeyRequest( | 186 void WebMediaPlayerProxyImplAndroid::GenerateKeyRequest( |
| 187 int player_id, | 187 int player_id, |
| 188 const std::string& key_system, | |
| 189 const std::string& type, | 188 const std::string& type, |
| 190 const std::vector<uint8>& init_data) { | 189 const std::vector<uint8>& init_data) { |
| 191 Send(new MediaPlayerHostMsg_GenerateKeyRequest( | 190 Send(new MediaPlayerHostMsg_GenerateKeyRequest( |
| 192 routing_id(), player_id, key_system, type, init_data)); | 191 routing_id(), player_id, type, init_data)); |
| 193 } | 192 } |
| 194 | 193 |
| 195 void WebMediaPlayerProxyImplAndroid::AddKey(int player_id, | 194 void WebMediaPlayerProxyImplAndroid::AddKey(int player_id, |
| 196 const std::string& key_system, | |
| 197 const std::vector<uint8>& key, | 195 const std::vector<uint8>& key, |
| 198 const std::vector<uint8>& init_data, | 196 const std::vector<uint8>& init_data, |
| 199 const std::string& session_id) { | 197 const std::string& session_id) { |
| 200 Send(new MediaPlayerHostMsg_AddKey( | 198 Send(new MediaPlayerHostMsg_AddKey( |
| 201 routing_id(), player_id, key_system, key, init_data, session_id)); | 199 routing_id(), player_id, key, init_data, session_id)); |
| 202 } | 200 } |
| 203 | 201 |
| 204 void WebMediaPlayerProxyImplAndroid::CancelKeyRequest( | 202 void WebMediaPlayerProxyImplAndroid::CancelKeyRequest( |
| 205 int player_id, | 203 int player_id, |
| 206 const std::string& key_system, | |
| 207 const std::string& session_id) { | 204 const std::string& session_id) { |
| 208 Send(new MediaPlayerHostMsg_CancelKeyRequest( | 205 Send(new MediaPlayerHostMsg_CancelKeyRequest( |
| 209 routing_id(), player_id, key_system, session_id)); | 206 routing_id(), player_id, session_id)); |
| 210 } | 207 } |
| 211 | 208 |
| 212 #if defined(GOOGLE_TV) | 209 #if defined(GOOGLE_TV) |
| 213 void WebMediaPlayerProxyImplAndroid::RequestExternalSurface( | 210 void WebMediaPlayerProxyImplAndroid::RequestExternalSurface( |
| 214 int player_id, const gfx::RectF& geometry) { | 211 int player_id, const gfx::RectF& geometry) { |
| 215 Send(new MediaPlayerHostMsg_NotifyExternalSurface( | 212 Send(new MediaPlayerHostMsg_NotifyExternalSurface( |
| 216 routing_id(), player_id, true, geometry)); | 213 routing_id(), player_id, true, geometry)); |
| 217 } | 214 } |
| 218 | 215 |
| 219 void WebMediaPlayerProxyImplAndroid::DidCommitCompositorFrame() { | 216 void WebMediaPlayerProxyImplAndroid::DidCommitCompositorFrame() { |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 } | 262 } |
| 266 } | 263 } |
| 267 | 264 |
| 268 void WebMediaPlayerProxyImplAndroid::OnMediaConfigRequest(int player_id) { | 265 void WebMediaPlayerProxyImplAndroid::OnMediaConfigRequest(int player_id) { |
| 269 webkit_media::WebMediaPlayerAndroid* player = GetWebMediaPlayer(player_id); | 266 webkit_media::WebMediaPlayerAndroid* player = GetWebMediaPlayer(player_id); |
| 270 if (player) | 267 if (player) |
| 271 player->OnMediaConfigRequest(); | 268 player->OnMediaConfigRequest(); |
| 272 } | 269 } |
| 273 | 270 |
| 274 void WebMediaPlayerProxyImplAndroid::OnKeyAdded(int player_id, | 271 void WebMediaPlayerProxyImplAndroid::OnKeyAdded(int player_id, |
| 275 const std::string& key_system, | |
| 276 const std::string& session_id) { | 272 const std::string& session_id) { |
| 277 webkit_media::WebMediaPlayerAndroid* player = GetWebMediaPlayer(player_id); | 273 webkit_media::WebMediaPlayerAndroid* player = GetWebMediaPlayer(player_id); |
| 278 if (player) | 274 if (player) |
| 279 player->OnKeyAdded(key_system, session_id); | 275 player->OnKeyAdded(session_id); |
| 280 } | 276 } |
| 281 | 277 |
| 282 void WebMediaPlayerProxyImplAndroid::OnKeyError( | 278 void WebMediaPlayerProxyImplAndroid::OnKeyError( |
| 283 int player_id, | 279 int player_id, |
| 284 const std::string& key_system, | |
| 285 const std::string& session_id, | 280 const std::string& session_id, |
| 286 media::MediaKeys::KeyError error_code, | 281 media::MediaKeys::KeyError error_code, |
| 287 int system_code) { | 282 int system_code) { |
| 288 webkit_media::WebMediaPlayerAndroid* player = GetWebMediaPlayer(player_id); | 283 webkit_media::WebMediaPlayerAndroid* player = GetWebMediaPlayer(player_id); |
| 289 if (player) | 284 if (player) |
| 290 player->OnKeyError(key_system, session_id, error_code, system_code); | 285 player->OnKeyError(session_id, error_code, system_code); |
| 291 } | 286 } |
| 292 | 287 |
| 293 void WebMediaPlayerProxyImplAndroid::OnKeyMessage( | 288 void WebMediaPlayerProxyImplAndroid::OnKeyMessage( |
| 294 int player_id, | 289 int player_id, |
| 295 const std::string& key_system, | |
| 296 const std::string& session_id, | 290 const std::string& session_id, |
| 297 const std::string& message, | 291 const std::string& message, |
| 298 const std::string& destination_url) { | 292 const std::string& destination_url) { |
| 299 webkit_media::WebMediaPlayerAndroid* player = GetWebMediaPlayer(player_id); | 293 webkit_media::WebMediaPlayerAndroid* player = GetWebMediaPlayer(player_id); |
| 300 if (player) | 294 if (player) |
| 301 player->OnKeyMessage(key_system, session_id, message, destination_url); | 295 player->OnKeyMessage(session_id, message, destination_url); |
| 302 } | 296 } |
| 303 | 297 |
| 304 } // namespace content | 298 } // namespace content |
| OLD | NEW |