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 "webkit/plugins/ppapi/ppb_video_capture_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_video_capture_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 ppp_videocapture_->OnBufferReady(pp_instance(), pp_resource(), i); | 111 ppp_videocapture_->OnBufferReady(pp_instance(), pp_resource(), i); |
112 return; | 112 return; |
113 } | 113 } |
114 } | 114 } |
115 } | 115 } |
116 | 116 |
117 void PPB_VideoCapture_Impl::OnDeviceInfoReceived( | 117 void PPB_VideoCapture_Impl::OnDeviceInfoReceived( |
118 media::VideoCapture* capture, | 118 media::VideoCapture* capture, |
119 const media::VideoCaptureParams& device_info) { | 119 const media::VideoCaptureParams& device_info) { |
120 PP_VideoCaptureDeviceInfo_Dev info = { | 120 PP_VideoCaptureDeviceInfo_Dev info = { |
121 device_info.width, | 121 static_cast<uint32_t>(device_info.width), |
122 device_info.height, | 122 static_cast<uint32_t>(device_info.height), |
123 device_info.frame_per_second | 123 static_cast<uint32_t>(device_info.frame_per_second) |
124 }; | 124 }; |
125 ReleaseBuffers(); | 125 ReleaseBuffers(); |
126 | 126 |
127 // Allocate buffers. We keep a reference to them, that is released in | 127 // Allocate buffers. We keep a reference to them, that is released in |
128 // ReleaseBuffers. | 128 // ReleaseBuffers. |
129 // YUV 4:2:0 | 129 // YUV 4:2:0 |
130 int uv_width = info.width / 2; | 130 int uv_width = info.width / 2; |
131 int uv_height = info.height / 2; | 131 int uv_height = info.height / 2; |
132 size_t size = info.width * info.height + 2 * uv_width * uv_height; | 132 size_t size = info.width * info.height + 2 * uv_width * uv_height; |
133 scoped_array<PP_Resource> resources(new PP_Resource[buffer_count_hint_]); | 133 scoped_array<PP_Resource> resources(new PP_Resource[buffer_count_hint_]); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 : in_use(false), | 318 : in_use(false), |
319 data(NULL), | 319 data(NULL), |
320 buffer() { | 320 buffer() { |
321 } | 321 } |
322 | 322 |
323 PPB_VideoCapture_Impl::BufferInfo::~BufferInfo() { | 323 PPB_VideoCapture_Impl::BufferInfo::~BufferInfo() { |
324 } | 324 } |
325 | 325 |
326 } // namespace ppapi | 326 } // namespace ppapi |
327 } // namespace webkit | 327 } // namespace webkit |
OLD | NEW |