summaryrefslogtreecommitdiffstats
path: root/chrome/renderer/media/video_renderer_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/renderer/media/video_renderer_impl.h')
-rw-r--r--chrome/renderer/media/video_renderer_impl.h34
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);
};