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

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

Issue 13813016: Remove reference counting from media::Demuxer and friends. (Closed) Base URL: http://git.chromium.org/chromium/src.git@vd_scoped
Patch Set: demuxer only Created 7 years, 8 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player. 5 // Delegate calls from WebCore::MediaPlayerPrivate to Chrome's video player.
6 // It contains Pipeline which is the actual media player pipeline, it glues 6 // It contains Pipeline which is the actual media player pipeline, it glues
7 // the media player pipeline, data source, audio renderer and renderer. 7 // the media player pipeline, data source, audio renderer and renderer.
8 // Pipeline would creates multiple threads and access some public methods 8 // Pipeline would creates multiple threads and access some public methods
9 // of this class, so we need to be extra careful about concurrent access of 9 // of this class, so we need to be extra careful about concurrent access of
10 // methods and members. 10 // methods and members.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 namespace WebKit { 46 namespace WebKit {
47 class WebFrame; 47 class WebFrame;
48 } 48 }
49 49
50 namespace base { 50 namespace base {
51 class MessageLoopProxy; 51 class MessageLoopProxy;
52 } 52 }
53 53
54 namespace media { 54 namespace media {
55 class ChunkDemuxer; 55 class ChunkDemuxer;
56 class FFmpegDemuxer;
56 class MediaLog; 57 class MediaLog;
57 } 58 }
58 59
59 namespace webkit { 60 namespace webkit {
60 class WebLayerImpl; 61 class WebLayerImpl;
61 } 62 }
62 63
63 namespace webkit_media { 64 namespace webkit_media {
64 65
65 class BufferedDataSource; 66 class BufferedDataSource;
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 // Contains common logic used across the different types loading. 224 // Contains common logic used across the different types loading.
224 void LoadSetup(const WebKit::WebURL& url); 225 void LoadSetup(const WebKit::WebURL& url);
225 226
226 // Called after asynchronous initialization of a data source completed. 227 // Called after asynchronous initialization of a data source completed.
227 void DataSourceInitialized(const GURL& gurl, bool success); 228 void DataSourceInitialized(const GURL& gurl, bool success);
228 229
229 // Called when the data source is downloading or paused. 230 // Called when the data source is downloading or paused.
230 void NotifyDownloading(bool is_downloading); 231 void NotifyDownloading(bool is_downloading);
231 232
232 // Finishes starting the pipeline due to a call to load(). 233 // Finishes starting the pipeline due to a call to load().
233 void StartPipeline(); 234 //
235 // A non-null |media_source| will construct a Media Source pipeline.
236 void StartPipeline(WebKit::WebMediaSource* media_source);
234 237
235 // Helpers that set the network/ready state and notifies the client if 238 // Helpers that set the network/ready state and notifies the client if
236 // they've changed. 239 // they've changed.
237 void SetNetworkState(WebKit::WebMediaPlayer::NetworkState state); 240 void SetNetworkState(WebKit::WebMediaPlayer::NetworkState state);
238 void SetReadyState(WebKit::WebMediaPlayer::ReadyState state); 241 void SetReadyState(WebKit::WebMediaPlayer::ReadyState state);
239 242
240 // Destroy resources held. 243 // Destroy resources held.
241 void Destroy(); 244 void Destroy();
242 245
243 // Getter method to |client_|. 246 // Getter method to |client_|.
(...skipping 21 matching lines...) Expand all
265 // Gets the duration value reported by the pipeline. 268 // Gets the duration value reported by the pipeline.
266 double GetPipelineDuration() const; 269 double GetPipelineDuration() const;
267 270
268 // Notifies WebKit of the duration change. 271 // Notifies WebKit of the duration change.
269 void OnDurationChange(); 272 void OnDurationChange();
270 273
271 // Called by VideoRendererBase on its internal thread with the new frame to be 274 // Called by VideoRendererBase on its internal thread with the new frame to be
272 // painted. 275 // painted.
273 void FrameReady(const scoped_refptr<media::VideoFrame>& frame); 276 void FrameReady(const scoped_refptr<media::VideoFrame>& frame);
274 277
275 // Builds a FilterCollection based on the current configuration of
276 // WebMediaPlayerImpl.
277 scoped_ptr<media::FilterCollection> BuildFilterCollection();
278
279 WebKit::WebFrame* frame_; 278 WebKit::WebFrame* frame_;
280 279
281 // TODO(hclam): get rid of these members and read from the pipeline directly. 280 // TODO(hclam): get rid of these members and read from the pipeline directly.
282 WebKit::WebMediaPlayer::NetworkState network_state_; 281 WebKit::WebMediaPlayer::NetworkState network_state_;
283 WebKit::WebMediaPlayer::ReadyState ready_state_; 282 WebKit::WebMediaPlayer::ReadyState ready_state_;
284 283
285 // Keep a list of buffered time ranges. 284 // Keep a list of buffered time ranges.
286 WebKit::WebTimeRanges buffered_; 285 WebKit::WebTimeRanges buffered_;
287 286
288 // Message loops for posting tasks on Chrome's main thread. Also used 287 // Message loops for posting tasks on Chrome's main thread. Also used
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 339
341 bool is_local_source_; 340 bool is_local_source_;
342 bool supports_save_; 341 bool supports_save_;
343 342
344 // The decryptor that manages decryption keys and decrypts encrypted frames. 343 // The decryptor that manages decryption keys and decrypts encrypted frames.
345 scoped_ptr<ProxyDecryptor> decryptor_; 344 scoped_ptr<ProxyDecryptor> decryptor_;
346 345
347 bool starting_; 346 bool starting_;
348 347
349 // These two are mutually exclusive: 348 // These two are mutually exclusive:
350 // |data_source_| is used for regular resource loads. 349 // |data_source_| and |ffmpeg_demuxer_| are used for regular resource loads.
351 // |chunk_demuxer_| is used for Media Source resource loads. 350 // |chunk_demuxer_| is used for Media Source resource loads.
352 scoped_refptr<BufferedDataSource> data_source_; 351 scoped_refptr<BufferedDataSource> data_source_;
353 scoped_refptr<media::ChunkDemuxer> chunk_demuxer_; 352 scoped_ptr<media::FFmpegDemuxer> ffmpeg_demuxer_;
acolwell GONE FROM CHROMIUM 2013/04/19 18:17:59 WDYT about just making this scoped_ptr<media::Demu
scherkus (not reviewing) 2013/04/19 23:18:45 Works for me!
353 scoped_ptr<media::ChunkDemuxer> chunk_demuxer_;
354 354
355 // Temporary for EME v0.1. In the future the init data type should be passed 355 // Temporary for EME v0.1. In the future the init data type should be passed
356 // through GenerateKeyRequest() directly from WebKit. 356 // through GenerateKeyRequest() directly from WebKit.
357 std::string init_data_type_; 357 std::string init_data_type_;
358 358
359 // Video frame rendering members. 359 // Video frame rendering members.
360 // 360 //
361 // |lock_| protects |current_frame_| since new frames arrive on the video 361 // |lock_| protects |current_frame_| since new frames arrive on the video
362 // rendering thread, yet are accessed for rendering on either the main thread 362 // rendering thread, yet are accessed for rendering on either the main thread
363 // or compositing thread depending on whether accelerated compositing is used. 363 // or compositing thread depending on whether accelerated compositing is used.
364 base::Lock lock_; 364 base::Lock lock_;
365 media::SkCanvasVideoRenderer skcanvas_video_renderer_; 365 media::SkCanvasVideoRenderer skcanvas_video_renderer_;
366 scoped_refptr<media::VideoFrame> current_frame_; 366 scoped_refptr<media::VideoFrame> current_frame_;
367 bool pending_repaint_; 367 bool pending_repaint_;
368 368
369 // The compositor layer for displaying the video content when using composited 369 // The compositor layer for displaying the video content when using composited
370 // playback. 370 // playback.
371 scoped_ptr<webkit::WebLayerImpl> video_weblayer_; 371 scoped_ptr<webkit::WebLayerImpl> video_weblayer_;
372 372
373 // A pointer back to the compositor to inform it about state changes. This is 373 // A pointer back to the compositor to inform it about state changes. This is
374 // not NULL while the compositor is actively using this webmediaplayer. 374 // not NULL while the compositor is actively using this webmediaplayer.
375 cc::VideoFrameProvider::Client* video_frame_provider_client_; 375 cc::VideoFrameProvider::Client* video_frame_provider_client_;
376 376
377 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); 377 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
378 }; 378 };
379 379
380 } // namespace webkit_media 380 } // namespace webkit_media
381 381
382 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ 382 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698