WZVideoSink

Extends Protocol:
Declared In:

Introduction

WZVideoSink defines a protocol for callbacks that occur when video frames are captured



Methods

-videoCaptureInterruptionEnded
-videoCaptureInterruptionStarted
-videoCaptureUsingQueue:
-videoFrameWasCaptured:framePresentationTime:frameDuration:

videoCaptureInterruptionEnded


@optional

- (void) videoCaptureInterruptionEnded;
Discussion

Called when an interruption in the active video capture session ends. On iOS, this typically happens when the application exits and then re-enters the foreground. When video capture is interrupted, broadcasting is suspended; the SDK will attempt to re-start the broadcast when interruption ends, unless the client application has stopped the broadcast. Client applications should implement the 'applicationWillResignActive' and/or 'applicationDidEnterBackground' UIApplicationDelegate methods and stop the broadcast accordingly. iOS does not allow the camera to continue capturing frames when the application is in the background.


videoCaptureInterruptionStarted


@optional

- (void) videoCaptureInterruptionStarted;
Discussion

Called when an interruption in the active video capture session begins. On iOS, this typically happens when the application exits the foreground. When video capture is interrupted, broadcasting is suspended; the SDK will attempt to re-start the broadcast when interruption ends, unless the client application has stopped the broadcast. Client applications should implement the 'applicationWillResignActive' and/or 'applicationDidEnterBackground' UIApplicationDelegate methods and stop the broadcast accordingly. iOS does not allow the camera to continue capturing frames when the application is in the background.


videoCaptureUsingQueue:


@optional

- (void) videoCaptureUsingQueue:(nullable dispatch_queue_t)queue;
Discussion

Called when the video capture queue is set internally by the capture device. Clients that wish to synchronize operations on this queue may make use of this queue if non-null.


videoFrameWasCaptured:framePresentationTime:frameDuration:


@required

- (void) videoFrameWasCaptured:(nonnull CVImageBufferRef)imageBuffer framePresentationTime:(CMTime)framePresentationTime frameDuration:(CMTime)frameDuration;
Parameters
imageBuffer

The image data. Pixel format should be kCVPixelFormatType_32BGRA

framePresentationTime

The relative presentation time for this frame. Implementers of this protocol should handle the case where framePresentationTime is kCMTimeInvalid. In such cases, the protocol implementer shoud infer the presentation time based on the time that the frame is delivered. The WZH264Encoder works this way.

frameDuration

The duration time for this frame. Use kCMTimeInvalid for default duration.

Discussion

Called for each frame of unencoded video produced by a video producer.