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 "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 573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 fullscreen_player_id_ != (*it)->player_id()) { | 584 fullscreen_player_id_ != (*it)->player_id()) { |
585 ReleasePlayer(*it); | 585 ReleasePlayer(*it); |
586 Send(new MediaPlayerMsg_MediaPlayerReleased(RoutingID(), | 586 Send(new MediaPlayerMsg_MediaPlayerReleased(RoutingID(), |
587 (*it)->player_id())); | 587 (*it)->player_id())); |
588 } | 588 } |
589 } | 589 } |
590 } | 590 } |
591 | 591 |
592 void BrowserMediaPlayerManager::ReleaseMediaResources(int player_id) { | 592 void BrowserMediaPlayerManager::ReleaseMediaResources(int player_id) { |
593 #if defined(VIDEO_HOLE) | 593 #if defined(VIDEO_HOLE) |
594 MediaPlayerAndroid* player = GetPlayer(player_id); | |
595 if (player && player->IsSurfaceInUse()) | |
596 return; | |
597 if (external_video_surface_container_) | 594 if (external_video_surface_container_) |
598 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); | 595 external_video_surface_container_->ReleaseExternalVideoSurface(player_id); |
599 #endif // defined(VIDEO_HOLE) | 596 #endif // defined(VIDEO_HOLE) |
600 } | 597 } |
601 | 598 |
602 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { | 599 void BrowserMediaPlayerManager::ReleasePlayer(MediaPlayerAndroid* player) { |
603 player->Release(); | 600 player->Release(); |
604 ReleaseMediaResources(player->player_id()); | 601 ReleaseMediaResources(player->player_id()); |
605 } | 602 } |
606 | 603 |
607 } // namespace content | 604 } // namespace content |
OLD | NEW |