OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "ppapi/proxy/ppb_video_capture_proxy.h" | 5 #include "ppapi/proxy/ppb_video_capture_proxy.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
11 #include "ppapi/c/pp_errors.h" | 11 #include "ppapi/c/pp_errors.h" |
12 #include "ppapi/c/pp_resource.h" | 12 #include "ppapi/c/pp_resource.h" |
13 #include "ppapi/c/ppb_core.h" | 13 #include "ppapi/c/ppb_core.h" |
14 #include "ppapi/c/dev/ppb_video_capture_dev.h" | 14 #include "ppapi/c/dev/ppb_video_capture_dev.h" |
15 #include "ppapi/c/dev/ppp_video_capture_dev.h" | 15 #include "ppapi/c/dev/ppp_video_capture_dev.h" |
16 #include "ppapi/proxy/enter_proxy.h" | 16 #include "ppapi/proxy/enter_proxy.h" |
17 #include "ppapi/proxy/host_dispatcher.h" | 17 #include "ppapi/proxy/host_dispatcher.h" |
18 #include "ppapi/proxy/plugin_dispatcher.h" | 18 #include "ppapi/proxy/plugin_dispatcher.h" |
19 #include "ppapi/proxy/ppapi_messages.h" | 19 #include "ppapi/proxy/ppapi_messages.h" |
20 #include "ppapi/proxy/ppb_buffer_proxy.h" | 20 #include "ppapi/proxy/ppb_buffer_proxy.h" |
21 #include "ppapi/thunk/ppb_buffer_api.h" | 21 #include "ppapi/thunk/ppb_buffer_api.h" |
22 #include "ppapi/thunk/ppb_buffer_trusted_api.h" | 22 #include "ppapi/thunk/ppb_buffer_trusted_api.h" |
23 #include "ppapi/thunk/ppb_video_capture_api.h" | 23 #include "ppapi/thunk/ppb_video_capture_api.h" |
24 #include "ppapi/thunk/thunk.h" | 24 #include "ppapi/thunk/thunk.h" |
25 | 25 |
26 using ppapi::HostResource; | |
27 using ppapi::Resource; | |
28 using ppapi::thunk::EnterResourceNoLock; | 26 using ppapi::thunk::EnterResourceNoLock; |
29 using ppapi::thunk::PPB_Buffer_API; | 27 using ppapi::thunk::PPB_Buffer_API; |
30 using ppapi::thunk::PPB_BufferTrusted_API; | 28 using ppapi::thunk::PPB_BufferTrusted_API; |
31 using ppapi::thunk::PPB_VideoCapture_API; | 29 using ppapi::thunk::PPB_VideoCapture_API; |
32 | 30 |
33 namespace pp { | 31 namespace ppapi { |
34 namespace proxy { | 32 namespace proxy { |
35 | 33 |
36 namespace { | 34 namespace { |
37 | 35 |
38 InterfaceProxy* CreatePPBVideoCaptureProxy(Dispatcher* dispatcher, | 36 InterfaceProxy* CreatePPBVideoCaptureProxy(Dispatcher* dispatcher, |
39 const void* target_interface) { | 37 const void* target_interface) { |
40 return new PPB_VideoCapture_Proxy(dispatcher, target_interface); | 38 return new PPB_VideoCapture_Proxy(dispatcher, target_interface); |
41 } | 39 } |
42 | 40 |
43 InterfaceProxy* CreatePPPVideoCaptureProxy(Dispatcher* dispatcher, | 41 InterfaceProxy* CreatePPPVideoCaptureProxy(Dispatcher* dispatcher, |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 PluginResourceTracker* tracker = PluginResourceTracker::GetInstance(); | 443 PluginResourceTracker* tracker = PluginResourceTracker::GetInstance(); |
446 PP_Resource resource = tracker->PluginResourceForHostResource(host_resource); | 444 PP_Resource resource = tracker->PluginResourceForHostResource(host_resource); |
447 if (!resource || !ppp_video_capture_target() || enter.failed()) | 445 if (!resource || !ppp_video_capture_target() || enter.failed()) |
448 return; | 446 return; |
449 static_cast<VideoCapture*>(enter.object())->SetBufferInUse(buffer); | 447 static_cast<VideoCapture*>(enter.object())->SetBufferInUse(buffer); |
450 ppp_video_capture_target()->OnBufferReady( | 448 ppp_video_capture_target()->OnBufferReady( |
451 host_resource.instance(), resource, buffer); | 449 host_resource.instance(), resource, buffer); |
452 } | 450 } |
453 | 451 |
454 } // namespace proxy | 452 } // namespace proxy |
455 } // namespace pp | 453 } // namespace ppapi |
OLD | NEW |