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

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

Issue 8980008: Integrate HTMLMediaElement with Web Audio API's MediaElementAudioSourceNode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 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 | Annotate | Revision Log
« no previous file with comments | « media/base/audio_renderer_sink.h ('k') | webkit/media/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 (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 PipelineImpl which is the actual media player pipeline, it glues 6 // It contains PipelineImpl 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 // PipelineImpl would creates multiple threads and access some public methods 8 // PipelineImpl 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 // at destruction of this class we will need to unhook it from destruction event 45 // at destruction of this class we will need to unhook it from destruction event
46 // list of the main thread. 46 // list of the main thread.
47 47
48 #ifndef WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ 48 #ifndef WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_
49 #define WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ 49 #define WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_
50 50
51 #include "base/memory/ref_counted.h" 51 #include "base/memory/ref_counted.h"
52 #include "base/memory/scoped_ptr.h" 52 #include "base/memory/scoped_ptr.h"
53 #include "base/memory/weak_ptr.h" 53 #include "base/memory/weak_ptr.h"
54 #include "base/message_loop.h" 54 #include "base/message_loop.h"
55 #include "media/base/audio_renderer_sink.h"
55 #include "media/base/filters.h" 56 #include "media/base/filters.h"
56 #include "media/base/message_loop_factory.h" 57 #include "media/base/message_loop_factory.h"
57 #include "media/base/pipeline.h" 58 #include "media/base/pipeline.h"
58 #include "skia/ext/platform_canvas.h" 59 #include "skia/ext/platform_canvas.h"
60 #include "third_party/WebKit/Source/WebKit/chromium/public/WebAudioSourceProvide r.h"
59 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h" 61 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayer.h"
60 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient. h" 62 #include "third_party/WebKit/Source/WebKit/chromium/public/WebMediaPlayerClient. h"
61 63
64 class RenderAudioSourceProvider;
65
62 namespace WebKit { 66 namespace WebKit {
67 class WebAudioSourceProvider;
63 class WebFrame; 68 class WebFrame;
64 } 69 }
65 70
66 namespace media { 71 namespace media {
67 class MediaLog; 72 class MediaLog;
68 } 73 }
69 74
70 namespace webkit_media { 75 namespace webkit_media {
71 76
72 class MediaStreamClient; 77 class MediaStreamClient;
(...skipping 18 matching lines...) Expand all
91 // 2. FFmpeg audio decoder 96 // 2. FFmpeg audio decoder
92 // 3. FFmpeg video decoder 97 // 3. FFmpeg video decoder
93 // 4. Video renderer 98 // 4. Video renderer
94 // 5. Null audio renderer 99 // 5. Null audio renderer
95 // The video renderer provided by this class is using the graphics context 100 // The video renderer provided by this class is using the graphics context
96 // provided by WebKit to perform renderering. The simple data source does 101 // provided by WebKit to perform renderering. The simple data source does
97 // resource loading by loading the whole resource object into memory. Null 102 // resource loading by loading the whole resource object into memory. Null
98 // audio renderer is a fake audio device that plays silence. Provider of the 103 // audio renderer is a fake audio device that plays silence. Provider of the
99 // |collection| can override the default filters by adding extra filters to 104 // |collection| can override the default filters by adding extra filters to
100 // |collection| before calling this method. 105 // |collection| before calling this method.
106 // This object takes ownership of the |audio_source_provider|.
Ami GONE FROM CHROMIUM 2012/01/13 18:02:15 This comment is a lie in patchset 11 (and what end
101 // 107 //
102 // Callers must call |Initialize()| before they can use the object. 108 // Callers must call |Initialize()| before they can use the object.
103 WebMediaPlayerImpl(WebKit::WebMediaPlayerClient* client, 109 WebMediaPlayerImpl(WebKit::WebMediaPlayerClient* client,
104 base::WeakPtr<WebMediaPlayerDelegate> delegate, 110 base::WeakPtr<WebMediaPlayerDelegate> delegate,
105 media::FilterCollection* collection, 111 media::FilterCollection* collection,
112 WebKit::WebAudioSourceProvider* audio_source_provider,
106 media::MessageLoopFactory* message_loop_factory, 113 media::MessageLoopFactory* message_loop_factory,
107 MediaStreamClient* media_stream_client, 114 MediaStreamClient* media_stream_client,
108 media::MediaLog* media_log); 115 media::MediaLog* media_log);
109 virtual ~WebMediaPlayerImpl(); 116 virtual ~WebMediaPlayerImpl();
110 117
111 // Finalizes initialization of the object. 118 // Finalizes initialization of the object.
112 bool Initialize(WebKit::WebFrame* frame, bool use_simple_data_source); 119 bool Initialize(WebKit::WebFrame* frame, bool use_simple_data_source);
113 120
114 virtual void load(const WebKit::WebURL& url); 121 virtual void load(const WebKit::WebURL& url);
115 virtual void cancelLoad(); 122 virtual void cancelLoad();
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 virtual float mediaTimeForTimeValue(float timeValue) const; 172 virtual float mediaTimeForTimeValue(float timeValue) const;
166 173
167 virtual unsigned decodedFrameCount() const; 174 virtual unsigned decodedFrameCount() const;
168 virtual unsigned droppedFrameCount() const; 175 virtual unsigned droppedFrameCount() const;
169 virtual unsigned audioDecodedByteCount() const; 176 virtual unsigned audioDecodedByteCount() const;
170 virtual unsigned videoDecodedByteCount() const; 177 virtual unsigned videoDecodedByteCount() const;
171 178
172 virtual WebKit::WebVideoFrame* getCurrentFrame(); 179 virtual WebKit::WebVideoFrame* getCurrentFrame();
173 virtual void putCurrentFrame(WebKit::WebVideoFrame* web_video_frame); 180 virtual void putCurrentFrame(WebKit::WebVideoFrame* web_video_frame);
174 181
182 virtual WebKit::WebAudioSourceProvider* audioSourceProvider();
183
175 virtual bool sourceAppend(const unsigned char* data, unsigned length); 184 virtual bool sourceAppend(const unsigned char* data, unsigned length);
176 virtual void sourceEndOfStream(EndOfStreamStatus status); 185 virtual void sourceEndOfStream(EndOfStreamStatus status);
177 186
178 // As we are closing the tab or even the browser, |main_loop_| is destroyed 187 // As we are closing the tab or even the browser, |main_loop_| is destroyed
179 // even before this object gets destructed, so we need to know when 188 // even before this object gets destructed, so we need to know when
180 // |main_loop_| is being destroyed and we can stop posting repaint task 189 // |main_loop_| is being destroyed and we can stop posting repaint task
181 // to it. 190 // to it.
182 virtual void WillDestroyCurrentMessageLoop() OVERRIDE; 191 virtual void WillDestroyCurrentMessageLoop() OVERRIDE;
183 192
184 void Repaint(); 193 void Repaint();
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 #if WEBKIT_USING_CG 267 #if WEBKIT_USING_CG
259 scoped_ptr<skia::PlatformCanvas> skia_canvas_; 268 scoped_ptr<skia::PlatformCanvas> skia_canvas_;
260 #endif 269 #endif
261 270
262 scoped_refptr<media::MediaLog> media_log_; 271 scoped_refptr<media::MediaLog> media_log_;
263 272
264 bool is_accelerated_compositing_active_; 273 bool is_accelerated_compositing_active_;
265 274
266 bool incremented_externally_allocated_memory_; 275 bool incremented_externally_allocated_memory_;
267 276
277 WebKit::WebAudioSourceProvider* audio_source_provider_;
278
268 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl); 279 DISALLOW_COPY_AND_ASSIGN(WebMediaPlayerImpl);
269 }; 280 };
270 281
271 } // namespace webkit_media 282 } // namespace webkit_media
272 283
273 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_ 284 #endif // WEBKIT_MEDIA_WEBMEDIAPLAYER_IMPL_H_
OLDNEW
« no previous file with comments | « media/base/audio_renderer_sink.h ('k') | webkit/media/webmediaplayer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698