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

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

Issue 1996043002: Split MediaContentType and AudioFocusType (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed nits Created 4 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
« no previous file with comments | « no previous file | content/browser/media/android/media_web_contents_observer_android.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <utility> 7 #include <utility>
8 8
9 #include "base/android/scoped_java_ref.h" 9 #include "base/android/scoped_java_ref.h"
10 #include "base/memory/singleton.h" 10 #include "base/memory/singleton.h"
(...skipping 14 matching lines...) Expand all
25 #include "content/public/browser/render_view_host.h" 25 #include "content/public/browser/render_view_host.h"
26 #include "content/public/browser/storage_partition.h" 26 #include "content/public/browser/storage_partition.h"
27 #include "content/public/browser/web_contents.h" 27 #include "content/public/browser/web_contents.h"
28 #include "content/public/browser/web_contents_delegate.h" 28 #include "content/public/browser/web_contents_delegate.h"
29 #include "content/public/common/content_client.h" 29 #include "content/public/common/content_client.h"
30 #include "content/public/common/content_switches.h" 30 #include "content/public/common/content_switches.h"
31 #include "gpu/ipc/common/android/surface_texture_peer.h" 31 #include "gpu/ipc/common/android/surface_texture_peer.h"
32 #include "media/base/android/media_player_bridge.h" 32 #include "media/base/android/media_player_bridge.h"
33 #include "media/base/android/media_source_player.h" 33 #include "media/base/android/media_source_player.h"
34 #include "media/base/android/media_url_interceptor.h" 34 #include "media/base/android/media_url_interceptor.h"
35 #include "media/base/media_content_type.h"
35 36
36 #if !defined(USE_AURA) 37 #if !defined(USE_AURA)
37 #include "content/browser/android/content_view_core_impl.h" 38 #include "content/browser/android/content_view_core_impl.h"
38 #include "content/browser/renderer_host/render_widget_host_view_android.h" 39 #include "content/browser/renderer_host/render_widget_host_view_android.h"
39 #endif 40 #endif
40 41
41 using media::MediaPlayerAndroid; 42 using media::MediaPlayerAndroid;
42 using media::MediaPlayerBridge; 43 using media::MediaPlayerBridge;
43 using media::MediaPlayerManager; 44 using media::MediaPlayerManager;
44 using media::MediaSourcePlayer; 45 using media::MediaSourcePlayer;
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
435 } 436 }
436 437
437 bool BrowserMediaPlayerManager::RequestPlay(int player_id, 438 bool BrowserMediaPlayerManager::RequestPlay(int player_id,
438 base::TimeDelta duration, 439 base::TimeDelta duration,
439 bool has_audio) { 440 bool has_audio) {
440 DCHECK(player_id_to_delegate_id_map_.find(player_id) != 441 DCHECK(player_id_to_delegate_id_map_.find(player_id) !=
441 player_id_to_delegate_id_map_.end()); 442 player_id_to_delegate_id_map_.end());
442 return MediaWebContentsObserverAndroid::FromWebContents(web_contents_) 443 return MediaWebContentsObserverAndroid::FromWebContents(web_contents_)
443 ->RequestPlay(render_frame_host_, 444 ->RequestPlay(render_frame_host_,
444 player_id_to_delegate_id_map_[player_id], has_audio, 445 player_id_to_delegate_id_map_[player_id], has_audio,
445 IsPlayingRemotely(player_id), duration); 446 IsPlayingRemotely(player_id),
447 media::DurationToMediaContentType(duration));
446 } 448 }
447 449
448 #if defined(VIDEO_HOLE) 450 #if defined(VIDEO_HOLE)
449 void BrowserMediaPlayerManager::AttachExternalVideoSurface(int player_id, 451 void BrowserMediaPlayerManager::AttachExternalVideoSurface(int player_id,
450 jobject surface) { 452 jobject surface) {
451 MediaPlayerAndroid* player = GetPlayer(player_id); 453 MediaPlayerAndroid* player = GetPlayer(player_id);
452 if (player) { 454 if (player) {
453 player->SetVideoSurface( 455 player->SetVideoSurface(
454 gl::ScopedJavaSurface::AcquireExternalSurface(surface)); 456 gl::ScopedJavaSurface::AcquireExternalSurface(surface));
455 } 457 }
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 if (!player) 795 if (!player)
794 return; 796 return;
795 player->Start(); 797 player->Start();
796 if (fullscreen_player_id_ == player_id && fullscreen_player_is_released_) { 798 if (fullscreen_player_id_ == player_id && fullscreen_player_is_released_) {
797 video_view_->OpenVideo(); 799 video_view_->OpenVideo();
798 fullscreen_player_is_released_ = false; 800 fullscreen_player_is_released_ = false;
799 } 801 }
800 } 802 }
801 803
802 } // namespace content 804 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/media/android/media_web_contents_observer_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698