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

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

Issue 349923007: Implement media Cast button in Blink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase, now that the Blink patch has landed. Created 6 years, 3 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/android/scoped_java_ref.h" 7 #include "base/android/scoped_java_ref.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "content/browser/android/content_view_core_impl.h" 9 #include "content/browser/android/content_view_core_impl.h"
10 #include "content/browser/media/android/browser_demuxer_android.h" 10 #include "content/browser/media/android/browser_demuxer_android.h"
(...skipping 499 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 if (player_id == fullscreen_player_id_) 510 if (player_id == fullscreen_player_id_)
511 fullscreen_player_is_released_ = true; 511 fullscreen_player_is_released_ = true;
512 } 512 }
513 513
514 void BrowserMediaPlayerManager::OnDestroyPlayer(int player_id) { 514 void BrowserMediaPlayerManager::OnDestroyPlayer(int player_id) {
515 RemovePlayer(player_id); 515 RemovePlayer(player_id);
516 if (fullscreen_player_id_ == player_id) 516 if (fullscreen_player_id_ == player_id)
517 fullscreen_player_id_ = -1; 517 fullscreen_player_id_ = -1;
518 } 518 }
519 519
520 void BrowserMediaPlayerManager::OnRequestRemotePlayback(int /* player_id */) {
521 // Does nothing if we don't have a remote player
522 }
523
524 void BrowserMediaPlayerManager::OnRequestRemotePlaybackControl(
525 int /* player_id */) {
526 // Does nothing if we don't have a remote player
527 }
528
520 void BrowserMediaPlayerManager::AddPlayer(MediaPlayerAndroid* player) { 529 void BrowserMediaPlayerManager::AddPlayer(MediaPlayerAndroid* player) {
521 DCHECK(!GetPlayer(player->player_id())); 530 DCHECK(!GetPlayer(player->player_id()));
522 players_.push_back(player); 531 players_.push_back(player);
523 } 532 }
524 533
525 void BrowserMediaPlayerManager::RemovePlayer(int player_id) { 534 void BrowserMediaPlayerManager::RemovePlayer(int player_id) {
526 for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin(); 535 for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin();
527 it != players_.end(); ++it) { 536 it != players_.end(); ++it) {
528 if ((*it)->player_id() == player_id) { 537 if ((*it)->player_id() == player_id) {
529 ReleaseMediaResources(player_id); 538 ReleaseMediaResources(player_id);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); 608 external_video_surface_container_->ReleaseExternalVideoSurface(player_id);
600 #endif // defined(VIDEO_HOLE) 609 #endif // defined(VIDEO_HOLE)
601 } 610 }
602 611
603 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { 612 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) {
604 player->Release(); 613 player->Release();
605 ReleaseMediaResources(player->player_id()); 614 ReleaseMediaResources(player->player_id());
606 } 615 }
607 616
608 } // namespace content 617 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/media/android/browser_media_player_manager.h ('k') | content/browser/media/media_web_contents_observer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698