| 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 #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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/android/scoped_java_ref.h" | 9 #include "base/android/scoped_java_ref.h" |
| 10 #include "content/browser/frame_host/render_frame_host_impl.h" | 10 #include "content/browser/frame_host/render_frame_host_impl.h" |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 scoped_ptr<media::MediaPlayerAndroid> BrowserMediaPlayerManager::SwapPlayer( | 641 scoped_ptr<media::MediaPlayerAndroid> BrowserMediaPlayerManager::SwapPlayer( |
| 642 int player_id, media::MediaPlayerAndroid* player) { | 642 int player_id, media::MediaPlayerAndroid* player) { |
| 643 media::MediaPlayerAndroid* previous_player = NULL; | 643 media::MediaPlayerAndroid* previous_player = NULL; |
| 644 for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin(); | 644 for (ScopedVector<MediaPlayerAndroid>::iterator it = players_.begin(); |
| 645 it != players_.end(); ++it) { | 645 it != players_.end(); ++it) { |
| 646 if ((*it)->player_id() == player_id) { | 646 if ((*it)->player_id() == player_id) { |
| 647 previous_player = *it; | 647 previous_player = *it; |
| 648 #if defined(VIDEO_HOLE) | 648 #if defined(VIDEO_HOLE) |
| 649 ReleaseExternalSurface(player_id); | 649 ReleaseExternalSurface(player_id); |
| 650 #endif | 650 #endif |
| 651 MediaWebContentsObserverAndroid::FromWebContents(web_contents_) |
| 652 ->DisconnectMediaSession(render_frame_host_, |
| 653 player_id_to_delegate_id_map_[player_id]); |
| 651 players_.weak_erase(it); | 654 players_.weak_erase(it); |
| 652 players_.push_back(player); | 655 players_.push_back(player); |
| 653 break; | 656 break; |
| 654 } | 657 } |
| 655 } | 658 } |
| 656 return scoped_ptr<media::MediaPlayerAndroid>(previous_player); | 659 return scoped_ptr<media::MediaPlayerAndroid>(previous_player); |
| 657 } | 660 } |
| 658 | 661 |
| 659 bool BrowserMediaPlayerManager::RequestDecoderResources( | 662 bool BrowserMediaPlayerManager::RequestDecoderResources( |
| 660 int player_id, bool temporary) { | 663 int player_id, bool temporary) { |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 if (!player) | 739 if (!player) |
| 737 return; | 740 return; |
| 738 player->Start(); | 741 player->Start(); |
| 739 if (fullscreen_player_id_ == player_id && fullscreen_player_is_released_) { | 742 if (fullscreen_player_id_ == player_id && fullscreen_player_is_released_) { |
| 740 video_view_->OpenVideo(); | 743 video_view_->OpenVideo(); |
| 741 fullscreen_player_is_released_ = false; | 744 fullscreen_player_is_released_ = false; |
| 742 } | 745 } |
| 743 } | 746 } |
| 744 | 747 |
| 745 } // namespace content | 748 } // namespace content |
| OLD | NEW |