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 #include "ppapi/c/pp_errors.h" | 5 #include "ppapi/c/pp_errors.h" |
6 #include "ppapi/shared_impl/ppb_device_ref_shared.h" | 6 #include "ppapi/shared_impl/ppb_device_ref_shared.h" |
7 #include "ppapi/shared_impl/tracked_callback.h" | 7 #include "ppapi/shared_impl/tracked_callback.h" |
8 #include "ppapi/thunk/enter.h" | 8 #include "ppapi/thunk/enter.h" |
9 #include "ppapi/thunk/ppb_device_ref_api.h" | 9 #include "ppapi/thunk/ppb_device_ref_api.h" |
10 #include "ppapi/thunk/ppb_video_capture_api.h" | 10 #include "ppapi/thunk/ppb_video_capture_api.h" |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
85 return enter.retval(); | 85 return enter.retval(); |
86 return enter.object()->StopCapture(); | 86 return enter.object()->StopCapture(); |
87 } | 87 } |
88 | 88 |
89 void Close(PP_Resource video_capture) { | 89 void Close(PP_Resource video_capture) { |
90 EnterVideoCapture enter(video_capture, true); | 90 EnterVideoCapture enter(video_capture, true); |
91 if (enter.succeeded()) | 91 if (enter.succeeded()) |
92 enter.object()->Close(); | 92 enter.object()->Close(); |
93 } | 93 } |
94 | 94 |
95 int32_t StartCapture0_1(PP_Resource video_capture, | |
96 const PP_VideoCaptureDeviceInfo_Dev* requested_info, | |
97 uint32_t buffer_count) { | |
98 EnterVideoCapture enter(video_capture, true); | |
99 if (enter.failed()) | |
100 return enter.retval(); | |
101 | |
102 return enter.object()->StartCapture0_1(*requested_info, buffer_count); | |
103 } | |
104 | |
105 const PPB_VideoCapture_Dev_0_1 g_ppb_video_capture_0_1_thunk = { | |
106 &Create, | |
107 &IsVideoCapture, | |
108 &StartCapture0_1, | |
109 &ReuseBuffer, | |
110 &StopCapture | |
111 }; | |
112 | |
113 const PPB_VideoCapture_Dev_0_2 g_ppb_video_capture_0_2_thunk = { | 95 const PPB_VideoCapture_Dev_0_2 g_ppb_video_capture_0_2_thunk = { |
114 &Create, | 96 &Create, |
115 &IsVideoCapture, | 97 &IsVideoCapture, |
116 &EnumerateDevices, | 98 &EnumerateDevices, |
117 &Open, | 99 &Open, |
118 &StartCapture, | 100 &StartCapture, |
119 &ReuseBuffer, | 101 &ReuseBuffer, |
120 &StopCapture, | 102 &StopCapture, |
121 &Close | 103 &Close |
122 }; | 104 }; |
123 | 105 |
124 } // namespace | 106 } // namespace |
125 | 107 |
126 const PPB_VideoCapture_Dev_0_1* GetPPB_VideoCapture_Dev_0_1_Thunk() { | |
127 return &g_ppb_video_capture_0_1_thunk; | |
128 } | |
129 | |
130 const PPB_VideoCapture_Dev_0_2* GetPPB_VideoCapture_Dev_0_2_Thunk() { | 108 const PPB_VideoCapture_Dev_0_2* GetPPB_VideoCapture_Dev_0_2_Thunk() { |
131 return &g_ppb_video_capture_0_2_thunk; | 109 return &g_ppb_video_capture_0_2_thunk; |
132 } | 110 } |
133 | 111 |
134 } // namespace thunk | 112 } // namespace thunk |
135 } // namespace ppapi | 113 } // namespace ppapi |
OLD | NEW |