UZLiveSession

@interface UZLiveSession : NSObject

#pragma mark - Attribute
///=============================================================================
/// @name Attribute
///=============================================================================
/** The delegate of the capture. captureData callback */
@property (nullable, nonatomic, weak) id<UZLiveSessionDelegate> delegate;

/** The running control start capture or stop capture*/
@property (nonatomic, assign) BOOL running;

/** The preView will show OpenGL ES view*/
@property (nonatomic, strong, null_resettable) UIView *preView;

/** The captureDevicePosition control camraPosition ,default front*/
@property (nonatomic, assign) AVCaptureDevicePosition captureDevicePosition;

/** The beautyFace control capture shader filter empty or beautiy */
@property (nonatomic, assign) BOOL beautyFace;

/** The beautyLevel control beautyFace Level. Default is 0.5, between 0.0 ~ 1.0 */
@property (nonatomic, assign) CGFloat beautyLevel;

/** The brightLevel control brightness Level, Default is 0.5, between 0.0 ~ 1.0 */
@property (nonatomic, assign) CGFloat brightLevel;

/** The torch control camera zoom scale default 1.0, between 1.0 ~ 3.0 */
@property (nonatomic, assign) CGFloat zoomScale;

/** The continuousAutoFocus control continuousAutoFocus is on or off */
@property (nonatomic, assign) BOOL continuousAutoFocus;

/** The continuousAutoExposure control continuousAutoExposure is on or off */
@property (nonatomic, assign) BOOL continuousAutoExposure;

/** The torch control capture flash is on or off */
@property (nonatomic, assign) BOOL torch;

/** The mirror control mirror of front camera is on or off */
@property (nonatomic, assign) BOOL mirror;

/** The muted control callbackAudioData,muted will memset 0.*/
@property (nonatomic, assign) BOOL muted;

/*  The adaptiveBitrate control auto adjust bitrate. Default is NO */
@property (nonatomic, assign) BOOL adaptiveBitrate;

/** The stream control upload and package*/
@property (nullable, nonatomic, strong, readonly) UZStreamInfo *streamInfo;

/** The status of the stream .*/
@property (nonatomic, assign, readonly) UZLiveState state;

/** The captureType control inner or outer audio and video .*/
@property (nonatomic, assign, readonly) UZLiveCaptureTypeMask captureType;

/** The showDebugInfo control streamInfo and uploadInfo(1s) *.*/
@property (nonatomic, assign) BOOL showDebugInfo;

/** The reconnectInterval control reconnect timeInterval(Reconnect interval) *.*/
@property (nonatomic, assign) NSUInteger reconnectInterval;

/** The reconnectCount control reconnect count (Reconnect times) *.*/
@property (nonatomic, assign) NSUInteger reconnectCount;

/*** The warterMarkView control whether the watermark is displayed or not ,if set ni,will remove watermark,otherwise add. 
 set alpha represent mix.Position relative to outVideoSize.
 *.*/
@property (nonatomic, strong, nullable) UIView *warterMarkView;

/* The currentImage is videoCapture shot */
@property (nonatomic, strong,readonly ,nullable) UIImage *currentImage;

/* The saveLocalVideo is save the local video */
@property (nonatomic, assign) BOOL saveLocalVideo;

/* The saveLocalVideoPath is save the local video  path */
@property (nonatomic, strong, nullable) NSURL *saveLocalVideoPath;

#pragma mark - Initializer
///=============================================================================
/// @name Initializer
///=============================================================================
- (nullable instancetype)init UNAVAILABLE_ATTRIBUTE;
+ (nullable instancetype)new UNAVAILABLE_ATTRIBUTE;

/**
   The designated initializer. Multiple instances with the same configuration will make the
   capture unstable.
 */
- (nullable instancetype)initWithAudioConfiguration:(nullable UZAudioConfiguration *)audioConfiguration videoConfiguration:(nullable UZVideoConfiguration *)videoConfiguration;

/**
 The designated initializer. Multiple instances with the same configuration will make the
 capture unstable.
 */
- (nullable instancetype)initWithAudioConfiguration:(nullable UZAudioConfiguration *)audioConfiguration videoConfiguration:(nullable UZVideoConfiguration *)videoConfiguration captureType:(UZLiveCaptureTypeMask)captureType NS_DESIGNATED_INITIALIZER;

/** The start stream .*/
- (void)startLive:(nonnull UZStreamInfo *)streamInfo;

/** The stop stream .*/
- (void)stopLive;

/** support outer input yuv or rgb video(set UZLiveCaptureTypeMask) .*/
- (void)pushVideo:(nullable CVPixelBufferRef)pixelBuffer;

/** support outer input pcm audio(set UZLiveCaptureTypeMask) .*/
- (void)pushAudio:(nullable NSData*)audioData;

- (void)pushAudioBuffer:(nullable CMSampleBufferRef)sampleBuffer;
- (void)pushVideoBuffer:(nullable CMSampleBufferRef)sampleBuffer;

@end

Undocumented

Attribute

  • The delegate of the capture. captureData callback

    Declaration

    Objective-C

    @property (nonatomic, weak, nullable) id<UZLiveSessionDelegate> delegate;
  • The running control start capture or stop capture

    Declaration

    Objective-C

    @property (nonatomic) BOOL running;
  • The preView will show OpenGL ES view

    Declaration

    Objective-C

    @property (nonatomic, strong, null_resettable) UIView *preView
  • The captureDevicePosition control camraPosition ,default front

    Declaration

    Objective-C

    @property (nonatomic) AVCaptureDevicePosition captureDevicePosition;
  • The beautyFace control capture shader filter empty or beautiy

    Declaration

    Objective-C

    @property (nonatomic) BOOL beautyFace;
  • The beautyLevel control beautyFace Level. Default is 0.5, between 0.0 ~ 1.0

    Declaration

    Objective-C

    @property (nonatomic) CGFloat beautyLevel;
  • The brightLevel control brightness Level, Default is 0.5, between 0.0 ~ 1.0

    Declaration

    Objective-C

    @property (nonatomic) CGFloat brightLevel;
  • The torch control camera zoom scale default 1.0, between 1.0 ~ 3.0

    Declaration

    Objective-C

    @property (nonatomic) CGFloat zoomScale;
  • The continuousAutoFocus control continuousAutoFocus is on or off

    Declaration

    Objective-C

    @property (nonatomic) BOOL continuousAutoFocus;
  • The continuousAutoExposure control continuousAutoExposure is on or off

    Declaration

    Objective-C

    @property (nonatomic) BOOL continuousAutoExposure;
  • The torch control capture flash is on or off

    Declaration

    Objective-C

    @property (nonatomic) BOOL torch;
  • The mirror control mirror of front camera is on or off

    Declaration

    Objective-C

    @property (nonatomic) BOOL mirror;
  • The muted control callbackAudioData,muted will memset 0.

    Declaration

    Objective-C

    @property (nonatomic) BOOL muted;
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic) BOOL adaptiveBitrate
  • The stream control upload and package

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) UZStreamInfo *streamInfo;
  • The status of the stream .

    Declaration

    Objective-C

    @property (nonatomic, readonly) int state;
  • The captureType control inner or outer audio and video .

    Declaration

    Objective-C

    @property (nonatomic, readonly) UZLiveCaptureTypeMask captureType;
  • The showDebugInfo control streamInfo and uploadInfo(1s) *.

    Declaration

    Objective-C

    @property (nonatomic) BOOL showDebugInfo;
  • The reconnectInterval control reconnect timeInterval(Reconnect interval) *.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger reconnectInterval;
  • The reconnectCount control reconnect count (Reconnect times) *.

    Declaration

    Objective-C

    @property (nonatomic) NSUInteger reconnectCount;
  • The warterMarkView control whether the watermark is displayed or not ,if set ni,will remove watermark,otherwise add. set alpha represent mix.Position relative to outVideoSize. *.

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) UIView *warterMarkView
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong, readonly, nullable) UIImage *currentImage
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic) BOOL saveLocalVideo
  • Undocumented

    Declaration

    Objective-C

    @property (nonatomic, strong, nullable) NSURL *saveLocalVideoPath

Initializer

  • Unavailable

    =============================================================================

    =============================================================================

    Declaration

    Objective-C

    - (nullable instancetype)init;
  • Unavailable

    Undocumented

    Declaration

    Objective-C

    + (nullable instancetype)new UNAVAILABLE_ATTRIBUTE;
  • The designated initializer. Multiple instances with the same configuration will make the capture unstable.

    Declaration

    Objective-C

    - (nullable instancetype)initWithAudioConfiguration:(id)audioConfiguration
                                     videoConfiguration:(id)videoConfiguration;
  • The designated initializer. Multiple instances with the same configuration will make the capture unstable.

    Declaration

    Objective-C

    - (nullable instancetype)initWithAudioConfiguration:(id)audioConfiguration
                                     videoConfiguration:(id)videoConfiguration
                                            captureType:
                                                (UZLiveCaptureTypeMask)captureType;
  • The start stream .

    Declaration

    Objective-C

    - (void)startLive:(nonnull UZStreamInfo *)streamInfo;
  • The stop stream .

    Declaration

    Objective-C

    - (void)stopLive;
  • support outer input yuv or rgb video(set UZLiveCaptureTypeMask) .

    Declaration

    Objective-C

    - (void)pushVideo:(nullable CVPixelBufferRef)pixelBuffer;
  • support outer input pcm audio(set UZLiveCaptureTypeMask) .

    Declaration

    Objective-C

    - (void)pushAudio:(nullable NSData *)audioData;
  • Undocumented

    Declaration

    Objective-C

    - (void)pushAudioBuffer:(nullable CMSampleBufferRef)sampleBuffer;
  • Undocumented

    Declaration

    Objective-C

    - (void)pushVideoBuffer:(nullable CMSampleBufferRef)sampleBuffer;