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

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