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/proxy/video_capture_resource.h" | 5 #include "ppapi/proxy/video_capture_resource.h" |
6 | 6 |
7 #include "ppapi/c/dev/ppp_video_capture_dev.h" | 7 #include "ppapi/c/dev/ppp_video_capture_dev.h" |
8 #include "ppapi/proxy/dispatch_reply_message.h" | 8 #include "ppapi/proxy/dispatch_reply_message.h" |
9 #include "ppapi/proxy/plugin_dispatcher.h" | 9 #include "ppapi/proxy/plugin_dispatcher.h" |
10 #include "ppapi/proxy/plugin_globals.h" | 10 #include "ppapi/proxy/plugin_globals.h" |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 resources[i] = ppapi::proxy::PPB_Buffer_Proxy::AddProxyResource( | 159 resources[i] = ppapi::proxy::PPB_Buffer_Proxy::AddProxyResource( |
160 buffers[i], handles[i], buffer_size); | 160 buffers[i], handles[i], buffer_size); |
161 } | 161 } |
162 | 162 |
163 buffer_in_use_ = std::vector<bool>(buffers.size()); | 163 buffer_in_use_ = std::vector<bool>(buffers.size()); |
164 | 164 |
165 CallWhileUnlocked(ppp_video_capture_impl_->OnDeviceInfo, | 165 CallWhileUnlocked(ppp_video_capture_impl_->OnDeviceInfo, |
166 pp_instance(), | 166 pp_instance(), |
167 pp_resource(), | 167 pp_resource(), |
168 &info, | 168 &info, |
169 buffers.size(), | 169 static_cast<uint32_t>(buffers.size()), |
170 resources.get()); | 170 resources.get()); |
171 | 171 |
172 for (size_t i = 0; i < buffers.size(); ++i) | 172 for (size_t i = 0; i < buffers.size(); ++i) |
173 tracker->ReleaseResource(resources[i]); | 173 tracker->ReleaseResource(resources[i]); |
174 } | 174 } |
175 | 175 |
176 void VideoCaptureResource::OnPluginMsgOnStatus( | 176 void VideoCaptureResource::OnPluginMsgOnStatus( |
177 const ResourceMessageReplyParams& params, | 177 const ResourceMessageReplyParams& params, |
178 uint32_t status) { | 178 uint32_t status) { |
179 switch (status) { | 179 switch (status) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 open_callback_->Run(params.result()); | 225 open_callback_->Run(params.result()); |
226 } | 226 } |
227 | 227 |
228 void VideoCaptureResource::SetBufferInUse(uint32_t buffer_index) { | 228 void VideoCaptureResource::SetBufferInUse(uint32_t buffer_index) { |
229 CHECK(buffer_index < buffer_in_use_.size()); | 229 CHECK(buffer_index < buffer_in_use_.size()); |
230 buffer_in_use_[buffer_index] = true; | 230 buffer_in_use_[buffer_index] = true; |
231 } | 231 } |
232 | 232 |
233 } // namespace proxy | 233 } // namespace proxy |
234 } // namespace ppapi | 234 } // namespace ppapi |
OLD | NEW |