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 "content/renderer/pepper/pepper_video_capture_host.h" | 5 #include "content/renderer/pepper/pepper_video_capture_host.h" |
6 | 6 |
7 #include "content/renderer/pepper/host_globals.h" | 7 #include "content/renderer/pepper/host_globals.h" |
8 #include "content/renderer/pepper/pepper_media_device_manager.h" | 8 #include "content/renderer/pepper/pepper_media_device_manager.h" |
9 #include "content/renderer/pepper/pepper_platform_video_capture.h" | 9 #include "content/renderer/pepper/pepper_platform_video_capture.h" |
10 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | 10 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 host()->SendUnsolicitedReply(pp_resource(), | 358 host()->SendUnsolicitedReply(pp_resource(), |
359 PpapiPluginMsg_VideoCapture_OnStatus(status_)); | 359 PpapiPluginMsg_VideoCapture_OnStatus(status_)); |
360 } | 360 } |
361 | 361 |
362 void PepperVideoCaptureHost::SetRequestedInfo( | 362 void PepperVideoCaptureHost::SetRequestedInfo( |
363 const PP_VideoCaptureDeviceInfo_Dev& device_info, | 363 const PP_VideoCaptureDeviceInfo_Dev& device_info, |
364 uint32_t buffer_count) { | 364 uint32_t buffer_count) { |
365 // Clamp the buffer count to between 1 and |kMaxBuffers|. | 365 // Clamp the buffer count to between 1 and |kMaxBuffers|. |
366 buffer_count_hint_ = std::min(std::max(buffer_count, 1U), kMaxBuffers); | 366 buffer_count_hint_ = std::min(std::max(buffer_count, 1U), kMaxBuffers); |
367 | 367 |
368 video_capture_params_.requested_format = | 368 video_capture_params_.requested_format = media::VideoCaptureFormat( |
369 media::VideoCaptureFormat(device_info.width, | 369 gfx::Size(device_info.width, device_info.height), |
370 device_info.height, | 370 device_info.frames_per_second, |
371 device_info.frames_per_second, | 371 media::PIXEL_FORMAT_I420); |
372 media::ConstantResolutionVideoCaptureDevice); | 372 video_capture_params_.allow_resolution_change = false; |
373 } | 373 } |
374 | 374 |
375 void PepperVideoCaptureHost::DetachPlatformVideoCapture() { | 375 void PepperVideoCaptureHost::DetachPlatformVideoCapture() { |
376 if (platform_video_capture_.get()) { | 376 if (platform_video_capture_.get()) { |
377 platform_video_capture_->DetachEventHandler(); | 377 platform_video_capture_->DetachEventHandler(); |
378 platform_video_capture_ = NULL; | 378 platform_video_capture_ = NULL; |
379 } | 379 } |
380 } | 380 } |
381 | 381 |
382 bool PepperVideoCaptureHost::SetStatus(PP_VideoCaptureStatus_Dev status, | 382 bool PepperVideoCaptureHost::SetStatus(PP_VideoCaptureStatus_Dev status, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 PepperVideoCaptureHost::BufferInfo::BufferInfo() | 429 PepperVideoCaptureHost::BufferInfo::BufferInfo() |
430 : in_use(false), | 430 : in_use(false), |
431 data(NULL), | 431 data(NULL), |
432 buffer() { | 432 buffer() { |
433 } | 433 } |
434 | 434 |
435 PepperVideoCaptureHost::BufferInfo::~BufferInfo() { | 435 PepperVideoCaptureHost::BufferInfo::~BufferInfo() { |
436 } | 436 } |
437 | 437 |
438 } // namespace content | 438 } // namespace content |
OLD | NEW |