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

Side by Side Diff: media/blink/webmediaplayer_cast_android.cc

Issue 1641993003: Pass media session id over IPC (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@possible-next-split
Patch Set: Enumify constant Created 4 years, 9 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 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 "media/blink/webmediaplayer_cast_android.h" 5 #include "media/blink/webmediaplayer_cast_android.h"
6 6
7 #include "gpu/GLES2/gl2extchromium.h" 7 #include "gpu/GLES2/gl2extchromium.h"
8 #include "gpu/blink/webgraphicscontext3d_impl.h" 8 #include "gpu/blink/webgraphicscontext3d_impl.h"
9 #include "gpu/command_buffer/client/gles2_interface.h" 9 #include "gpu/command_buffer/client/gles2_interface.h"
10 #include "gpu/command_buffer/common/sync_token.h" 10 #include "gpu/command_buffer/common/sync_token.h"
11 #include "media/base/android/media_common_android.h" 11 #include "media/base/android/media_common_android.h"
12 #include "media/base/bind_to_current_loop.h" 12 #include "media/base/bind_to_current_loop.h"
13 #include "media/blink/webmediaplayer_impl.h" 13 #include "media/blink/webmediaplayer_impl.h"
14 #include "media/blink/webmediaplayer_params.h" 14 #include "media/blink/webmediaplayer_params.h"
15 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h" 15 #include "third_party/WebKit/public/platform/WebMediaPlayerClient.h"
16 #include "third_party/WebKit/public/platform/modules/mediasession/WebMediaSessio n.h"
16 #include "third_party/WebKit/public/web/WebDocument.h" 17 #include "third_party/WebKit/public/web/WebDocument.h"
17 #include "third_party/WebKit/public/web/WebLocalFrame.h" 18 #include "third_party/WebKit/public/web/WebLocalFrame.h"
18 #include "third_party/skia/include/core/SkCanvas.h" 19 #include "third_party/skia/include/core/SkCanvas.h"
19 #include "third_party/skia/include/core/SkPaint.h" 20 #include "third_party/skia/include/core/SkPaint.h"
20 #include "third_party/skia/include/core/SkTypeface.h" 21 #include "third_party/skia/include/core/SkTypeface.h"
21 #include "third_party/skia/include/gpu/GrContext.h" 22 #include "third_party/skia/include/gpu/GrContext.h"
22 #include "third_party/skia/include/gpu/SkGrPixelRef.h" 23 #include "third_party/skia/include/gpu/SkGrPixelRef.h"
23 24
24 using gpu::gles2::GLES2Interface; 25 using gpu::gles2::GLES2Interface;
25 26
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 168
168 player_manager_->UnregisterMediaPlayer(player_id_); 169 player_manager_->UnregisterMediaPlayer(player_id_);
169 } 170 }
170 } 171 }
171 172
172 void WebMediaPlayerCast::Initialize(const GURL& url, 173 void WebMediaPlayerCast::Initialize(const GURL& url,
173 blink::WebLocalFrame* frame, 174 blink::WebLocalFrame* frame,
174 int delegate_id) { 175 int delegate_id) {
175 player_manager_->Initialize(MEDIA_PLAYER_TYPE_REMOTE_ONLY, player_id_, url, 176 player_manager_->Initialize(MEDIA_PLAYER_TYPE_REMOTE_ONLY, player_id_, url,
176 frame->document().firstPartyForCookies(), 0, 177 frame->document().firstPartyForCookies(), 0,
177 frame->document().url(), true, delegate_id); 178 frame->document().url(), true, delegate_id,
179 blink::WebMediaSession::DefaultID);
178 is_player_initialized_ = true; 180 is_player_initialized_ = true;
179 } 181 }
180 182
181 void WebMediaPlayerCast::SetMediaPlayerManager( 183 void WebMediaPlayerCast::SetMediaPlayerManager(
182 RendererMediaPlayerManagerInterface* media_player_manager) { 184 RendererMediaPlayerManagerInterface* media_player_manager) {
183 player_manager_ = media_player_manager; 185 player_manager_ = media_player_manager;
184 player_id_ = player_manager_->RegisterMediaPlayer(this); 186 player_id_ = player_manager_->RegisterMediaPlayer(this);
185 } 187 }
186 188
187 void WebMediaPlayerCast::requestRemotePlayback() { 189 void WebMediaPlayerCast::requestRemotePlayback() {
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 370
369 if (!canvas_size.width()) 371 if (!canvas_size.width())
370 return nullptr; 372 return nullptr;
371 373
372 return MakeTextFrameForCast(remote_playback_message_, canvas_size, 374 return MakeTextFrameForCast(remote_playback_message_, canvas_size,
373 webmediaplayer_->naturalSize(), 375 webmediaplayer_->naturalSize(),
374 base::Bind(&GLCBShim, context_3d_cb_)); 376 base::Bind(&GLCBShim, context_3d_cb_));
375 } 377 }
376 378
377 } // namespace media 379 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698