OLD | NEW |
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 Loading... |
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, const GURL& url, int flags, |
111 bool is_media_source, | |
112 const GURL& first_party_for_cookies) { | 111 const GURL& first_party_for_cookies) { |
113 for (ScopedVector<MediaPlayerBridge>::iterator it = players_.begin(); | 112 for (ScopedVector<MediaPlayerBridge>::iterator it = players_.begin(); |
114 it != players_.end(); ++it) { | 113 it != players_.end(); ++it) { |
115 if ((*it)->player_id() == player_id) { | 114 if ((*it)->player_id() == player_id) { |
116 players_.erase(it); | 115 players_.erase(it); |
117 break; | 116 break; |
118 } | 117 } |
119 } | 118 } |
120 | 119 |
121 RenderProcessHost* host = render_view_host()->GetProcess(); | 120 RenderProcessHost* host = render_view_host()->GetProcess(); |
122 BrowserContext* context = host->GetBrowserContext(); | 121 BrowserContext* context = host->GetBrowserContext(); |
123 StoragePartition* partition = host->GetStoragePartition(); | 122 StoragePartition* partition = host->GetStoragePartition(); |
124 fileapi::FileSystemContext* file_system_context = | 123 fileapi::FileSystemContext* file_system_context = |
125 partition ? partition->GetFileSystemContext() : NULL; | 124 partition ? partition->GetFileSystemContext() : NULL; |
126 players_.push_back(media::MediaPlayerBridge::Create( | 125 players_.push_back(media::MediaPlayerBridge::Create( |
127 player_id, url, is_media_source, first_party_for_cookies, | 126 player_id, url, flags, first_party_for_cookies, |
128 new MediaResourceGetterImpl(context, file_system_context, host->GetID(), | 127 new MediaResourceGetterImpl(context, file_system_context, host->GetID(), |
129 routing_id()), | 128 routing_id()), |
130 context->IsOffTheRecord(), this, | 129 context->IsOffTheRecord(), this, |
131 #if defined(GOOGLE_TV) | 130 #if defined(GOOGLE_TV) |
132 base::Bind(&MediaPlayerManagerAndroid::OnReadFromDemuxer, | 131 base::Bind(&MediaPlayerManagerAndroid::OnReadFromDemuxer, |
133 base::Unretained(this)), | 132 base::Unretained(this)), |
134 #endif | 133 #endif |
135 base::Bind(&MediaPlayerManagerAndroid::OnError, base::Unretained(this)), | 134 base::Bind(&MediaPlayerManagerAndroid::OnError, base::Unretained(this)), |
136 base::Bind(&MediaPlayerManagerAndroid::OnVideoSizeChanged, | 135 base::Bind(&MediaPlayerManagerAndroid::OnVideoSizeChanged, |
137 base::Unretained(this)), | 136 base::Unretained(this)), |
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 } | 371 } |
373 } | 372 } |
374 } | 373 } |
375 | 374 |
376 void MediaPlayerManagerAndroid::ReleaseMediaResources( | 375 void MediaPlayerManagerAndroid::ReleaseMediaResources( |
377 MediaPlayerBridge* player) { | 376 MediaPlayerBridge* player) { |
378 // Nothing needs to be done. | 377 // Nothing needs to be done. |
379 } | 378 } |
380 | 379 |
381 } // namespace content | 380 } // namespace content |
OLD | NEW |