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

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: cast tests are now passing locally 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
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>
(...skipping 18 matching lines...) Expand all
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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 void OnPipelineMetadata(PipelineMetadata metadata); 195 void OnPipelineMetadata(PipelineMetadata metadata);
191 void OnPipelineBufferingStateChanged(BufferingState buffering_state); 196 void OnPipelineBufferingStateChanged(BufferingState buffering_state);
192 void OnDemuxerOpened(); 197 void OnDemuxerOpened();
193 void OnAddTextTrack(const TextTrackConfig& config, 198 void OnAddTextTrack(const TextTrackConfig& config,
194 const AddTextTrackDoneCB& done_cb); 199 const AddTextTrackDoneCB& done_cb);
195 200
196 // WebMediaPlayerDelegate::Observer implementation. 201 // WebMediaPlayerDelegate::Observer implementation.
197 void OnHidden() override; 202 void OnHidden() override;
198 void OnShown() override; 203 void OnShown() override;
199 204
205 #if defined(OS_ANDROID) // WMPI_CAST
206 bool isRemote() const override;
207 void requestRemotePlayback() override;
208 void requestRemotePlaybackControl() override;
209
210 void SetMediaPlayerManager(
211 RendererMediaPlayerManagerInterface* media_player_manager);
212 void OnRemotePlaybackEnded();
213 void OnDisconnectedFromRemoteDevice(double t);
214 void SuspendForRemote();
215 void DisplayCastFrameAfterSuspend(const scoped_refptr<VideoFrame>& new_frame,
216 PipelineStatus status);
217 gfx::Size GetCanvasSize() const;
218 #endif
219
200 private: 220 private:
221 // Ask for the pipeline to be suspended, will call Suspend() when ready.
222 // (Possibly immediately.)
223 void ScheduleSuspend();
224
201 // Initiate suspending the pipeline. 225 // Initiate suspending the pipeline.
202 void Suspend(); 226 void Suspend();
203 227
228 // Ask for the pipeline to be resumed, will call Resume() when ready.
229 // (Possibly immediately.)
230 void ScheduleResume();
231
204 // Initiate resuming the pipeline. 232 // Initiate resuming the pipeline.
205 void Resume(); 233 void Resume();
206 234
207 // Called after |defer_load_cb_| has decided to allow the load. If 235 // Called after |defer_load_cb_| has decided to allow the load. If
208 // |defer_load_cb_| is null this is called immediately. 236 // |defer_load_cb_| is null this is called immediately.
209 void DoLoad(LoadType load_type, 237 void DoLoad(LoadType load_type,
210 const blink::WebURL& url, 238 const blink::WebURL& url,
211 CORSMode cors_mode); 239 CORSMode cors_mode);
212 240
213 // Called after asynchronous initialization of a data source completed. 241 // Called after asynchronous initialization of a data source completed.
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
401 // playback. 429 // playback.
402 scoped_ptr<cc_blink::WebLayerImpl> video_weblayer_; 430 scoped_ptr<cc_blink::WebLayerImpl> video_weblayer_;
403 431
404 EncryptedMediaPlayerSupport encrypted_media_support_; 432 EncryptedMediaPlayerSupport encrypted_media_support_;
405 433
406 scoped_ptr<blink::WebContentDecryptionModuleResult> set_cdm_result_; 434 scoped_ptr<blink::WebContentDecryptionModuleResult> set_cdm_result_;
407 435
408 // Whether a CDM has been successfully attached. 436 // Whether a CDM has been successfully attached.
409 bool is_cdm_attached_; 437 bool is_cdm_attached_;
410 438
439 #if defined(OS_ANDROID) // WMPI_CAST
440 WebMediaPlayerCast cast_impl_;
441 #endif
442
411 scoped_ptr<RendererFactory> renderer_factory_; 443 scoped_ptr<RendererFactory> renderer_factory_;
412 444
413 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); 445 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
414 }; 446 };
415 447
416 } // namespace media 448 } // namespace media
417 449
418 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_ 450 #endif // MEDIA_BLINK_WEBMEDIAPLAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698