2014 snapchat source code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
679 B

  1. //
  2. // AVCaptureConnection+InputDevice.m
  3. // Snapchat
  4. //
  5. // Created by William Morriss on 1/20/15
  6. // Copyright (c) 2015 Snapchat, Inc. All rights reserved.
  7. //
  8. #import "AVCaptureConnection+InputDevice.h"
  9. #import <SCFoundation/SCAssertWrapper.h>
  10. @implementation AVCaptureConnection (InputDevice)
  11. - (AVCaptureDevice *)inputDevice
  12. {
  13. NSArray *inputPorts = self.inputPorts;
  14. AVCaptureInputPort *port = [inputPorts firstObject];
  15. SCAssert([port.input isKindOfClass:[AVCaptureDeviceInput class]], @"unexpected port");
  16. AVCaptureDeviceInput *deviceInput = (AVCaptureDeviceInput *)port.input;
  17. AVCaptureDevice *device = deviceInput.device;
  18. return device;
  19. }
  20. @end