Classes
The following classes are available globally.
-
Undocumented
See moreDeclaration
Objective-C
@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
See moreDeclaration
Objective-C
@interface UZAudioConfiguration : NSObject<NSCoding, NSCopying> /// Default audio configuration + (instancetype)defaultConfiguration; /// Audio configuration + (instancetype)defaultConfigurationForQuality:(UZAudioQuality)audioQuality; #pragma mark - Attribute ///============================================================================= /// @name Attribute ///============================================================================= /// Number of channels (default 2) @property (nonatomic, assign) NSUInteger numberOfChannels; /// SampleRate @property (nonatomic, assign) UZAudioSampleRate audioSampleRate; /// BitRate @property (nonatomic, assign) UZAudioBitRate audioBitrate; /// flv encoded audio header 44100 is 0x12 0x10 @property (nonatomic, assign, readonly) char *asc; /// Buffer length @property (nonatomic, assign,readonly) NSUInteger bufferLength; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UZVideoConfiguration : NSObject<NSCoding, NSCopying> /// Default video configuration + (instancetype)defaultConfiguration; /// Video configuration (quality) + (instancetype)defaultConfigurationForQuality:(UZVideoQuality)videoQuality; /// Video configuration (quality & whether it is landscape) + (instancetype)defaultConfigurationForQuality:(UZVideoQuality)videoQuality outputImageOrientation:(UIInterfaceOrientation)outputImageOrientation; + (instancetype)defaultConfigurationForQuality:(UZVideoQuality)videoQuality outputImageOrientation:(UIInterfaceOrientation)outputImageOrientation encode:(BOOL)encode; #pragma mark - Attribute ///============================================================================= /// @name Attribute ///============================================================================= /// Video resolution,The width and height must be set to a multiple of 2,Otherwise, green edges may appear during decoding and playback(this one videoSizeRespectingAspectRatio Set to YES may change) @property (nonatomic, assign) CGSize videoSize; /// Whether the output image is proportional, the default is NO @property (nonatomic, assign) BOOL videoSizeRespectingAspectRatio; /// Video output direction @property (nonatomic, assign) UIInterfaceOrientation outputImageOrientation; /// Automatic rotation (only left to right portrait to portraitUpsideDown is supported here) @property (nonatomic, assign) BOOL autorotate; /// The frame rate of the video, which is fps @property (nonatomic, assign) NSUInteger videoFrameRate; /// The maximum frame rate of the video,which is fps @property (nonatomic, assign) NSUInteger videoMaxFrameRate; ///Video minimum frame rate,which is fps @property (nonatomic, assign) NSUInteger videoMinFrameRate; /// The maximum key frame interval can be set to twice the fps, affecting the gop size @property (nonatomic, assign) NSUInteger videoMaxKeyframeInterval; /// The bit rate of the video, the unit is bps @property (nonatomic, assign) NSUInteger videoBitRate; ///The maximum bit rate of the video, the unit is bps @property (nonatomic, assign) NSUInteger videoMaxBitRate; /// The minimum bit rate of the video, the unit is bps @property (nonatomic, assign) NSUInteger videoMinBitRate; /// Resolution @property (nonatomic, assign) UZVideoSessionPreset sessionPreset; /// ≈sde3 resolution @property (nonatomic, assign, readonly) NSString *avSessionPreset; /// Is it horizontal @property (nonatomic, assign, readonly) BOOL landscape; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UZFrame : NSObject @property (nonatomic, assign,) uint64_t timestamp; @property (nonatomic, strong) NSData *data; /// flv or rtmp header @property (nonatomic, strong) NSData *header; @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UZLiveDebug : NSObject @property (nonatomic, copy) NSString *streamId; /// Stream Id @property (nonatomic, copy) NSString *uploadUrl; /// Stream URL @property (nonatomic, assign) CGSize videoSize; /// Video Resolution @property (nonatomic, assign) BOOL isRtmp; /// Upload method(TCP or RTMP) @property (nonatomic, assign) CGFloat elapsedMilli; /// Time since last count in ms @property (nonatomic, assign) CGFloat timeStamp; /// Current timestamp to calculate data within 1s @property (nonatomic, assign) CGFloat dataFlow; /// Total flow @property (nonatomic, assign) CGFloat bandwidth; /// Total bandwidth within 1s @property (nonatomic, assign) CGFloat currentBandwidth; /// Last bandwidth @property (nonatomic, assign) NSInteger dropFrame; ///< Frames dropped @property (nonatomic, assign) NSInteger totalFrame; /// Total frames @property (nonatomic, assign) NSInteger capturedAudioCount; /// Number of audio captures in 1s @property (nonatomic, assign) NSInteger capturedVideoCount; /// Number of video captures in 1s @property (nonatomic, assign) NSInteger currentCapturedAudioCount; /// Number of audio captures last time @property (nonatomic, assign) NSInteger currentCapturedVideoCount; /// Number of last video captures @property (nonatomic, assign) NSInteger unSendCount; /// Unsent number (representing the current buffer waiting to be sent) @end
-
Undocumented
See moreDeclaration
Objective-C
@interface UZStreamInfo : NSObject @property (nonatomic, copy) NSString *streamId; #pragma mark -- FLV @property (nonatomic, copy) NSString *host; @property (nonatomic, assign) NSInteger port; #pragma mark -- RTMP @property (nonatomic, copy) NSString *url; ///< Upload address (just use RTMP) ///Audio configuration @property (nonatomic, strong) UZAudioConfiguration *audioConfiguration; ///Video configuration @property (nonatomic, strong) UZVideoConfiguration *videoConfiguration; @end