| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // The video renderer implementation to be use by the media pipeline. It lives | 5 // The video renderer implementation to be use by the media pipeline. It lives |
| 6 // inside video renderer thread and also WebKit's main thread. We need to be | 6 // inside video renderer thread and also WebKit's main thread. We need to be |
| 7 // extra careful about members shared by two different threads, especially | 7 // extra careful about members shared by two different threads, especially |
| 8 // video frame buffers. | 8 // video frame buffers. |
| 9 | 9 |
| 10 #ifndef WEBKIT_GLUE_MEDIA_VIDEO_RENDERER_IMPL_H_ | 10 #ifndef WEBKIT_GLUE_MEDIA_VIDEO_RENDERER_IMPL_H_ |
| 11 #define WEBKIT_GLUE_MEDIA_VIDEO_RENDERER_IMPL_H_ | 11 #define WEBKIT_GLUE_MEDIA_VIDEO_RENDERER_IMPL_H_ |
| 12 | 12 |
| 13 #include "gfx/rect.h" | 13 #include "gfx/rect.h" |
| 14 #include "gfx/size.h" | 14 #include "gfx/size.h" |
| 15 #include "media/base/buffers.h" | 15 #include "media/base/buffers.h" |
| 16 #include "media/base/filters.h" | 16 #include "media/base/filters.h" |
| 17 #include "media/filters/video_renderer_base.h" | 17 #include "media/filters/video_renderer_base.h" |
| 18 #include "skia/ext/platform_canvas.h" | 18 #include "skia/ext/platform_canvas.h" |
| 19 #include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayer.h" | 19 #include "third_party/WebKit/WebKit/chromium/public/WebMediaPlayer.h" |
| 20 #include "webkit/glue/media/web_video_renderer.h" | 20 #include "webkit/glue/media/web_video_renderer.h" |
| 21 #include "webkit/glue/webmediaplayer_impl.h" | 21 #include "webkit/glue/webmediaplayer_impl.h" |
| 22 | 22 |
| 23 namespace webkit_glue { | 23 namespace webkit_glue { |
| 24 | 24 |
| 25 class VideoRendererImpl : public WebVideoRenderer { | 25 class VideoRendererImpl : public WebVideoRenderer { |
| 26 public: | 26 public: |
| 27 // WebVideoRenderer implementation. | 27 // WebVideoRenderer implementation. |
| 28 virtual void SetRect(const gfx::Rect& rect); | 28 virtual void SetRect(const gfx::Rect& rect); |
| 29 virtual void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect); | 29 virtual void Paint(skia::PlatformCanvas* canvas, const gfx::Rect& dest_rect); |
| 30 virtual void GetCurrentFrame(scoped_refptr<media::VideoFrame>* frame_out); |
| 31 virtual void PutCurrentFrame(scoped_refptr<media::VideoFrame> frame); |
| 30 | 32 |
| 31 // Static method for creating factory for this object. | 33 // Static method for creating factory for this object. |
| 32 static media::FilterFactory* CreateFactory(WebMediaPlayerImpl::Proxy* proxy, | 34 static media::FilterFactory* CreateFactory(WebMediaPlayerImpl::Proxy* proxy, |
| 33 bool pts_logging); | 35 bool pts_logging); |
| 34 | 36 |
| 35 // FilterFactoryImpl2 implementation. | 37 // FilterFactoryImpl2 implementation. |
| 36 static bool IsMediaFormatSupported(const media::MediaFormat& media_format); | 38 static bool IsMediaFormatSupported(const media::MediaFormat& media_format); |
| 37 | 39 |
| 38 // TODO(scherkus): remove this mega-hack, see http://crbug.com/28207 | 40 // TODO(scherkus): remove this mega-hack, see http://crbug.com/28207 |
| 39 class FactoryFactory : public webkit_glue::WebVideoRendererFactoryFactory { | 41 class FactoryFactory : public webkit_glue::WebVideoRendererFactoryFactory { |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 115 |
| 114 // Whether we're logging video presentation timestamps (PTS). | 116 // Whether we're logging video presentation timestamps (PTS). |
| 115 bool pts_logging_; | 117 bool pts_logging_; |
| 116 | 118 |
| 117 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); | 119 DISALLOW_COPY_AND_ASSIGN(VideoRendererImpl); |
| 118 }; | 120 }; |
| 119 | 121 |
| 120 } // namespace webkit_glue | 122 } // namespace webkit_glue |
| 121 | 123 |
| 122 #endif // WEBKIT_GLUE_MEDIA_VIDEO_RENDERER_IMPL_H_ | 124 #endif // WEBKIT_GLUE_MEDIA_VIDEO_RENDERER_IMPL_H_ |
| OLD | NEW |