Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(41)

Side by Side Diff: media/video/capture/mac/video_capture_device_mac.mm

Issue 518073002: Mac VideoCapture: Support for Blackmagic DeckLink device & capabilities enumeration, using SDK. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: perkj@ and magjed@ comments Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 #include <IOKit/IOCFPlugIn.h> 7 #include <IOKit/IOCFPlugIn.h>
8 #include <IOKit/usb/IOUSBLib.h> 8 #include <IOKit/usb/IOUSBLib.h>
9 #include <IOKit/usb/USBSpec.h> 9 #include <IOKit/usb/USBSpec.h>
10 10
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 plugin_interface_ref(video_control_interface); 324 plugin_interface_ref(video_control_interface);
325 325
326 SetAntiFlickerInVideoControlInterface(video_control_interface, frequency); 326 SetAntiFlickerInVideoControlInterface(video_control_interface, frequency);
327 } 327 }
328 } 328 }
329 329
330 const std::string VideoCaptureDevice::Name::GetModel() const { 330 const std::string VideoCaptureDevice::Name::GetModel() const {
331 // Skip the AVFoundation's not USB nor built-in devices. 331 // Skip the AVFoundation's not USB nor built-in devices.
332 if (capture_api_type() == AVFOUNDATION && transport_type() != USB_OR_BUILT_IN) 332 if (capture_api_type() == AVFOUNDATION && transport_type() != USB_OR_BUILT_IN)
333 return ""; 333 return "";
334 if (capture_api_type() == DECKLINK)
335 return "";
334 // Both PID and VID are 4 characters. 336 // Both PID and VID are 4 characters.
335 if (unique_id_.size() < 2 * kVidPidSize) 337 if (unique_id_.size() < 2 * kVidPidSize)
336 return ""; 338 return "";
337 339
338 // The last characters of device id is a concatenation of VID and then PID. 340 // The last characters of device id is a concatenation of VID and then PID.
339 const size_t vid_location = unique_id_.size() - 2 * kVidPidSize; 341 const size_t vid_location = unique_id_.size() - 2 * kVidPidSize;
340 std::string id_vendor = unique_id_.substr(vid_location, kVidPidSize); 342 std::string id_vendor = unique_id_.substr(vid_location, kVidPidSize);
341 const size_t pid_location = unique_id_.size() - kVidPidSize; 343 const size_t pid_location = unique_id_.size() - kVidPidSize;
342 std::string id_product = unique_id_.substr(pid_location, kVidPidSize); 344 std::string id_product = unique_id_.substr(pid_location, kVidPidSize);
343 345
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height() 576 if (![capture_device_ setCaptureHeight:capture_format_.frame_size.height()
575 width:capture_format_.frame_size.width() 577 width:capture_format_.frame_size.width()
576 frameRate:capture_format_.frame_rate]) { 578 frameRate:capture_format_.frame_rate]) {
577 ReceiveError("Could not configure capture device."); 579 ReceiveError("Could not configure capture device.");
578 return false; 580 return false;
579 } 581 }
580 return true; 582 return true;
581 } 583 }
582 584
583 } // namespace media 585 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698