OLD | NEW |
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 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_IMPL_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
15 #include "media/video/capture/video_capture.h" | 15 #include "media/video/capture/video_capture.h" |
| 16 #include "media/video/capture/video_capture_types.h" |
16 #include "webkit/plugins/ppapi/plugin_delegate.h" | 17 #include "webkit/plugins/ppapi/plugin_delegate.h" |
17 | 18 |
18 namespace media { | 19 namespace media { |
19 class VideoCaptureHandlerProxy; | 20 class VideoCaptureHandlerProxy; |
20 } | 21 } |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 | 24 |
24 class PepperPluginDelegateImpl; | 25 class PepperPluginDelegateImpl; |
25 | 26 |
26 class PepperPlatformVideoCaptureImpl | 27 class PepperPlatformVideoCaptureImpl |
27 : public webkit::ppapi::PluginDelegate::PlatformVideoCapture, | 28 : public webkit::ppapi::PluginDelegate::PlatformVideoCapture, |
28 public media::VideoCapture::EventHandler { | 29 public media::VideoCapture::EventHandler { |
29 public: | 30 public: |
30 PepperPlatformVideoCaptureImpl( | 31 PepperPlatformVideoCaptureImpl( |
31 const base::WeakPtr<PepperPluginDelegateImpl>& plugin_delegate, | 32 const base::WeakPtr<PepperPluginDelegateImpl>& plugin_delegate, |
32 const std::string& device_id, | 33 const std::string& device_id, |
33 webkit::ppapi::PluginDelegate::PlatformVideoCaptureEventHandler* handler); | 34 webkit::ppapi::PluginDelegate::PlatformVideoCaptureEventHandler* handler); |
34 virtual ~PepperPlatformVideoCaptureImpl(); | 35 virtual ~PepperPlatformVideoCaptureImpl(); |
35 | 36 |
36 // webkit::ppapi::PluginDelegate::PlatformVideoCapture implementation. | 37 // webkit::ppapi::PluginDelegate::PlatformVideoCapture implementation. |
37 virtual void StartCapture(media::VideoCapture::EventHandler* handler, | 38 virtual void StartCapture( |
38 const VideoCaptureCapability& capability) OVERRIDE; | 39 media::VideoCapture::EventHandler* handler, |
| 40 const media::VideoCaptureCapability& capability) OVERRIDE; |
39 virtual void StopCapture(media::VideoCapture::EventHandler* handler) OVERRIDE; | 41 virtual void StopCapture(media::VideoCapture::EventHandler* handler) OVERRIDE; |
40 virtual void FeedBuffer(scoped_refptr<VideoFrameBuffer> buffer) OVERRIDE; | 42 virtual void FeedBuffer(scoped_refptr<VideoFrameBuffer> buffer) OVERRIDE; |
41 virtual bool CaptureStarted() OVERRIDE; | 43 virtual bool CaptureStarted() OVERRIDE; |
42 virtual int CaptureWidth() OVERRIDE; | 44 virtual int CaptureWidth() OVERRIDE; |
43 virtual int CaptureHeight() OVERRIDE; | 45 virtual int CaptureHeight() OVERRIDE; |
44 virtual int CaptureFrameRate() OVERRIDE; | 46 virtual int CaptureFrameRate() OVERRIDE; |
45 virtual void DetachEventHandler() OVERRIDE; | 47 virtual void DetachEventHandler() OVERRIDE; |
46 | 48 |
47 // media::VideoCapture::EventHandler implementation | 49 // media::VideoCapture::EventHandler implementation |
48 virtual void OnStarted(VideoCapture* capture) OVERRIDE; | 50 virtual void OnStarted(VideoCapture* capture) OVERRIDE; |
(...skipping 29 matching lines...) Expand all Loading... |
78 // StartCapture() must be balanced by StopCapture(), otherwise this object | 80 // StartCapture() must be balanced by StopCapture(), otherwise this object |
79 // will leak. | 81 // will leak. |
80 bool unbalanced_start_; | 82 bool unbalanced_start_; |
81 | 83 |
82 DISALLOW_COPY_AND_ASSIGN(PepperPlatformVideoCaptureImpl); | 84 DISALLOW_COPY_AND_ASSIGN(PepperPlatformVideoCaptureImpl); |
83 }; | 85 }; |
84 | 86 |
85 } // namespace content | 87 } // namespace content |
86 | 88 |
87 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_IMPL_H_ | 89 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_VIDEO_CAPTURE_IMPL_H_ |
OLD | NEW |