| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/capture/video/mac/video_capture_device_decklink_mac.h" | 5 #include "media/capture/video/mac/video_capture_device_decklink_mac.h" |
| 6 | 6 |
| 7 #include <utility> |
| 8 |
| 7 #include "base/logging.h" | 9 #include "base/logging.h" |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 12 #include "base/strings/sys_string_conversions.h" |
| 11 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
| 12 #include "third_party/decklink/mac/include/DeckLinkAPI.h" | 14 #include "third_party/decklink/mac/include/DeckLinkAPI.h" |
| 13 | 15 |
| 14 namespace { | 16 namespace { |
| 15 | 17 |
| 16 // DeckLink SDK uses ScopedComPtr-style APIs. Chrome ScopedComPtr is only | 18 // DeckLink SDK uses ScopedComPtr-style APIs. Chrome ScopedComPtr is only |
| (...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 470 DCHECK(thread_checker_.CalledOnValidThread()); | 472 DCHECK(thread_checker_.CalledOnValidThread()); |
| 471 base::AutoLock lock(lock_); | 473 base::AutoLock lock(lock_); |
| 472 if (client_) | 474 if (client_) |
| 473 client_->OnLog(message); | 475 client_->OnLog(message); |
| 474 } | 476 } |
| 475 | 477 |
| 476 void VideoCaptureDeviceDeckLinkMac::AllocateAndStart( | 478 void VideoCaptureDeviceDeckLinkMac::AllocateAndStart( |
| 477 const VideoCaptureParams& params, | 479 const VideoCaptureParams& params, |
| 478 scoped_ptr<VideoCaptureDevice::Client> client) { | 480 scoped_ptr<VideoCaptureDevice::Client> client) { |
| 479 DCHECK(thread_checker_.CalledOnValidThread()); | 481 DCHECK(thread_checker_.CalledOnValidThread()); |
| 480 client_ = client.Pass(); | 482 client_ = std::move(client); |
| 481 if (decklink_capture_delegate_.get()) | 483 if (decklink_capture_delegate_.get()) |
| 482 decklink_capture_delegate_->AllocateAndStart(params); | 484 decklink_capture_delegate_->AllocateAndStart(params); |
| 483 } | 485 } |
| 484 | 486 |
| 485 void VideoCaptureDeviceDeckLinkMac::StopAndDeAllocate() { | 487 void VideoCaptureDeviceDeckLinkMac::StopAndDeAllocate() { |
| 486 if (decklink_capture_delegate_.get()) | 488 if (decklink_capture_delegate_.get()) |
| 487 decklink_capture_delegate_->StopAndDeAllocate(); | 489 decklink_capture_delegate_->StopAndDeAllocate(); |
| 488 } | 490 } |
| 489 | 491 |
| 490 } // namespace media | 492 } // namespace media |
| OLD | NEW |