| 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_mf_win.h" | 5 #include "media/video/capture/win/video_capture_device_mf_win.h" |
| 6 | 6 |
| 7 #include <mfapi.h> | 7 #include <mfapi.h> |
| 8 #include <mferror.h> | 8 #include <mferror.h> |
| 9 | 9 |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 MFCreateAttributes(attributes.Receive(), 1); | 300 MFCreateAttributes(attributes.Receive(), 1); |
| 301 DCHECK(attributes); | 301 DCHECK(attributes); |
| 302 | 302 |
| 303 callback_ = new MFReaderCallback(this); | 303 callback_ = new MFReaderCallback(this); |
| 304 attributes->SetUnknown(MF_SOURCE_READER_ASYNC_CALLBACK, callback_.get()); | 304 attributes->SetUnknown(MF_SOURCE_READER_ASYNC_CALLBACK, callback_.get()); |
| 305 | 305 |
| 306 return SUCCEEDED(MFCreateSourceReaderFromMediaSource(source, attributes, | 306 return SUCCEEDED(MFCreateSourceReaderFromMediaSource(source, attributes, |
| 307 reader_.Receive())); | 307 reader_.Receive())); |
| 308 } | 308 } |
| 309 | 309 |
| 310 VideoEncodingCapability VideoCaptureDeviceMFWin::GetEncodingCapability() { |
| 311 return VideoEncodingCapability(); |
| 312 } |
| 313 |
| 314 void VideoCaptureDeviceMFWin::TryConfigureEncodedBitstream( |
| 315 const RuntimeVideoEncodingParameters& params) { |
| 316 } |
| 317 |
| 310 void VideoCaptureDeviceMFWin::Allocate( | 318 void VideoCaptureDeviceMFWin::Allocate( |
| 311 int width, | 319 int width, |
| 312 int height, | 320 int height, |
| 313 int frame_rate, | 321 int frame_rate, |
| 314 VideoCaptureDevice::EventHandler* observer) { | 322 VideoCaptureDevice::EventHandler* observer) { |
| 315 DCHECK(CalledOnValidThread()); | 323 DCHECK(CalledOnValidThread()); |
| 316 | 324 |
| 317 base::AutoLock lock(lock_); | 325 base::AutoLock lock(lock_); |
| 318 | 326 |
| 319 if (observer_) { | 327 if (observer_) { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 430 } | 438 } |
| 431 } | 439 } |
| 432 | 440 |
| 433 void VideoCaptureDeviceMFWin::OnError(HRESULT hr) { | 441 void VideoCaptureDeviceMFWin::OnError(HRESULT hr) { |
| 434 DLOG(ERROR) << "VideoCaptureDeviceMFWin: " << std::hex << hr; | 442 DLOG(ERROR) << "VideoCaptureDeviceMFWin: " << std::hex << hr; |
| 435 if (observer_) | 443 if (observer_) |
| 436 observer_->OnError(); | 444 observer_->OnError(); |
| 437 } | 445 } |
| 438 | 446 |
| 439 } // namespace media | 447 } // namespace media |
| OLD | NEW |