diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-03 04:52:53 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-03 04:52:53 +0000 |
commit | d43ed917b1f7e8f875d2ee2aa0587512e265e28e (patch) | |
tree | 64b04bda5e59e98a387235000779a2b050f9fa2b /chrome/renderer/media/video_renderer_impl.h | |
parent | 08e6413a6565ba434e1054a1df1c9fb778dad352 (diff) | |
download | chromium_src-d43ed917b1f7e8f875d2ee2aa0587512e265e28e.zip chromium_src-d43ed917b1f7e8f875d2ee2aa0587512e265e28e.tar.gz chromium_src-d43ed917b1f7e8f875d2ee2aa0587512e265e28e.tar.bz2 |
Merged with latest media pipeline and cleaned up some style stuff.
Changed WebMediaPlayerDelegateImpl to contains a PipelineImpl object rather keeping a pointer to Pipeline interface. Also added code for task coordination between pipeline thread and main thread.
Review URL: http://codereview.chromium.org/19481
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9069 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/renderer/media/video_renderer_impl.h')
-rw-r--r-- | chrome/renderer/media/video_renderer_impl.h | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/chrome/renderer/media/video_renderer_impl.h b/chrome/renderer/media/video_renderer_impl.h index 9b58266..38a7124 100644 --- a/chrome/renderer/media/video_renderer_impl.h +++ b/chrome/renderer/media/video_renderer_impl.h @@ -1,15 +1,29 @@ // Copyright (c) 2009 The Chromium Authors. All rights reserved. Use of this // source code is governed by a BSD-style license that can be found in the // LICENSE file. +// +// The video renderer implementation to be use by the media pipeline. It lives +// inside video renderer thread and also WebKit's main thread. We need to be +// extra careful about members shared by two different threads, especially +// video frame buffers. +// +// Methods called from WebKit's main thread: +// Paint() +// SetRect() #ifndef CHROME_RENDERER_MEDIA_VIDEO_RENDERER_H_ #define CHROME_RENDERER_MEDIA_VIDEO_RENDERER_H_ +#include "base/gfx/platform_canvas.h" +#include "base/gfx/rect.h" +#include "media/base/factory.h" #include "media/base/filters.h" +class WebMediaPlayerDelegateImpl; + class VideoRendererImpl : public media::VideoRenderer { public: - VideoRendererImpl(); + VideoRendererImpl(WebMediaPlayerDelegateImpl* delegate); // media::MediaFilter implementation. virtual void Stop(); @@ -17,10 +31,28 @@ class VideoRendererImpl : public media::VideoRenderer { // media::VideoRenderer implementation. virtual bool Initialize(media::VideoDecoder* decoder); + // Called from WebMediaPlayerDelegateImpl from WebKit's main thread. + void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& rect); + + // Called from WebMediaPlayerDelegateImpl from WebKit's main thread. + void SetRect(const gfx::Rect& rect); + + // Static method for creating factory for this object. + static media::FilterFactory* CreateFactory( + WebMediaPlayerDelegateImpl* delegate) { + return new media::FilterFactoryImpl1< + VideoRendererImpl, WebMediaPlayerDelegateImpl*>(delegate); + } + + // Answers question from the factory to see if we accept |format|. + static bool IsMediaFormatSupported(const media::MediaFormat* format); + protected: virtual ~VideoRendererImpl(); private: + WebMediaPlayerDelegateImpl* delegate_; + DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); }; |