OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/media_player_renderer.h" | 5 #include "content/browser/media/android/media_player_renderer.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "content/browser/android/scoped_surface_request_manager.h" | 9 #include "content/browser/android/scoped_surface_request_manager.h" |
10 #include "content/browser/media/android/media_resource_getter_impl.h" | 10 #include "content/browser/media/android/media_resource_getter_impl.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 media::RendererClient* client, | 35 media::RendererClient* client, |
36 const media::PipelineStatusCB& init_cb) { | 36 const media::PipelineStatusCB& init_cb) { |
37 DVLOG(1) << __func__; | 37 DVLOG(1) << __func__; |
38 if (demuxer_stream_provider->GetType() != | 38 if (demuxer_stream_provider->GetType() != |
39 media::DemuxerStreamProvider::Type::URL) { | 39 media::DemuxerStreamProvider::Type::URL) { |
40 DLOG(ERROR) << "DemuxerStreamProvider is not of Type URL"; | 40 DLOG(ERROR) << "DemuxerStreamProvider is not of Type URL"; |
41 init_cb.Run(media::PIPELINE_ERROR_INITIALIZATION_FAILED); | 41 init_cb.Run(media::PIPELINE_ERROR_INITIALIZATION_FAILED); |
42 return; | 42 return; |
43 } | 43 } |
44 | 44 |
45 GURL url = demuxer_stream_provider->GetUrl(); | 45 media::MediaUrlParams url_params = |
| 46 demuxer_stream_provider->GetMediaUrlParams(); |
46 renderer_client_ = client; | 47 renderer_client_ = client; |
47 | 48 |
48 const std::string user_agent = GetContentClient()->GetUserAgent(); | 49 const std::string user_agent = GetContentClient()->GetUserAgent(); |
49 | 50 |
50 // TODO(tguilbert): Get the first party cookies from WMPI. See | |
51 // crbug.com/636604. | |
52 media_player_.reset(new media::MediaPlayerBridge( | 51 media_player_.reset(new media::MediaPlayerBridge( |
53 kUnusedAndIrrelevantPlayerId, url, | 52 kUnusedAndIrrelevantPlayerId, url_params.media_url, |
54 GURL(), // first_party_for_cookies | 53 url_params.first_party_for_cookies, user_agent, |
55 user_agent, | |
56 false, // hide_url_log | 54 false, // hide_url_log |
57 this, base::Bind(&MediaPlayerRenderer::OnDecoderResourcesReleased, | 55 this, base::Bind(&MediaPlayerRenderer::OnDecoderResourcesReleased, |
58 weak_factory_.GetWeakPtr()), | 56 weak_factory_.GetWeakPtr()), |
59 GURL(), // frame_url | 57 GURL(), // frame_url |
60 false)); // allow_crendentials | 58 true)); // allow_crendentials |
61 | 59 |
62 media_player_->Initialize(); | 60 media_player_->Initialize(); |
63 init_cb.Run(media::PIPELINE_OK); | 61 init_cb.Run(media::PIPELINE_OK); |
64 } | 62 } |
65 | 63 |
66 void MediaPlayerRenderer::SetCdm(media::CdmContext* cdm_context, | 64 void MediaPlayerRenderer::SetCdm(media::CdmContext* cdm_context, |
67 const media::CdmAttachedCB& cdm_attached_cb) { | 65 const media::CdmAttachedCB& cdm_attached_cb) { |
68 NOTREACHED(); | 66 NOTREACHED(); |
69 } | 67 } |
70 | 68 |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 void MediaPlayerRenderer::CancelScopedSurfaceRequest() { | 245 void MediaPlayerRenderer::CancelScopedSurfaceRequest() { |
248 if (!surface_request_token_) | 246 if (!surface_request_token_) |
249 return; | 247 return; |
250 | 248 |
251 ScopedSurfaceRequestManager::GetInstance()->UnregisterScopedSurfaceRequest( | 249 ScopedSurfaceRequestManager::GetInstance()->UnregisterScopedSurfaceRequest( |
252 surface_request_token_); | 250 surface_request_token_); |
253 surface_request_token_ = base::UnguessableToken(); | 251 surface_request_token_ = base::UnguessableToken(); |
254 } | 252 } |
255 | 253 |
256 } // namespace content | 254 } // namespace content |
OLD | NEW |