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 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 buffer_count_hint_ = std::min(std::max(buffer_count, 1U), kMaxBuffers); | 350 buffer_count_hint_ = std::min(std::max(buffer_count, 1U), kMaxBuffers); |
351 // Clamp the frame rate to between 1 and |kMaxFramesPerSecond - 1|. | 351 // Clamp the frame rate to between 1 and |kMaxFramesPerSecond - 1|. |
352 int frames_per_second = | 352 int frames_per_second = |
353 std::min(std::max(device_info.frames_per_second, 1U), | 353 std::min(std::max(device_info.frames_per_second, 1U), |
354 static_cast<uint32_t>(media::limits::kMaxFramesPerSecond - 1)); | 354 static_cast<uint32_t>(media::limits::kMaxFramesPerSecond - 1)); |
355 | 355 |
356 video_capture_params_.requested_format = media::VideoCaptureFormat( | 356 video_capture_params_.requested_format = media::VideoCaptureFormat( |
357 gfx::Size(device_info.width, device_info.height), | 357 gfx::Size(device_info.width, device_info.height), |
358 frames_per_second, | 358 frames_per_second, |
359 media::PIXEL_FORMAT_I420); | 359 media::PIXEL_FORMAT_I420); |
360 video_capture_params_.allow_resolution_change = false; | |
361 } | 360 } |
362 | 361 |
363 void PepperVideoCaptureHost::DetachPlatformVideoCapture() { | 362 void PepperVideoCaptureHost::DetachPlatformVideoCapture() { |
364 if (platform_video_capture_) { | 363 if (platform_video_capture_) { |
365 platform_video_capture_->DetachEventHandler(); | 364 platform_video_capture_->DetachEventHandler(); |
366 platform_video_capture_.reset(); | 365 platform_video_capture_.reset(); |
367 } | 366 } |
368 } | 367 } |
369 | 368 |
370 bool PepperVideoCaptureHost::SetStatus(PP_VideoCaptureStatus_Dev status, | 369 bool PepperVideoCaptureHost::SetStatus(PP_VideoCaptureStatus_Dev status, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 } | 414 } |
416 | 415 |
417 PepperVideoCaptureHost::BufferInfo::BufferInfo() | 416 PepperVideoCaptureHost::BufferInfo::BufferInfo() |
418 : in_use(false), data(NULL), buffer() { | 417 : in_use(false), data(NULL), buffer() { |
419 } | 418 } |
420 | 419 |
421 PepperVideoCaptureHost::BufferInfo::~BufferInfo() { | 420 PepperVideoCaptureHost::BufferInfo::~BufferInfo() { |
422 } | 421 } |
423 | 422 |
424 } // namespace content | 423 } // namespace content |
OLD | NEW |