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

Side by Side Diff: media/blink/webmediaplayer_impl.h

Issue 1567123002: Support CAST+WMPI on android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments addressed + merged (sorry) Created 4 years, 11 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 | « media/blink/webmediaplayer_cast_android.cc ('k') | media/blink/webmediaplayer_impl.cc » ('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 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 5 #ifndef MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 6 #define MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 #include <vector> 11 #include <vector>
12 12
DaleCurtis 2016/01/15 21:11:12 Add build/build_config.h for OS Macros.
hubbe 2016/01/15 21:25:22 Done.
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/macros.h" 14 #include "base/macros.h"
15 #include "base/memory/linked_ptr.h" 15 #include "base/memory/linked_ptr.h"
16 #include "base/memory/ref_counted.h" 16 #include "base/memory/ref_counted.h"
17 #include "base/memory/scoped_ptr.h" 17 #include "base/memory/scoped_ptr.h"
18 #include "base/memory/weak_ptr.h" 18 #include "base/memory/weak_ptr.h"
19 #include "base/threading/thread.h" 19 #include "base/threading/thread.h"
20 #include "media/base/cdm_factory.h" 20 #include "media/base/cdm_factory.h"
21 #include "media/base/pipeline.h" 21 #include "media/base/pipeline.h"
22 #include "media/base/renderer_factory.h" 22 #include "media/base/renderer_factory.h"
23 #include "media/base/text_track.h" 23 #include "media/base/text_track.h"
24 #include "media/blink/buffered_data_source.h" 24 #include "media/blink/buffered_data_source.h"
25 #include "media/blink/buffered_data_source_host_impl.h" 25 #include "media/blink/buffered_data_source_host_impl.h"
26 #include "media/blink/encrypted_media_player_support.h" 26 #include "media/blink/encrypted_media_player_support.h"
27 #include "media/blink/media_blink_export.h" 27 #include "media/blink/media_blink_export.h"
28 #include "media/blink/multibuffer_data_source.h" 28 #include "media/blink/multibuffer_data_source.h"
29 #include "media/blink/video_frame_compositor.h" 29 #include "media/blink/video_frame_compositor.h"
30 #include "media/blink/webmediaplayer_delegate.h" 30 #include "media/blink/webmediaplayer_delegate.h"
31 #include "media/blink/webmediaplayer_params.h" 31 #include "media/blink/webmediaplayer_params.h"
32 #include "media/blink/webmediaplayer_util.h" 32 #include "media/blink/webmediaplayer_util.h"
33 #include "media/renderers/skcanvas_video_renderer.h" 33 #include "media/renderers/skcanvas_video_renderer.h"
34 #include "third_party/WebKit/public/platform/WebAudioSourceProvider.h" 34 #include "third_party/WebKit/public/platform/WebAudioSourceProvider.h"
35 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" 35 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h"
36 #include "third_party/WebKit/public/platform/WebMediaPlayer.h" 36 #include "third_party/WebKit/public/platform/WebMediaPlayer.h"
37 #include "url/gurl.h" 37 #include "url/gurl.h"
38 38
39 #if defined(OS_ANDROID) // WMPI_CAST
40 // Delete this file when WMPI_CAST is no longer needed.
41 #include "media/blink/webmediaplayer_cast_android.h"
42 #endif
43
39 namespace blink { 44 namespace blink {
40 class WebGraphicsContext3D; 45 class WebGraphicsContext3D;
41 class WebLocalFrame; 46 class WebLocalFrame;
42 class WebMediaPlayerClient; 47 class WebMediaPlayerClient;
43 class WebMediaPlayerEncryptedMediaClient; 48 class WebMediaPlayerEncryptedMediaClient;
44 } 49 }
45 50
46 namespace base { 51 namespace base {
47 class SingleThreadTaskRunner; 52 class SingleThreadTaskRunner;
48 class TaskRunner; 53 class TaskRunner;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 void OnPipelineMetadata(PipelineMetadata metadata); 187 void OnPipelineMetadata(PipelineMetadata metadata);
183 void OnPipelineBufferingStateChanged(BufferingState buffering_state); 188 void OnPipelineBufferingStateChanged(BufferingState buffering_state);
184 void OnDemuxerOpened(); 189 void OnDemuxerOpened();
185 void OnAddTextTrack(const TextTrackConfig& config, 190 void OnAddTextTrack(const TextTrackConfig& config,
186 const AddTextTrackDoneCB& done_cb); 191 const AddTextTrackDoneCB& done_cb);
187 192
188 // WebMediaPlayerDelegate::Observer implementation. 193 // WebMediaPlayerDelegate::Observer implementation.
189 void OnHidden() override; 194 void OnHidden() override;
190 void OnShown() override; 195 void OnShown() override;
191 196
197 #if defined(OS_ANDROID) // WMPI_CAST
198 bool isRemote() const override;
199 void requestRemotePlayback() override;
200 void requestRemotePlaybackControl() override;
201
202 void SetMediaPlayerManager(
203 RendererMediaPlayerManagerInterface* media_player_manager);
204 void OnRemotePlaybackEnded();
205 void OnDisconnectedFromRemoteDevice(double t);
206 void SuspendForRemote();
207 void DisplayCastFrameAfterSuspend(const scoped_refptr<VideoFrame>& new_frame,
208 PipelineStatus status);
209 gfx::Size GetCanvasSize() const;
210 void SetDeviceScaleFactor(float scale_factor);
211 #endif
212
192 private: 213 private:
214 // Ask for the pipeline to be suspended, will call Suspend() when ready.
215 // (Possibly immediately.)
216 void ScheduleSuspend();
217
193 // Initiate suspending the pipeline. 218 // Initiate suspending the pipeline.
194 void Suspend(); 219 void Suspend();
195 220
221 // Ask for the pipeline to be resumed, will call Resume() when ready.
222 // (Possibly immediately.)
223 void ScheduleResume();
224
196 // Initiate resuming the pipeline. 225 // Initiate resuming the pipeline.
197 void Resume(); 226 void Resume();
198 227
199 // Called after |defer_load_cb_| has decided to allow the load. If 228 // Called after |defer_load_cb_| has decided to allow the load. If
200 // |defer_load_cb_| is null this is called immediately. 229 // |defer_load_cb_| is null this is called immediately.
201 void DoLoad(LoadType load_type, 230 void DoLoad(LoadType load_type,
202 const blink::WebURL& url, 231 const blink::WebURL& url,
203 CORSMode cors_mode); 232 CORSMode cors_mode);
204 233
205 // Called after asynchronous initialization of a data source completed. 234 // Called after asynchronous initialization of a data source completed.
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 // playback. 422 // playback.
394 scoped_ptr<cc_blink::WebLayerImpl> video_weblayer_; 423 scoped_ptr<cc_blink::WebLayerImpl> video_weblayer_;
395 424
396 EncryptedMediaPlayerSupport encrypted_media_support_; 425 EncryptedMediaPlayerSupport encrypted_media_support_;
397 426
398 scoped_ptr<blink::WebContentDecryptionModuleResult> set_cdm_result_; 427 scoped_ptr<blink::WebContentDecryptionModuleResult> set_cdm_result_;
399 428
400 // Whether a CDM has been successfully attached. 429 // Whether a CDM has been successfully attached.
401 bool is_cdm_attached_; 430 bool is_cdm_attached_;
402 431
432 #if defined(OS_ANDROID) // WMPI_CAST
433 WebMediaPlayerCast cast_impl_;
434 #endif
435
403 scoped_ptr<RendererFactory> renderer_factory_; 436 scoped_ptr<RendererFactory> renderer_factory_;
404 437
405 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); 438 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
406 }; 439 };
407 440
408 } // namespace media 441 } // namespace media
409 442
410 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 443 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
OLDNEW
« no previous file with comments | « media/blink/webmediaplayer_cast_android.cc ('k') | media/blink/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698