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_VIDEO_CAPTURE_HOST_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_CAPTURE_HOST_H_ |
6 #define CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_CAPTURE_HOST_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_CAPTURE_HOST_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
10 #include "content/public/renderer/renderer_ppapi_host.h" | 10 #include "content/public/renderer/renderer_ppapi_host.h" |
11 #include "content/renderer/pepper/pepper_device_enumeration_host_helper.h" | 11 #include "content/renderer/pepper/pepper_device_enumeration_host_helper.h" |
12 #include "media/video/capture/video_capture.h" | 12 #include "media/video/capture/video_capture.h" |
13 #include "media/video/capture/video_capture_types.h" | 13 #include "media/video/capture/video_capture_types.h" |
14 #include "ppapi/c/dev/ppp_video_capture_dev.h" | 14 #include "ppapi/c/dev/ppp_video_capture_dev.h" |
15 #include "ppapi/host/host_message_context.h" | 15 #include "ppapi/host/host_message_context.h" |
16 #include "ppapi/host/resource_host.h" | 16 #include "ppapi/host/resource_host.h" |
17 #include "webkit/plugins/ppapi/plugin_delegate.h" | 17 #include "webkit/plugins/ppapi/plugin_delegate.h" |
18 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" | 18 #include "webkit/plugins/ppapi/ppb_buffer_impl.h" |
19 | 19 |
20 namespace content { | 20 namespace content { |
| 21 class RendererPpapiHostImpl; |
21 | 22 |
22 class PepperVideoCaptureHost | 23 class PepperVideoCaptureHost |
23 : public ppapi::host::ResourceHost, | 24 : public ppapi::host::ResourceHost, |
24 public webkit::ppapi::PluginDelegate::PlatformVideoCaptureEventHandler, | 25 public webkit::ppapi::PluginDelegate::PlatformVideoCaptureEventHandler, |
25 public PepperDeviceEnumerationHostHelper::Delegate { | 26 public PepperDeviceEnumerationHostHelper::Delegate { |
26 public: | 27 public: |
27 PepperVideoCaptureHost(RendererPpapiHost* host, | 28 PepperVideoCaptureHost(RendererPpapiHostImpl* host, |
28 PP_Instance instance, | 29 PP_Instance instance, |
29 PP_Resource resource); | 30 PP_Resource resource); |
30 | 31 |
31 virtual ~PepperVideoCaptureHost(); | 32 virtual ~PepperVideoCaptureHost(); |
32 | 33 |
33 bool Init(); | 34 bool Init(); |
34 | 35 |
35 virtual int32_t OnResourceMessageReceived( | 36 virtual int32_t OnResourceMessageReceived( |
36 const IPC::Message& msg, | 37 const IPC::Message& msg, |
37 ppapi::host::HostMessageContext* context) OVERRIDE; | 38 ppapi::host::HostMessageContext* context) OVERRIDE; |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 // Buffers of video frame. | 84 // Buffers of video frame. |
84 struct BufferInfo { | 85 struct BufferInfo { |
85 BufferInfo(); | 86 BufferInfo(); |
86 ~BufferInfo(); | 87 ~BufferInfo(); |
87 | 88 |
88 bool in_use; | 89 bool in_use; |
89 void* data; | 90 void* data; |
90 scoped_refptr<webkit::ppapi::PPB_Buffer_Impl> buffer; | 91 scoped_refptr<webkit::ppapi::PPB_Buffer_Impl> buffer; |
91 }; | 92 }; |
92 | 93 |
93 RendererPpapiHost* renderer_ppapi_host_; | 94 RendererPpapiHostImpl* renderer_ppapi_host_; |
94 | 95 |
95 std::vector<BufferInfo> buffers_; | 96 std::vector<BufferInfo> buffers_; |
96 size_t buffer_count_hint_; | 97 size_t buffer_count_hint_; |
97 | 98 |
98 media::VideoCaptureCapability capability_; | 99 media::VideoCaptureCapability capability_; |
99 | 100 |
100 PP_VideoCaptureStatus_Dev status_; | 101 PP_VideoCaptureStatus_Dev status_; |
101 | 102 |
102 ppapi::host::ReplyMessageContext open_reply_context_; | 103 ppapi::host::ReplyMessageContext open_reply_context_; |
103 | 104 |
104 PepperDeviceEnumerationHostHelper enumeration_helper_; | 105 PepperDeviceEnumerationHostHelper enumeration_helper_; |
105 | 106 |
106 DISALLOW_COPY_AND_ASSIGN(PepperVideoCaptureHost); | 107 DISALLOW_COPY_AND_ASSIGN(PepperVideoCaptureHost); |
107 }; | 108 }; |
108 | 109 |
109 } // namespace content | 110 } // namespace content |
110 | 111 |
111 #endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_CAPTURE_HOST_H_ | 112 #endif // CONTENT_RENDERER_PEPPER_PEPPER_VIDEO_CAPTURE_HOST_H_ |
OLD | NEW |