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

Side by Side Diff: content/browser/android/media_player_manager_android.cc

Issue 14247018: Implement WebRTC in Chrome for TV (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed some comments Created 7 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/android/media_player_manager_android.h" 5 #include "content/browser/android/media_player_manager_android.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "content/browser/android/media_resource_getter_impl.h" 8 #include "content/browser/android/media_resource_getter_impl.h"
9 #include "content/browser/web_contents/web_contents_view_android.h" 9 #include "content/browser/web_contents/web_contents_view_android.h"
10 #include "content/common/media/media_player_messages.h" 10 #include "content/common/media/media_player_messages.h"
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 void MediaPlayerManagerAndroid::SetVideoSurface(jobject surface) { 100 void MediaPlayerManagerAndroid::SetVideoSurface(jobject surface) {
101 MediaPlayerBridge* player = GetFullscreenPlayer(); 101 MediaPlayerBridge* player = GetFullscreenPlayer();
102 if (player) { 102 if (player) {
103 player->SetVideoSurface(surface); 103 player->SetVideoSurface(surface);
104 Send(new MediaPlayerMsg_DidEnterFullscreen( 104 Send(new MediaPlayerMsg_DidEnterFullscreen(
105 routing_id(), player->player_id())); 105 routing_id(), player->player_id()));
106 } 106 }
107 } 107 }
108 108
109 void MediaPlayerManagerAndroid::OnInitialize( 109 void MediaPlayerManagerAndroid::OnInitialize(
110 int player_id, const GURL& url, 110 int player_id,
111 bool is_media_source, 111 const GURL& url,
112 media::MediaPlayerBridge::MediaType media_type,
112 const GURL& first_party_for_cookies) { 113 const GURL& first_party_for_cookies) {
113 for (ScopedVector<MediaPlayerBridge>::iterator it = players_.begin(); 114 for (ScopedVector<MediaPlayerBridge>::iterator it = players_.begin();
114 it != players_.end(); ++it) { 115 it != players_.end(); ++it) {
115 if ((*it)->player_id() == player_id) { 116 if ((*it)->player_id() == player_id) {
116 players_.erase(it); 117 players_.erase(it);
117 break; 118 break;
118 } 119 }
119 } 120 }
120 121
121 RenderProcessHost* host = render_view_host()->GetProcess(); 122 RenderProcessHost* host = render_view_host()->GetProcess();
122 BrowserContext* context = host->GetBrowserContext(); 123 BrowserContext* context = host->GetBrowserContext();
123 StoragePartition* partition = host->GetStoragePartition(); 124 StoragePartition* partition = host->GetStoragePartition();
124 fileapi::FileSystemContext* file_system_context = 125 fileapi::FileSystemContext* file_system_context =
125 partition ? partition->GetFileSystemContext() : NULL; 126 partition ? partition->GetFileSystemContext() : NULL;
126 players_.push_back(media::MediaPlayerBridge::Create( 127 players_.push_back(media::MediaPlayerBridge::Create(
127 player_id, url, is_media_source, first_party_for_cookies, 128 player_id, url, media_type, first_party_for_cookies,
128 new MediaResourceGetterImpl(context, file_system_context, host->GetID(), 129 new MediaResourceGetterImpl(context, file_system_context, host->GetID(),
129 routing_id()), 130 routing_id()),
130 context->IsOffTheRecord(), this, 131 context->IsOffTheRecord(), this,
131 #if defined(GOOGLE_TV) 132 #if defined(GOOGLE_TV)
132 base::Bind(&MediaPlayerManagerAndroid::OnReadFromDemuxer, 133 base::Bind(&MediaPlayerManagerAndroid::OnReadFromDemuxer,
133 base::Unretained(this)), 134 base::Unretained(this)),
134 #endif 135 #endif
135 base::Bind(&MediaPlayerManagerAndroid::OnError, base::Unretained(this)), 136 base::Bind(&MediaPlayerManagerAndroid::OnError, base::Unretained(this)),
136 base::Bind(&MediaPlayerManagerAndroid::OnVideoSizeChanged, 137 base::Bind(&MediaPlayerManagerAndroid::OnVideoSizeChanged,
137 base::Unretained(this)), 138 base::Unretained(this)),
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 } 373 }
373 } 374 }
374 } 375 }
375 376
376 void MediaPlayerManagerAndroid::ReleaseMediaResources( 377 void MediaPlayerManagerAndroid::ReleaseMediaResources(
377 MediaPlayerBridge* player) { 378 MediaPlayerBridge* player) {
378 // Nothing needs to be done. 379 // Nothing needs to be done.
379 } 380 }
380 381
381 } // namespace content 382 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698