Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(292)

Side by Side Diff: content/browser/media/android/browser_media_player_manager.cc

Issue 181903003: Reland r253665 "Rename MediaKeys*Msg to Cdm*Msg." (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "content/browser/media/android/browser_media_player_manager.h" 5 #include "content/browser/media/android/browser_media_player_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "content/browser/android/content_view_core_impl.h" 8 #include "content/browser/android/content_view_core_impl.h"
9 #include "content/browser/media/android/browser_demuxer_android.h" 9 #include "content/browser/media/android/browser_demuxer_android.h"
10 #include "content/browser/media/android/media_resource_getter_impl.h" 10 #include "content/browser/media/android/media_resource_getter_impl.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_Initialize, OnInitialize) 132 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_Initialize, OnInitialize)
133 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_Start, OnStart) 133 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_Start, OnStart)
134 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_Seek, OnSeek) 134 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_Seek, OnSeek)
135 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_Pause, OnPause) 135 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_Pause, OnPause)
136 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_SetVolume, OnSetVolume) 136 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_SetVolume, OnSetVolume)
137 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_SetPoster, OnSetPoster) 137 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_SetPoster, OnSetPoster)
138 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_Release, OnReleaseResources) 138 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_Release, OnReleaseResources)
139 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_DestroyMediaPlayer, OnDestroyPlayer) 139 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_DestroyMediaPlayer, OnDestroyPlayer)
140 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_DestroyAllMediaPlayers, 140 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_DestroyAllMediaPlayers,
141 DestroyAllMediaPlayers) 141 DestroyAllMediaPlayers)
142 IPC_MESSAGE_HANDLER(MediaKeysHostMsg_InitializeCDM, 142 IPC_MESSAGE_HANDLER(CdmHostMsg_InitializeCDM, OnInitializeCDM)
143 OnInitializeCDM) 143 IPC_MESSAGE_HANDLER(CdmHostMsg_CreateSession, OnCreateSession)
144 IPC_MESSAGE_HANDLER(MediaKeysHostMsg_CreateSession, OnCreateSession) 144 IPC_MESSAGE_HANDLER(CdmHostMsg_UpdateSession, OnUpdateSession)
145 IPC_MESSAGE_HANDLER(MediaKeysHostMsg_UpdateSession, OnUpdateSession) 145 IPC_MESSAGE_HANDLER(CdmHostMsg_ReleaseSession, OnReleaseSession)
146 IPC_MESSAGE_HANDLER(MediaKeysHostMsg_ReleaseSession, OnReleaseSession) 146 IPC_MESSAGE_HANDLER(CdmHostMsg_DestroyCdm, OnDestroyCdm)
147 IPC_MESSAGE_HANDLER(MediaKeysHostMsg_DestroyCdm, OnDestroyCdm)
148 #if defined(VIDEO_HOLE) 147 #if defined(VIDEO_HOLE)
149 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_NotifyExternalSurface, 148 IPC_MESSAGE_HANDLER(MediaPlayerHostMsg_NotifyExternalSurface,
150 OnNotifyExternalSurface) 149 OnNotifyExternalSurface)
151 #endif // defined(VIDEO_HOLE) 150 #endif // defined(VIDEO_HOLE)
152 IPC_MESSAGE_UNHANDLED(handled = false) 151 IPC_MESSAGE_UNHANDLED(handled = false)
153 IPC_END_MESSAGE_MAP() 152 IPC_END_MESSAGE_MAP()
154 return handled; 153 return handled;
155 } 154 }
156 155
157 void BrowserMediaPlayerManager::FullscreenPlayerPlay() { 156 void BrowserMediaPlayerManager::FullscreenPlayerPlay() {
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 Send(new MediaPlayerMsg_RequestFullscreen(routing_id(), player_id)); 408 Send(new MediaPlayerMsg_RequestFullscreen(routing_id(), player_id));
410 } 409 }
411 } 410 }
412 411
413 // The following 5 functions are EME MediaKeySession events. 412 // The following 5 functions are EME MediaKeySession events.
414 413
415 void BrowserMediaPlayerManager::OnSessionCreated( 414 void BrowserMediaPlayerManager::OnSessionCreated(
416 int media_keys_id, 415 int media_keys_id,
417 uint32 session_id, 416 uint32 session_id,
418 const std::string& web_session_id) { 417 const std::string& web_session_id) {
419 Send(new MediaKeysMsg_SessionCreated( 418 Send(new CdmMsg_SessionCreated(
420 routing_id(), media_keys_id, session_id, web_session_id)); 419 routing_id(), media_keys_id, session_id, web_session_id));
421 } 420 }
422 421
423 void BrowserMediaPlayerManager::OnSessionMessage( 422 void BrowserMediaPlayerManager::OnSessionMessage(
424 int media_keys_id, 423 int media_keys_id,
425 uint32 session_id, 424 uint32 session_id,
426 const std::vector<uint8>& message, 425 const std::vector<uint8>& message,
427 const GURL& destination_url) { 426 const GURL& destination_url) {
428 Send(new MediaKeysMsg_SessionMessage( 427 Send(new CdmMsg_SessionMessage(
429 routing_id(), media_keys_id, session_id, message, destination_url)); 428 routing_id(), media_keys_id, session_id, message, destination_url));
430 } 429 }
431 430
432 void BrowserMediaPlayerManager::OnSessionReady(int media_keys_id, 431 void BrowserMediaPlayerManager::OnSessionReady(int media_keys_id,
433 uint32 session_id) { 432 uint32 session_id) {
434 Send(new MediaKeysMsg_SessionReady(routing_id(), media_keys_id, session_id)); 433 Send(new CdmMsg_SessionReady(routing_id(), media_keys_id, session_id));
435 } 434 }
436 435
437 void BrowserMediaPlayerManager::OnSessionClosed(int media_keys_id, 436 void BrowserMediaPlayerManager::OnSessionClosed(int media_keys_id,
438 uint32 session_id) { 437 uint32 session_id) {
439 Send(new MediaKeysMsg_SessionClosed(routing_id(), media_keys_id, session_id)); 438 Send(new CdmMsg_SessionClosed(routing_id(), media_keys_id, session_id));
440 } 439 }
441 440
442 void BrowserMediaPlayerManager::OnSessionError( 441 void BrowserMediaPlayerManager::OnSessionError(
443 int media_keys_id, 442 int media_keys_id,
444 uint32 session_id, 443 uint32 session_id,
445 media::MediaKeys::KeyError error_code, 444 media::MediaKeys::KeyError error_code,
446 int system_code) { 445 int system_code) {
447 Send(new MediaKeysMsg_SessionError( 446 Send(new CdmMsg_SessionError(
448 routing_id(), media_keys_id, session_id, error_code, system_code)); 447 routing_id(), media_keys_id, session_id, error_code, system_code));
449 } 448 }
450 449
451 #if defined(VIDEO_HOLE) 450 #if defined(VIDEO_HOLE)
452 void BrowserMediaPlayerManager::AttachExternalVideoSurface(int player_id, 451 void BrowserMediaPlayerManager::AttachExternalVideoSurface(int player_id,
453 jobject surface) { 452 jobject surface) {
454 MediaPlayerAndroid* player = GetPlayer(player_id); 453 MediaPlayerAndroid* player = GetPlayer(player_id);
455 if (player) { 454 if (player) {
456 player->SetVideoSurface( 455 player->SetVideoSurface(
457 gfx::ScopedJavaSurface::AcquireExternalSurface(surface)); 456 gfx::ScopedJavaSurface::AcquireExternalSurface(surface));
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
615 614
616 AddDrmBridge(media_keys_id, uuid, frame_url); 615 AddDrmBridge(media_keys_id, uuid, frame_url);
617 // In EME v0.1b MediaKeys lives in the media element. So the |media_keys_id| 616 // In EME v0.1b MediaKeys lives in the media element. So the |media_keys_id|
618 // is the same as the |player_id|. 617 // is the same as the |player_id|.
619 OnSetMediaKeys(media_keys_id, media_keys_id); 618 OnSetMediaKeys(media_keys_id, media_keys_id);
620 } 619 }
621 620
622 void BrowserMediaPlayerManager::OnCreateSession( 621 void BrowserMediaPlayerManager::OnCreateSession(
623 int media_keys_id, 622 int media_keys_id,
624 uint32 session_id, 623 uint32 session_id,
625 MediaKeysHostMsg_CreateSession_Type content_type, 624 CdmHostMsg_CreateSession_Type content_type,
626 const std::vector<uint8>& init_data) { 625 const std::vector<uint8>& init_data) {
627 if (init_data.size() > kEmeInitDataMaximum) { 626 if (init_data.size() > kEmeInitDataMaximum) {
628 LOG(WARNING) << "InitData for ID: " << media_keys_id 627 LOG(WARNING) << "InitData for ID: " << media_keys_id
629 << " too long: " << init_data.size(); 628 << " too long: " << init_data.size();
630 OnSessionError( 629 OnSessionError(
631 media_keys_id, session_id, media::MediaKeys::kUnknownError, 0); 630 media_keys_id, session_id, media::MediaKeys::kUnknownError, 0);
632 return; 631 return;
633 } 632 }
634 633
635 // Convert the session content type into a MIME type. "audio" and "video" 634 // Convert the session content type into a MIME type. "audio" and "video"
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 if (player->IsPlaying()) 879 if (player->IsPlaying())
881 OnProtectedSurfaceRequested(media_keys_id); 880 OnProtectedSurfaceRequested(media_keys_id);
882 } 881 }
883 882
884 void BrowserMediaPlayerManager::ReleaseFullscreenPlayer( 883 void BrowserMediaPlayerManager::ReleaseFullscreenPlayer(
885 MediaPlayerAndroid* player) { 884 MediaPlayerAndroid* player) {
886 player->Release(); 885 player->Release();
887 } 886 }
888 887
889 } // namespace content 888 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/android/browser_media_player_manager.h ('k') | content/common/media/media_player_messages_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698