| 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/win/video_capture_device_win.h" | 5 #include "media/video/capture/win/video_capture_device_win.h" |
| 6 | 6 |
| 7 #include <ks.h> | 7 #include <ks.h> |
| 8 #include <ksmedia.h> | 8 #include <ksmedia.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // Delete a media type structure that was allocated on the heap. | 187 // Delete a media type structure that was allocated on the heap. |
| 188 // http://msdn.microsoft.com/en-us/library/dd375432(VS.85).aspx | 188 // http://msdn.microsoft.com/en-us/library/dd375432(VS.85).aspx |
| 189 void VideoCaptureDeviceWin::ScopedMediaType::DeleteMediaType( | 189 void VideoCaptureDeviceWin::ScopedMediaType::DeleteMediaType( |
| 190 AM_MEDIA_TYPE* mt) { | 190 AM_MEDIA_TYPE* mt) { |
| 191 if (mt != NULL) { | 191 if (mt != NULL) { |
| 192 FreeMediaType(mt); | 192 FreeMediaType(mt); |
| 193 CoTaskMemFree(mt); | 193 CoTaskMemFree(mt); |
| 194 } | 194 } |
| 195 } | 195 } |
| 196 | 196 |
| 197 // TODO(mcasas): Remove the following static methods when they are no longer | |
| 198 // referenced from VideoCaptureDeviceFactory, i.e. when all OS platforms have | |
| 199 // splitted the VideoCaptureDevice into VideoCaptureDevice and | |
| 200 // VideoCaptureDeviceFactory. | |
| 201 // static | |
| 202 void VideoCaptureDevice::GetDeviceNames(Names* device_names) { | |
| 203 NOTIMPLEMENTED(); | |
| 204 } | |
| 205 | |
| 206 // static | |
| 207 void VideoCaptureDevice::GetDeviceSupportedFormats(const Name& device, | |
| 208 VideoCaptureFormats* formats) { | |
| 209 NOTIMPLEMENTED(); | |
| 210 } | |
| 211 | |
| 212 // static | |
| 213 VideoCaptureDevice* VideoCaptureDevice::Create( | |
| 214 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner, | |
| 215 const Name& device_name) { | |
| 216 NOTIMPLEMENTED(); | |
| 217 return NULL; | |
| 218 } | |
| 219 | |
| 220 VideoCaptureDeviceWin::VideoCaptureDeviceWin(const Name& device_name) | 197 VideoCaptureDeviceWin::VideoCaptureDeviceWin(const Name& device_name) |
| 221 : device_name_(device_name), | 198 : device_name_(device_name), |
| 222 state_(kIdle) { | 199 state_(kIdle) { |
| 223 DetachFromThread(); | 200 DetachFromThread(); |
| 224 } | 201 } |
| 225 | 202 |
| 226 VideoCaptureDeviceWin::~VideoCaptureDeviceWin() { | 203 VideoCaptureDeviceWin::~VideoCaptureDeviceWin() { |
| 227 DCHECK(CalledOnValidThread()); | 204 DCHECK(CalledOnValidThread()); |
| 228 if (media_control_) | 205 if (media_control_) |
| 229 media_control_->Stop(); | 206 media_control_->Stop(); |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 } | 539 } |
| 563 } | 540 } |
| 564 | 541 |
| 565 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { | 542 void VideoCaptureDeviceWin::SetErrorState(const std::string& reason) { |
| 566 DCHECK(CalledOnValidThread()); | 543 DCHECK(CalledOnValidThread()); |
| 567 DVLOG(1) << reason; | 544 DVLOG(1) << reason; |
| 568 state_ = kError; | 545 state_ = kError; |
| 569 client_->OnError(reason); | 546 client_->OnError(reason); |
| 570 } | 547 } |
| 571 } // namespace media | 548 } // namespace media |
| OLD | NEW |