| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 Send(new MediaPlayerHostMsg_ExitFullscreen(routing_id(), player_id)); | 176 Send(new MediaPlayerHostMsg_ExitFullscreen(routing_id(), player_id)); |
| 177 } | 177 } |
| 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::InitializeCDM( |
| 187 int media_keys_id, |
| 188 const std::vector<uint8>& uuid) { |
| 189 Send(new MediaPlayerHostMsg_InitializeCDM(routing_id(), media_keys_id, uuid)); |
| 190 } |
| 191 |
| 186 void WebMediaPlayerProxyImplAndroid::GenerateKeyRequest( | 192 void WebMediaPlayerProxyImplAndroid::GenerateKeyRequest( |
| 187 int player_id, | 193 int media_keys_id, |
| 188 const std::string& type, | 194 const std::string& type, |
| 189 const std::vector<uint8>& init_data) { | 195 const std::vector<uint8>& init_data) { |
| 190 Send(new MediaPlayerHostMsg_GenerateKeyRequest( | 196 Send(new MediaPlayerHostMsg_GenerateKeyRequest( |
| 191 routing_id(), player_id, type, init_data)); | 197 routing_id(), media_keys_id, type, init_data)); |
| 192 } | 198 } |
| 193 | 199 |
| 194 void WebMediaPlayerProxyImplAndroid::AddKey(int player_id, | 200 void WebMediaPlayerProxyImplAndroid::AddKey(int media_keys_id, |
| 195 const std::vector<uint8>& key, | 201 const std::vector<uint8>& key, |
| 196 const std::vector<uint8>& init_data, | 202 const std::vector<uint8>& init_data, |
| 197 const std::string& session_id) { | 203 const std::string& session_id) { |
| 198 Send(new MediaPlayerHostMsg_AddKey( | 204 Send(new MediaPlayerHostMsg_AddKey( |
| 199 routing_id(), player_id, key, init_data, session_id)); | 205 routing_id(), media_keys_id, key, init_data, session_id)); |
| 200 } | 206 } |
| 201 | 207 |
| 202 void WebMediaPlayerProxyImplAndroid::CancelKeyRequest( | 208 void WebMediaPlayerProxyImplAndroid::CancelKeyRequest( |
| 203 int player_id, | 209 int media_keys_id, |
| 204 const std::string& session_id) { | 210 const std::string& session_id) { |
| 205 Send(new MediaPlayerHostMsg_CancelKeyRequest( | 211 Send(new MediaPlayerHostMsg_CancelKeyRequest( |
| 206 routing_id(), player_id, session_id)); | 212 routing_id(), media_keys_id, session_id)); |
| 207 } | 213 } |
| 208 | 214 |
| 209 #if defined(GOOGLE_TV) | 215 #if defined(GOOGLE_TV) |
| 210 void WebMediaPlayerProxyImplAndroid::RequestExternalSurface( | 216 void WebMediaPlayerProxyImplAndroid::RequestExternalSurface( |
| 211 int player_id, const gfx::RectF& geometry) { | 217 int player_id, const gfx::RectF& geometry) { |
| 212 Send(new MediaPlayerHostMsg_NotifyExternalSurface( | 218 Send(new MediaPlayerHostMsg_NotifyExternalSurface( |
| 213 routing_id(), player_id, true, geometry)); | 219 routing_id(), player_id, true, geometry)); |
| 214 } | 220 } |
| 215 | 221 |
| 216 void WebMediaPlayerProxyImplAndroid::DidCommitCompositorFrame() { | 222 void WebMediaPlayerProxyImplAndroid::DidCommitCompositorFrame() { |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 player->OnMediaSeekRequest(time_to_seek); | 267 player->OnMediaSeekRequest(time_to_seek); |
| 262 } | 268 } |
| 263 } | 269 } |
| 264 | 270 |
| 265 void WebMediaPlayerProxyImplAndroid::OnMediaConfigRequest(int player_id) { | 271 void WebMediaPlayerProxyImplAndroid::OnMediaConfigRequest(int player_id) { |
| 266 webkit_media::WebMediaPlayerAndroid* player = GetWebMediaPlayer(player_id); | 272 webkit_media::WebMediaPlayerAndroid* player = GetWebMediaPlayer(player_id); |
| 267 if (player) | 273 if (player) |
| 268 player->OnMediaConfigRequest(); | 274 player->OnMediaConfigRequest(); |
| 269 } | 275 } |
| 270 | 276 |
| 271 void WebMediaPlayerProxyImplAndroid::OnKeyAdded(int player_id, | 277 void WebMediaPlayerProxyImplAndroid::OnKeyAdded(int media_keys_id, |
| 272 const std::string& session_id) { | 278 const std::string& session_id) { |
| 273 webkit_media::WebMediaPlayerAndroid* player = GetWebMediaPlayer(player_id); | 279 webkit_media::WebMediaPlayerAndroid* player = |
| 280 GetWebMediaPlayer(media_keys_id); |
| 274 if (player) | 281 if (player) |
| 275 player->OnKeyAdded(session_id); | 282 player->OnKeyAdded(session_id); |
| 276 } | 283 } |
| 277 | 284 |
| 278 void WebMediaPlayerProxyImplAndroid::OnKeyError( | 285 void WebMediaPlayerProxyImplAndroid::OnKeyError( |
| 279 int player_id, | 286 int media_keys_id, |
| 280 const std::string& session_id, | 287 const std::string& session_id, |
| 281 media::MediaKeys::KeyError error_code, | 288 media::MediaKeys::KeyError error_code, |
| 282 int system_code) { | 289 int system_code) { |
| 283 webkit_media::WebMediaPlayerAndroid* player = GetWebMediaPlayer(player_id); | 290 webkit_media::WebMediaPlayerAndroid* player = |
| 291 GetWebMediaPlayer(media_keys_id); |
| 284 if (player) | 292 if (player) |
| 285 player->OnKeyError(session_id, error_code, system_code); | 293 player->OnKeyError(session_id, error_code, system_code); |
| 286 } | 294 } |
| 287 | 295 |
| 288 void WebMediaPlayerProxyImplAndroid::OnKeyMessage( | 296 void WebMediaPlayerProxyImplAndroid::OnKeyMessage( |
| 289 int player_id, | 297 int media_keys_id, |
| 290 const std::string& session_id, | 298 const std::string& session_id, |
| 291 const std::string& message, | 299 const std::string& message, |
| 292 const std::string& destination_url) { | 300 const std::string& destination_url) { |
| 293 webkit_media::WebMediaPlayerAndroid* player = GetWebMediaPlayer(player_id); | 301 webkit_media::WebMediaPlayerAndroid* player = |
| 302 GetWebMediaPlayer(media_keys_id); |
| 294 if (player) | 303 if (player) |
| 295 player->OnKeyMessage(session_id, message, destination_url); | 304 player->OnKeyMessage(session_id, message, destination_url); |
| 296 } | 305 } |
| 297 | 306 |
| 298 } // namespace content | 307 } // namespace content |
| OLD | NEW |