| 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 "media/video/capture/mac/video_capture_device_mac.h" | 5 #include "media/video/capture/mac/video_capture_device_mac.h" |
| 6 | 6 |
| 7 #import <QTKit/QTKit.h> | 7 #import <QTKit/QTKit.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 : device_name_(device_name), | 78 : device_name_(device_name), |
| 79 observer_(NULL), | 79 observer_(NULL), |
| 80 state_(kNotInitialized), | 80 state_(kNotInitialized), |
| 81 capture_device_(nil) { | 81 capture_device_(nil) { |
| 82 } | 82 } |
| 83 | 83 |
| 84 VideoCaptureDeviceMac::~VideoCaptureDeviceMac() { | 84 VideoCaptureDeviceMac::~VideoCaptureDeviceMac() { |
| 85 [capture_device_ release]; | 85 [capture_device_ release]; |
| 86 } | 86 } |
| 87 | 87 |
| 88 VideoEncodingCapabilities VideoCaptureDeviceMac::GetEncodingCapabilities() { |
| 89 return VideoEncodingCapabilities(); |
| 90 } |
| 91 |
| 92 void VideoCaptureDeviceMac::TryConfigureEncodedBitstream( |
| 93 const RuntimeVideoEncodingParameters& params) { |
| 94 } |
| 95 |
| 88 void VideoCaptureDeviceMac::Allocate(int width, int height, int frame_rate, | 96 void VideoCaptureDeviceMac::Allocate(int width, int height, int frame_rate, |
| 89 EventHandler* observer) { | 97 EventHandler* observer) { |
| 90 if (state_ != kIdle) { | 98 if (state_ != kIdle) { |
| 91 return; | 99 return; |
| 92 } | 100 } |
| 93 | 101 |
| 94 // QTKit can scale captured frame to any size requested, which would lead to | 102 // QTKit can scale captured frame to any size requested, which would lead to |
| 95 // undesired aspect ratio change. Tries to open the camera with a natively | 103 // undesired aspect ratio change. Tries to open the camera with a natively |
| 96 // supported format and let the client to crop/pad the captured frames. | 104 // supported format and let the client to crop/pad the captured frames. |
| 97 GetBestMatchSupportedResolution(&width, &height); | 105 GetBestMatchSupportedResolution(&width, &height); |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 video_frame, video_frame_length, base::Time::Now(), 0, false, false); | 199 video_frame, video_frame_length, base::Time::Now(), 0, false, false); |
| 192 } | 200 } |
| 193 | 201 |
| 194 void VideoCaptureDeviceMac::SetErrorState(const std::string& reason) { | 202 void VideoCaptureDeviceMac::SetErrorState(const std::string& reason) { |
| 195 DLOG(ERROR) << reason; | 203 DLOG(ERROR) << reason; |
| 196 state_ = kError; | 204 state_ = kError; |
| 197 observer_->OnError(); | 205 observer_->OnError(); |
| 198 } | 206 } |
| 199 | 207 |
| 200 } // namespace media | 208 } // namespace media |
| OLD | NEW |