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

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

Issue 10662030: WebMediaPlayerImpl needs to own the audio source provider. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Created 8 years, 5 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 | Annotate | Revision Log
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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 class RenderAudioSourceProvider; 68 class RenderAudioSourceProvider;
69 69
70 namespace WebKit { 70 namespace WebKit {
71 class WebAudioSourceProvider; 71 class WebAudioSourceProvider;
72 class WebFrame; 72 class WebFrame;
73 } 73 }
74 74
75 namespace media { 75 namespace media {
76 class MediaLog; 76 class MediaLog;
77 class AudioRendererSink;
scherkus (not reviewing) 2012/07/09 23:13:23 a->z ordering
Raymond Toy 2012/07/10 02:51:39 Done.
77 } 78 }
78 79
79 namespace webkit_media { 80 namespace webkit_media {
80 81
81 class MediaStreamClient; 82 class MediaStreamClient;
82 class WebMediaPlayerDelegate; 83 class WebMediaPlayerDelegate;
83 class WebMediaPlayerProxy; 84 class WebMediaPlayerProxy;
84 85
85 class WebMediaPlayerImpl 86 class WebMediaPlayerImpl
86 : public WebKit::WebMediaPlayer, 87 : public WebKit::WebMediaPlayer,
87 public MessageLoop::DestructionObserver, 88 public MessageLoop::DestructionObserver,
88 public base::SupportsWeakPtr<WebMediaPlayerImpl> { 89 public base::SupportsWeakPtr<WebMediaPlayerImpl> {
89 public: 90 public:
90 // Construct a WebMediaPlayerImpl with reference to the client, and media 91 // Construct a WebMediaPlayerImpl with reference to the client, and media
91 // filter collection. By providing the filter collection the implementor can 92 // filter collection. By providing the filter collection the implementor can
92 // provide more specific media filters that does resource loading and 93 // provide more specific media filters that does resource loading and
93 // rendering. 94 // rendering.
94 // 95 //
95 // WebMediaPlayerImpl comes packaged with the following media filters: 96 // WebMediaPlayerImpl comes packaged with the following media filters:
96 // - URL fetching 97 // - URL fetching
97 // - Demuxing 98 // - Demuxing
98 // - Software audio/video decoding 99 // - Software audio/video decoding
99 // - Video rendering 100 // - Video rendering
100 // 101 //
101 // Clients are expected to add their platform-specific audio rendering media 102 // Clients are expected to add their platform-specific audio rendering media
102 // filter if they wish to hear any sound coming out the speakers, otherwise 103 // filter if they wish to hear any sound coming out the speakers, otherwise
103 // audio data is discarded and media plays back based on wall clock time. 104 // audio data is discarded and media plays back based on wall clock time.
104 // 105 //
106 // When calling this, the audio_source_provider and
107 // audio_renderer_sink arguments should be the same object.
scherkus (not reviewing) 2012/07/09 23:13:23 add || around variable names referenced in comment
Raymond Toy 2012/07/10 02:51:39 Done.
105 WebMediaPlayerImpl(WebKit::WebFrame* frame, 108 WebMediaPlayerImpl(WebKit::WebFrame* frame,
106 WebKit::WebMediaPlayerClient* client, 109 WebKit::WebMediaPlayerClient* client,
107 base::WeakPtr<WebMediaPlayerDelegate> delegate, 110 base::WeakPtr<WebMediaPlayerDelegate> delegate,
108 media::FilterCollection* collection, 111 media::FilterCollection* collection,
109 WebKit::WebAudioSourceProvider* audio_source_provider, 112 WebKit::WebAudioSourceProvider* audio_source_provider,
113 media::AudioRendererSink* audio_renderer_sink,
110 media::MessageLoopFactory* message_loop_factory, 114 media::MessageLoopFactory* message_loop_factory,
111 MediaStreamClient* media_stream_client, 115 MediaStreamClient* media_stream_client,
112 media::MediaLog* media_log); 116 media::MediaLog* media_log);
113 virtual ~WebMediaPlayerImpl(); 117 virtual ~WebMediaPlayerImpl();
114 118
115 virtual void load(const WebKit::WebURL& url, CORSMode cors_mode); 119 virtual void load(const WebKit::WebURL& url, CORSMode cors_mode);
116 virtual void cancelLoad(); 120 virtual void cancelLoad();
117 121
118 // Playback controls. 122 // Playback controls.
119 virtual void play(); 123 virtual void play();
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
330 scoped_refptr<media::MediaLog> media_log_; 334 scoped_refptr<media::MediaLog> media_log_;
331 335
332 // Since accelerated compositing status is only known after the first layout, 336 // Since accelerated compositing status is only known after the first layout,
333 // we delay reporting it to UMA until that time. 337 // we delay reporting it to UMA until that time.
334 bool accelerated_compositing_reported_; 338 bool accelerated_compositing_reported_;
335 339
336 bool incremented_externally_allocated_memory_; 340 bool incremented_externally_allocated_memory_;
337 341
338 WebKit::WebAudioSourceProvider* audio_source_provider_; 342 WebKit::WebAudioSourceProvider* audio_source_provider_;
339 343
344 // We need to own the audio_renderer_sink to prevent the sink from
345 // getting deleted before we are finished with it. This should be
346 // the same as audio_source_provider_.
scherkus (not reviewing) 2012/07/09 23:13:23 I'd remove the comment -- it's OK to assume this c
Raymond Toy 2012/07/10 02:51:39 Comment removed. But see comment for .cc where we
347 scoped_refptr<media::AudioRendererSink> audio_renderer_sink_;
348
340 bool is_local_source_; 349 bool is_local_source_;
341 350
342 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); 351 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
343 }; 352 };
344 353
345 } // namespace webkit_media 354 } // namespace webkit_media
346 355
347 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ 356 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698