LiteAVSDK
Tencent Cloud LVB SDK, is a high availability components serving tens of thousands of enterprise customers, which is committed to helping you to minimize your research and development costs.
V2TXLiveDef

Detailed Description

Key type definitions for Tencent Cloud LVB.

Video type definitions

enum  V2TXLiveVideoResolution : NSInteger
 
enum  V2TXLiveVideoResolutionMode : NSInteger
 
enum  V2TXLiveMirrorType : NSInteger
 
enum  V2TXLiveFillMode : NSInteger
 
enum  V2TXLiveRotation : NSInteger
 
enum  V2TXLivePixelFormat : NSInteger
 
enum  V2TXLiveBufferType : NSInteger
 

Audio type definitions

enum  V2TXLiveAudioQuality : NSInteger
 

Definitions of connection-status-related enumerated values

enum  V2TXLivePushStatus : NSInteger
 

Definition of playback-status-related enumeration values

enum  V2TXLivePlayStatus : NSInteger
 
enum  V2TXLiveStatusChangeReason : NSInteger
 
enum  V2TXAudioRoute : NSInteger
 

Data Structure Documentation

◆ V2TXLiveVideoFrame

class V2TXLiveVideoFrame

Properties

V2TXLivePixelFormat pixelFormat
 
V2TXLiveBufferType bufferType
 
NSData * data
 
CVPixelBufferRef pixelBuffer
 
NSUInteger width
 
NSUInteger height
 
V2TXLiveRotation rotation
 
GLuint textureId
 

Property Documentation

◆ pixelFormat

- (V2TXLivePixelFormat) pixelFormat
readwritenonatomicassign

Field description: Video pixel format.

◆ bufferType

- (V2TXLiveBufferType) bufferType
readwritenonatomicassign

Field description: Video data container format.

◆ data

- (NSData*) data
readwritenonatomicstrong

Field description: Video data when bufferType is V2TXLiveBufferTypeNSData.

◆ pixelBuffer

- (CVPixelBufferRef) pixelBuffer
readwritenonatomicassign

Field description: Video data when bufferType is V2TXLiveBufferTypePixelBuffer.

◆ width

- (NSUInteger) width
readwritenonatomicassign

Field description: Video width

◆ height

- (NSUInteger) height
readwritenonatomicassign

Field description: Video height.

◆ rotation

- (V2TXLiveRotation) rotation
readwritenonatomicassign

Field description: Clockwise rotation angle of video frames.

◆ textureId

- (GLuint) textureId
readwritenonatomicassign

Field description: Texture ID

◆ V2TXLivePusherStatistics

class V2TXLivePusherStatistics

Properties

NSUInteger appCpu
 
NSUInteger systemCpu
 
NSUInteger width
 
NSUInteger height
 
NSUInteger fps
 
NSUInteger videoBitrate
 
NSUInteger audioBitrate
 

Property Documentation

◆ appCpu

- (NSUInteger) appCpu
readwritenonatomicassign

Field description: CPU utilization of the current app (%)

◆ systemCpu

- (NSUInteger) systemCpu
readwritenonatomicassign

Field description: CPU utilization of the current system (%)

◆ width

- (NSUInteger) width
readwritenonatomicassign

Field description: Video width

◆ height

- (NSUInteger) height
readwritenonatomicassign

Field description: Video height

◆ fps

- (NSUInteger) fps
readwritenonatomicassign

Field description: Frame rate (fps)

◆ videoBitrate

- (NSUInteger) videoBitrate
readwritenonatomicassign

Field description: Video bitrate (Kbps)

◆ audioBitrate

- (NSUInteger) audioBitrate
readwritenonatomicassign

Field description: Audio bitrate (Kbps)

◆ V2TXLivePlayerStatistics

class V2TXLivePlayerStatistics

Properties

NSUInteger appCpu
 
NSUInteger systemCpu
 
NSUInteger width
 
NSUInteger height
 
NSUInteger fps
 
NSUInteger videoBitrate
 
NSUInteger audioBitrate
 

Property Documentation

◆ appCpu

- (NSUInteger) appCpu
readwritenonatomicassign

Field description: CPU utilization of the current app (%)

◆ systemCpu

- (NSUInteger) systemCpu
readwritenonatomicassign

Field description: CPU utilization of the current system (%)

◆ width

- (NSUInteger) width
readwritenonatomicassign

Field description: Video width

◆ height

- (NSUInteger) height
readwritenonatomicassign

Field description: Video height

◆ fps

- (NSUInteger) fps
readwritenonatomicassign

Field description: Frame rate (fps)

◆ videoBitrate

- (NSUInteger) videoBitrate
readwritenonatomicassign

Field description: Video bitrate (Kbps)

◆ audioBitrate

- (NSUInteger) audioBitrate
readwritenonatomicassign

Field description: Audio bitrate (Kbps)

◆ V2TXLiveMixStream

class V2TXLiveMixStream

Properties

NSString * userId
 
NSString * streamId
 
NSInteger x
 
NSInteger y
 
NSInteger width
 
NSInteger height
 
NSUInteger zOrder
 
V2TXLiveMixInputType inputType
 

Property Documentation

◆ userId

- (NSString*) userId
readwritenonatomiccopy

Field description: userId of users whose streams are mixed

◆ streamId

- (NSString*) streamId
readwritenonatomiccopy

Field description: push streamId of users whose streams are mixed. nil indicates the current push streamId.

◆ x

- (NSInteger) x
readwritenonatomicassign

Field description: x-axis (absolute pixels) of the image layer

◆ y

- (NSInteger) y
readwritenonatomicassign

Field description: y-axis (absolute pixels) of the image layer

◆ width

- (NSInteger) width
readwritenonatomicassign

Field description: width (absolute pixels) of the image layer

◆ height

- (NSInteger) height
readwritenonatomicassign

Field description: height (absolute pixels) of the image layer

◆ zOrder

- (NSUInteger) zOrder
readwritenonatomicassign

Field description: layer number (1-15), which must be unique

◆ inputType

- (V2TXLiveMixInputType) inputType
readwritenonatomicassign

Field description: input type of the live stream

◆ V2TXLiveTranscodingConfig

class V2TXLiveTranscodingConfig

Properties

NSUInteger videoWidth
 
NSUInteger videoHeight
 
NSUInteger videoBitrate
 
NSUInteger videoFramerate
 
NSUInteger videoGOP
 
NSUInteger backgroundColor
 
NSString * backgroundImage
 
NSUInteger audioSampleRate
 
NSUInteger audioBitrate
 
NSUInteger audioChannels
 
NSArray< V2TXLiveMixStream * > * mixStreams
 
NSString * outputStreamId
 

Property Documentation

◆ videoWidth

- (NSUInteger) videoWidth
readwritenonatomicassign

Field description: width of transcoded video
Recommended value: 360 px. If audio-only streams are mixed, the mixing result will carry a video stream that shows a canvas background. To avoid this, set both the width and height to 0 px.

◆ videoHeight

- (NSUInteger) videoHeight
readwritenonatomicassign

Field description: height of transcoded video
Recommended value: 640 px. If audio-only streams are mixed, the mixing result will carry a video stream that shows a canvas background. To avoid this, set both the width and height to 0 px.

◆ videoBitrate

- (NSUInteger) videoBitrate
readwritenonatomicassign

Field description: bitrate (Kbps) for the resolution of the transcoded video
Recommended value: if you set it to 0, the backend will calculate a bitrate based on videoWidth and videoHeight. You can also refer to the remarks for the enumerated value V2TXLiveVideoResolution.

◆ videoFramerate

- (NSUInteger) videoFramerate
readwritenonatomicassign

Field description: frame rate (fps) for the resolution of the transcoded video Value range: (0,30]; default: 15

◆ videoGOP

- (NSUInteger) videoGOP
readwritenonatomicassign

Field description: keyframe interval (GOP) for the resolution of the transcoded video Value range: [1,8]; default value: 2 (sec)

◆ backgroundColor

- (NSUInteger) backgroundColor
readwritenonatomicassign

Field description: background color of the mixed video image. The default color is black, and the value is a hex number. For example: "0x61B9F1" represents the RGB color (97,158,241). Default value: 0x000000 (black)

◆ backgroundImage

- (NSString*) backgroundImage
readwritenonatomiccopy

Field description: background image of the mixed video Default value: nil, which means that no background image is set Note: you need to first upload the image in Application Management > Function Configuration > Material Management in the console. You will get an image ID for the image uploaded, which you need to convert to a string and use it as the value of backgroundImage. For example, if the image ID is 63, you should set backgroundImage to 63.

◆ audioSampleRate

- (NSUInteger) audioSampleRate
readwritenonatomicassign

Field description: audio sample rate of the transcoded stream Valid values: 12000 Hz, 16000 Hz, 22050 Hz, 24000 Hz, 32000 Hz, 44100 Hz, 48000 Hz (default)

◆ audioBitrate

- (NSUInteger) audioBitrate
readwritenonatomicassign

Field description: audio bitrate of the transcoded stream Value range: [32,192]; default value: 64 (Kbps)

◆ audioChannels

- (NSUInteger) audioChannels
readwritenonatomicassign

Field description: number of sound channels of the transcoded stream Valid values: 1 (default), 2

◆ mixStreams

- (NSArray<V2TXLiveMixStream *>*) mixStreams
readwritenonatomiccopy

Field description: position of each channel of subimage

◆ outputStreamId

- (NSString*) outputStreamId
readwritenonatomiccopy

Field description: ID of the live stream pushed to CDN If you do not set this parameter, the SDK will execute the default logic, that is, it will mix multiple streams in the room into the video stream of the API caller, i.e., A + B => A. If you set this parameter, the SDK will mix multiple streams in the room into the live stream whose ID you have specified, i.e., A + B => C. Default value: nil, which indicates that multiple streams in the room are mixed into the video stream of the API caller

Enumeration Type Documentation

◆ V2TXLiveMode

enum V2TXLiveMode : NSUInteger

Supported protocol.

Enumerator
V2TXLiveMode_RTMP 

RTMP protocol.

V2TXLiveMode_RTC 

TRTC protocol.

◆ V2TXLiveVideoResolution

enum V2TXLiveVideoResolution : NSInteger

Video resolution.

Enumerator
V2TXLiveVideoResolution160x160 

Resolution: 160×160. Bitrate range: 100 Kbps to 150 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution270x270 

Resolution: 270×270. Bitrate range: 200 Kbps to 300 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution480x480 

Resolution: 480×480. Bitrate range: 350 Kbps to 525 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution320x240 

Resolution: 320×240. Bitrate range: 250 Kbps to 375 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution480x360 

Resolution: 480×360. Bitrate range: 400 Kbps to 600 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution640x480 

Resolution: 640×480. Bitrate range: 600 Kbps to 900 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution320x180 

Resolution: 320×180. Bitrate range: 250 Kbps to 400 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution480x270 

Resolution: 480×270. Bitrate range: 350 Kbps to 550 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution640x360 

Resolution: 640×360. Bitrate range: 500 Kbps to 900 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution960x540 

Resolution: 960×540. Bitrate range: 800 Kbps to 1500 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution1280x720 

Resolution: 1280×720. Bitrate range: 1000 Kbps to 1800 Kbps. Frame rate: 15 fps.

V2TXLiveVideoResolution1920x1080 

Resolution: 1920×1080. Bitrate range: 2500 Kbps to 3000 Kbps. Frame rate: 15 fps.

◆ V2TXLiveVideoResolutionMode

enum V2TXLiveVideoResolutionMode : NSInteger

Video aspect ratio mode.

Attention
  • Landscape resolution: V2TXLiveVideoResolution640x360 + V2TXLiveVideoResolutionModeLandscape = 640 × 360
  • Portrait resolution: V2TXLiveVideoResolution640x360 + V2TXLiveVideoResolutionModePortrait = 360 × 640
Enumerator
V2TXLiveVideoResolutionModeLandscape 

Landscape resolution.

V2TXLiveVideoResolutionModePortrait 

Portrait resolution.

◆ V2TXLiveMirrorType

enum V2TXLiveMirrorType : NSInteger

Local camera mirror type.

Enumerator
V2TXLiveMirrorTypeAuto 

Default mirror type. Images from the front camera are mirrored, and images from the rear camera are not mirrored.

V2TXLiveMirrorTypeEnable 

Both the front and rear cameras are switched to the mirror mode.

V2TXLiveMirrorTypeDisable 

Both the front and rear cameras are switched to the non-mirror mode.

◆ V2TXLiveFillMode

enum V2TXLiveFillMode : NSInteger

Image fill mode.

Enumerator
V2TXLiveFillModeFill 

The entire screen is covered by the image, without black edges. If the aspect ratio of the image is different from that of the screen, part of the image will be cropped.

V2TXLiveFillModeFit 

The image adapts to the screen and is not cropped. If the aspect ratio of the image is different from that of the screen, black edges will appear.

◆ V2TXLiveRotation

enum V2TXLiveRotation : NSInteger

Clockwise rotation of the video image.

Enumerator
V2TXLiveRotation0 

No rotation.

V2TXLiveRotation90 

Rotate 90 degrees clockwise.

V2TXLiveRotation180 

Rotate 180 degrees clockwise.

V2TXLiveRotation270 

Rotate 270 degrees clockwise.

◆ V2TXLivePixelFormat

enum V2TXLivePixelFormat : NSInteger

Pixel format of video frames.

Enumerator
V2TXLivePixelFormatUnknown 

Unknown.

V2TXLivePixelFormatI420 

YUV420P I420.

V2TXLivePixelFormatNV12 

YUV420SP NV12.

V2TXLivePixelFormatBGRA32 

BGRA8888.

V2TXLivePixelFormatTexture2D 

Texture2D.

◆ V2TXLiveBufferType

enum V2TXLiveBufferType : NSInteger

Video data container format.

Attention
In the custom capture and rendering features, you need to use the following enumerated values to specify the format for containing video data.
  • PixelBuffer: this is most efficient when used directly. The iOS system provides various APIs to obtain or process PixelBuffer.
  • NSData: when this is applied to custom rendering, PixelBuffer is copied once to NSData. When it is applied to custom capture, NSData is copied once to PixelBuffer. Therefore, the performance is affected to some extent.
Enumerator
V2TXLiveBufferTypeUnknown 

Unknown.

V2TXLiveBufferTypePixelBuffer 

This is most efficient when used directly. The iOS system provides various APIs to obtain or process PixelBuffer.

V2TXLiveBufferTypeTexture 

The performance is affected to some extent. As the SDK internally processes PixelBuffer directly, type switching between NSData and PixelBuffer results in memory copy overhead.

Texture

◆ V2TXLiveAudioQuality

enum V2TXLiveAudioQuality : NSInteger

Audio quality.

Enumerator
V2TXLiveAudioQualitySpeech 

Audio: 16k sample rate, mono-channel, 16 Kbps audio raw bitrate. This quality is suitable for scenarios that mainly involve voice calls, such as online meetings and voice calls.

V2TXLiveAudioQualityDefault 

General: 48k sample rate, mono-channel, 50 Kbps audio raw bitrate. This quality is the default audio quality of the SDK. We recommend that you choose this option unless you have special requirements.

V2TXLiveAudioQualityMusic 

Music: 48k sample rate, dual-channel + full-band, 128 Kbps audio raw bitrate. This quality is suitable for scenarios that require Hi-Fi music transmission, such as karaoke and music livestreams.

◆ V2TXLivePushStatus

enum V2TXLivePushStatus : NSInteger

Livestream connection status.

Enumerator
V2TXLivePushStatusDisconnected 

Disconnected from the server.

V2TXLivePushStatusConnecting 

Connecting to the server.

V2TXLivePushStatusConnectSuccess 

Connected to the server successfully.

V2TXLivePushStatusReconnecting 

Reconnecting to the server.

◆ V2TXLivePlayStatus

enum V2TXLivePlayStatus : NSInteger

Livestream playback status.

Enumerator
V2TXLivePlayStatusStopped 

Stopped.

V2TXLivePlayStatusPlaying 

Playing.

V2TXLivePlayStatusLoading 

Loading(The loading event will not be called back when the player loads for the first time)

◆ V2TXLiveStatusChangeReason

enum V2TXLiveStatusChangeReason : NSInteger

The reason for the livestream playback status.

Enumerator
V2TXLiveStatusChangeReasonInternal 

Internal reason.

V2TXLiveStatusChangeReasonBufferingBegin 

Start network buffering.

V2TXLiveStatusChangeReasonBufferingEnd 

End network buffering.

V2TXLiveStatusChangeReasonLocalStarted 

Start local playing.

V2TXLiveStatusChangeReasonLocalStopped 

Stop local playing.

V2TXLiveStatusChangeReasonRemoteStarted 

Start remote playing.

V2TXLiveStatusChangeReasonRemoteStopped 

Remote streaming stopped or interrupted.

◆ V2TXAudioRoute

enum V2TXAudioRoute : NSInteger

Playback mode.

Enumerator
V2TXAudioModeSpeakerphone 

Speaker.

V2TXAudioModeEarpiece 

Earpiece.

◆ V2TXLiveMixInputType

enum V2TXLiveMixInputType : NSInteger

Specify the type of streams to mix.

Enumerator
V2TXLiveMixInputTypeAudioVideo 

Audio and video.

V2TXLiveMixInputTypePureVideo 

Video only.

V2TXLiveMixInputTypePureAudio 

Audio only.