| Inherits from | |
| Conforms to | |
| Framework | /System/Library/Frameworks/QTKit.framework |
| Availability | Available in QuickTime 7.2.1 and later. |
| Declared in | QTCaptureView.h |
| Related sample code |
This is a subclass of NSView that displays a video preview of a capture session. A QTCaptureView previews the video being processed by an instance of QTCaptureSession. This class creates and maintains its own QTCaptureVideoPreviewOutput as necessary to gather preview video from the capture session.
– availableVideoPreviewConnections
– captureSession
– setCaptureSession:
– setVideoPreviewConnection:
– videoPreviewConnection
– view:willDisplayImage: delegate method
Returns an array of output video connections that can be previewed.
- (NSArray *)availableVideoPreviewConnections
An array of QTCaptureConnection instances for connections available to be previewed.
This method returns an array of connections that can be previewed with the receiver. The returned connections can be used with the setVideoPreviewConnection: method to set the connection being previewed by the receiver.
If there are multiple video connections that can be previewed, this method can determine which the view will display.
QTCaptureView.hReturns the capture session being previewed by the receiver.
- (QTCaptureSession *)captureSession
A QTCaptureSession instance used for the preview.
QTCaptureView.hReturns the receiver’s delegate.
- (id)delegate
QTCaptureView.hReturns the fill color drawn in the area of the view not covered by the video preview.
- (NSColor *)fillColor
An NSColor of the receiver’s fill color.
QTCaptureView.hReturns whether the receiver preserves the aspect ratio of the video preview when drawing it.
- (BOOL)preservesAspectRatio
Returns YES if the video preview aspect ratio is preserved; otherwise, NO.
QTCaptureView.hReturns the rectangle occupied by the video preview in the view.
- (NSRect)previewBounds
The rectangle occupied by the video preview in the view.
The default implementation of this method returns a video rectangle based on the value returned by preservesAspectRatio. Subclasses can override this method to change the rectangle occupied by the video preview.
QTCaptureView.hSets the capture session to be previewed by the receiver.
- (void)setCaptureSession:(QTCaptureSession *)captureSession
A QTCaptureSession instance to be used for the preview.
QTCaptureView.hSets the receiver’s delegate.
- (void)setDelegate:(id)delegate
QTCaptureView.hSets the fill color drawn in the area of the view not covered by the video preview.
- (void)setFillColor:(NSColor *)fillColor
An NSColor to be used for the receiver’s fill color.
QTCaptureView.hSets whether the receiver preserves the aspect ratio of the video preview when drawing it.
- (void)setPreservesAspectRatio:(BOOL)preservesAspectRatio
If YES, preserves the aspect ratio; otherwise, NO.
QTCaptureView.hSets the output connection to be previewed by the receiver.
- (void)setVideoPreviewConnection:(QTCaptureConnection *)connection
A QTCaptureConnection instance for the connection to be previewed.
A QTCaptureView can only preview one video connection at a time. This method sets the output connection to be previewed by the receiver. The given connection must be one of the connections returned by availableVideoPreviewConnections or this method throws an NSInvalidArgumentException.
If there are multiple video connections that can be previewed, this method can determine which the view will display.
QTCaptureView.hReturns the output connection being previewed by the receiver.
- (QTCaptureConnection *)videoPreviewConnection
A QTCaptureConnection instance for the previewed connection.
A QTCaptureView can preview only one video connection at a time. This method returns the output connection currently being previewed by the receiver.
If there are multiple video connections that can be previewed, this method can determine which the view will display.
QTCaptureView.hDelegates of QTCaptureView can implement this method to modify the image that is to be drawn into a QTCaptureView.
- (CIImage *)view:(QTCaptureView *)view willDisplayImage:(CIImage *)image
A QTCaptureView object that identifies the view which is about to draw.
A CIImage object that represents the frame that will otherwise be drawn to the QTCaptureView.
Delegates should return a CIImage object to be drawn by the capture view, or NIL if the capture view should draw the original image.
The image parameter is a CIImage representing the captured frame that is about to be drawn into a QTCaptureView. The delegate can return another image that modifies the source image (by applying a CIFilter, for example). The returned image will then be drawn into the capture view instead of the source image. The delegate can also return NIL or the original image to leave the drawn image unmodified.
QTCaptureView.h
© 2009 Apple Inc. All Rights Reserved. (Last updated: 2009-04-08)