SLGPUImageVideoCamera Class Reference
| Inherits from | SLGPUImageOutput : NSObject | 
|---|---|
| Conforms to | AVCaptureAudioDataOutputSampleBufferDelegate AVCaptureVideoDataOutputSampleBufferDelegate | 
| Declared in | SLGPUImageVideoCamera.h | 
Other Methods
  isRunning
	Whether or not the underlying AVCaptureSession is running
@property (readonly, nonatomic) BOOL isRunningDeclared In
SLGPUImageVideoCamera.h
  captureSession
	The AVCaptureSession used to capture from the camera
@property (readonly, retain, nonatomic) AVCaptureSession *captureSessionDeclared In
SLGPUImageVideoCamera.h
  captureSessionPreset
	This enables the capture session preset to be changed on the fly
@property (readwrite, nonatomic, copy) NSString *captureSessionPresetDeclared In
SLGPUImageVideoCamera.h
  frameRate
	Setting this to 0 or below will set the frame rate back to the default setting for a particular preset.
@property (readwrite) int32_t frameRateDeclared In
SLGPUImageVideoCamera.h
  frontFacingCameraPresent
	Easy way to tell which cameras are present on device
@property (readonly, getter=isFrontFacingCameraPresent) BOOL frontFacingCameraPresentDeclared In
SLGPUImageVideoCamera.h
  runBenchmark
	This enables the benchmarking mode, which logs out instantaneous and average frame times to the console
@property (readwrite, nonatomic) BOOL runBenchmarkDeclared In
SLGPUImageVideoCamera.h
  inputCamera
	Use this property to manage camera settings. Focus point, exposure point, etc.
@property (readonly) AVCaptureDevice *inputCameraDeclared In
SLGPUImageVideoCamera.h
  outputImageOrientation
	This determines the rotation applied to the output image, based on the source material
@property (readwrite, nonatomic) UIInterfaceOrientation outputImageOrientationDeclared In
SLGPUImageVideoCamera.h
  horizontallyMirrorRearFacingCamera
	These properties determine whether or not the two camera orientations should be mirrored. By default, both are NO.
@property (readwrite, nonatomic) BOOL horizontallyMirrorFrontFacingCamera , horizontallyMirrorRearFacingCameraDeclared In
SLGPUImageVideoCamera.h
Initialization and teardown
– initWithSessionPreset:cameraPosition:
	Begin a capture session
- (id)initWithSessionPreset:(NSString *)sessionPreset cameraPosition:(AVCaptureDevicePosition)cameraPositionParameters
| sessionPreset | Session preset to use | 
|---|---|
| cameraPosition | Camera to capture from | 
Discussion
See AVCaptureSession for acceptable values
Declared In
SLGPUImageVideoCamera.h
– addAudioInputsAndOutputs
	Add audio capture to the session. Adding inputs and outputs freezes the capture session momentarily, so you can use this method to add the audio inputs and outputs early, if you’re going to set the audioEncodingTarget later. Returns YES is the audio inputs and outputs were added, or NO if they had already been added.
- (BOOL)addAudioInputsAndOutputsDeclared In
SLGPUImageVideoCamera.h
– removeAudioInputsAndOutputs
	Remove the audio capture inputs and outputs from this session. Returns YES if the audio inputs and outputs were removed, or NO is they hadn’t already been added.
- (BOOL)removeAudioInputsAndOutputsDeclared In
SLGPUImageVideoCamera.h
– removeInputsAndOutputs
	Tear down the capture session
- (void)removeInputsAndOutputsDeclared In
SLGPUImageVideoCamera.h
Manage the camera video stream
– startCameraCapture
	Start camera capturing
- (void)startCameraCaptureDeclared In
SLGPUImageVideoCamera.h
– stopCameraCapture
	Stop camera capturing
- (void)stopCameraCaptureDeclared In
SLGPUImageVideoCamera.h
– pauseCameraCapture
	Pause camera capturing
- (void)pauseCameraCaptureDeclared In
SLGPUImageVideoCamera.h
– resumeCameraCapture
	Resume camera capturing
- (void)resumeCameraCaptureDeclared In
SLGPUImageVideoCamera.h
– processVideoSampleBuffer:
	Process a video sample
- (void)processVideoSampleBuffer:(CMSampleBufferRef)sampleBufferParameters
| sampleBuffer | Buffer to process | 
|---|
Declared In
SLGPUImageVideoCamera.h
– processAudioSampleBuffer:
	Process an audio sample
- (void)processAudioSampleBuffer:(CMSampleBufferRef)sampleBufferParameters
| sampleBuffer | Buffer to process | 
|---|
Declared In
SLGPUImageVideoCamera.h
– cameraPosition
	Get the position (front, rear) of the source camera
- (AVCaptureDevicePosition)cameraPositionDeclared In
SLGPUImageVideoCamera.h
– videoCaptureConnection
	Get the AVCaptureConnection of the source camera
- (AVCaptureConnection *)videoCaptureConnectionDeclared In
SLGPUImageVideoCamera.h
– rotateCamera
	This flips between the front and rear cameras
- (void)rotateCameraDeclared In
SLGPUImageVideoCamera.h
Benchmarking
– averageFrameDurationDuringCapture
	When benchmarking is enabled, this will keep a running average of the time from uploading, processing, and final recording or display
- (CGFloat)averageFrameDurationDuringCaptureDeclared In
SLGPUImageVideoCamera.h