LiteAVSDK
Tencent Cloud TRTC 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

Data Structures

class  V2TXLiveVideoEncoderParam
 
class  V2TXLiveVideoFrame
 
class  V2TXLiveAudioFrame
 
class  V2TXLivePusherStatistics
 
class  V2TXLivePlayerStatistics
 
class  V2TXLiveMixStream
 
class  V2TXLiveTranscodingConfig
 
class  V2TXLiveLogConfig
 

Typedefs

typedef UIView TXView
 
typedef UIImage TXImage
 

Enumerations

enum  V2TXLiveMode : NSUInteger
 

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
 
enum  V2TXAudioRoute : NSInteger
 
enum  V2TXLiveMixInputType : NSInteger
 

Definitions of common configuration components

enum  V2TXLiveLogLevel : NSInteger
 

Detailed Description

Key type definitions for Tencent Cloud LVB.


Data Structure Documentation

◆ V2TXLiveVideoEncoderParam

class V2TXLiveVideoEncoderParam

Video encoding parameters

These settings determine the quality of image viewed by remote users

+ Inheritance diagram for V2TXLiveVideoEncoderParam:

Instance Methods

(instancetype _Nonnull) - initWith:
 

Properties

V2TXLiveVideoResolution videoResolution
 
V2TXLiveVideoResolutionMode videoResolutionMode
 
int videoFps
 
int videoBitrate
 
int minVideoBitrate
 

Method Documentation

◆ initWith:()

- (instancetype _Nonnull) initWith: (V2TXLiveVideoResolution resolution

Property Documentation

◆ minVideoBitrate

- (int) minVideoBitrate
readwritenonatomicassign

◆ videoBitrate

- (int) videoBitrate
readwritenonatomicassign

◆ videoFps

- (int) videoFps
readwritenonatomicassign

◆ videoResolution

- (V2TXLiveVideoResolution) videoResolution
readwritenonatomicassign

◆ videoResolutionMode

- (V2TXLiveVideoResolutionMode) videoResolutionMode
readwritenonatomicassign

◆ V2TXLiveVideoFrame

class V2TXLiveVideoFrame

Video frame information. V2TXLiveVideoFrame describes the raw data of a video image frame, which can be the image before frame encoding or the image after frame decoding.

Attention
Used during custom capture and rendering. During custom capture, you need to use V2TXLiveVideoFrame to contain the video frame to be sent. During custom rendering, the video frame contained by V2TXLiveVideoFrame will be returned.
+ Inheritance diagram for V2TXLiveVideoFrame:

Properties

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

Property Documentation

◆ bufferType

- (V2TXLiveBufferType) bufferType
readwritenonatomicassign

Field description: Video data container format.
Recommended value: V2TXLiveBufferTypePixelBuffer

◆ data

- (NSData*) data
readwritenonatomicstrong

Field description: Video data when bufferType is V2TXLiveBufferTypeNSData.

◆ height

- (NSUInteger) height
readwritenonatomicassign

Field description: Video height.

◆ pixelBuffer

- (CVPixelBufferRef) pixelBuffer
readwritenonatomicassign

Field description: Video data when bufferType is V2TXLiveBufferTypePixelBuffer.

◆ pixelFormat

- (V2TXLivePixelFormat) pixelFormat
readwritenonatomicassign

Field description: Video pixel format.
Recommended value: V2TXLivePixelFormatNV12

◆ rotation

- (V2TXLiveRotation) rotation
readwritenonatomicassign

Field description: Clockwise rotation angle of video frames.

◆ textureId

- (GLuint) textureId
readwritenonatomicassign

Field description: Texture ID

◆ width

- (NSUInteger) width
readwritenonatomicassign

Field description: Video width

◆ V2TXLiveAudioFrame

class V2TXLiveAudioFrame

audio frame

+ Inheritance diagram for V2TXLiveAudioFrame:

Properties

NSData * data
 
int sampleRate
 
int channel
 

Property Documentation

◆ channel

- (int) channel
readwritenonatomicassign

Field description: number of sound channels

◆ data

- (NSData*) data
readwritenonatomicstrong

Field description: audio data

◆ sampleRate

- (int) sampleRate
readwritenonatomicassign

Field description: audio sample rate

◆ V2TXLivePusherStatistics

class V2TXLivePusherStatistics

Pusher statistics.

+ Inheritance diagram for 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 (%)

◆ audioBitrate

- (NSUInteger) audioBitrate
readwritenonatomicassign

Field description: Audio bitrate (Kbps)

◆ fps

- (NSUInteger) fps
readwritenonatomicassign

Field description: Frame rate (fps)

◆ height

- (NSUInteger) height
readwritenonatomicassign

Field description: Video height

◆ systemCpu

- (NSUInteger) systemCpu
readwritenonatomicassign

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

◆ videoBitrate

- (NSUInteger) videoBitrate
readwritenonatomicassign

Field description: Video bitrate (Kbps)

◆ width

- (NSUInteger) width
readwritenonatomicassign

Field description: Video width

◆ V2TXLivePlayerStatistics

class V2TXLivePlayerStatistics

Player statistics.

+ Inheritance diagram for 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 (%)

◆ audioBitrate

- (NSUInteger) audioBitrate
readwritenonatomicassign

Field description: Audio bitrate (Kbps)

◆ fps

- (NSUInteger) fps
readwritenonatomicassign

Field description: Frame rate (fps)

◆ height

- (NSUInteger) height
readwritenonatomicassign

Field description: Video height

◆ systemCpu

- (NSUInteger) systemCpu
readwritenonatomicassign

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

◆ videoBitrate

- (NSUInteger) videoBitrate
readwritenonatomicassign

Field description: Video bitrate (Kbps)

◆ width

- (NSUInteger) width
readwritenonatomicassign

Field description: Video width

◆ V2TXLiveMixStream

class V2TXLiveMixStream

Position of each subimage in On-Cloud MixTranscoding.

+ Inheritance diagram for V2TXLiveMixStream:

Properties

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

Property Documentation

◆ height

- (NSInteger) height
readwritenonatomicassign

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

◆ inputType

- (V2TXLiveMixInputType) inputType
readwritenonatomicassign

Field description: input type of the live stream

◆ streamId

- (NSString*) streamId
readwritenonatomiccopy

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

◆ userId

- (NSString*) userId
readwritenonatomiccopy

Field description: userId of users whose streams are mixed

◆ width

- (NSInteger) width
readwritenonatomicassign

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

◆ 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

◆ zOrder

- (NSUInteger) zOrder
readwritenonatomicassign

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

◆ V2TXLiveTranscodingConfig

class V2TXLiveTranscodingConfig

Configure On-Cloud MixTranscoding.

+ Inheritance diagram for 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

◆ 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

◆ 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)

◆ 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.

◆ 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

◆ 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)

◆ 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.

◆ 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.

◆ V2TXLiveLogConfig

class V2TXLiveLogConfig
+ Inheritance diagram for V2TXLiveLogConfig:

Properties

V2TXLiveLogLevel logLevel
 
BOOL enableObserver
 
BOOL enableConsole
 
BOOL enableLogFile
 
NSString * logPath
 

Property Documentation

◆ enableConsole

- (BOOL) enableConsole
readwritenonatomicassign

Field description: Whether to allow the SDK to print Log on the console of the editor (XCoder, Android Studio, Visual Studio, etc.)
Recommended value: Default value: NO

◆ enableLogFile

- (BOOL) enableLogFile
readwritenonatomicassign

Field description: Whether to enable local log file Special Instructions: If not for special needs, please do not close the local log file, otherwise the Tencent Cloud technical team will not be able to track and locate problems when they occur.
Recommended value: Default value: YES

◆ enableObserver

- (BOOL) enableObserver
readwritenonatomicassign

Field description: Whether to receive the log information to be printed through V2TXLivePremierObserver Special Instructions: If you want to implement Log writing by yourself, you can turn on this switch, Log information will be called back to you V2TXLivePremierObserver::onLog.
Recommended value: Default value: NO

◆ logLevel

- (V2TXLiveLogLevel) logLevel
readwritenonatomicassign

Field description: Set Log level
Recommended value: Default value: V2TXLiveLogLevelAll

◆ logPath

- (NSString*) logPath
readwritenonatomiccopy

Field description: Set the storage directory of the local log, default Log storage location: iOS & Mac: sandbox Documents/log

Typedef Documentation

◆ TXImage

typedef NSImage TXImage

◆ TXView

typedef NSView TXView

Enumeration Type Documentation

◆ V2TXAudioRoute

enum V2TXAudioRoute : NSInteger

Playback mode.

Enumerator
V2TXAudioModeSpeakerphone 

Speaker.

V2TXAudioModeEarpiece 

Earpiece.

◆ 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.

◆ 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.

V2TXLiveBufferTypeNSData 

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.

V2TXLiveBufferTypeTexture 

Texture.

◆ 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.

◆ V2TXLiveLogLevel

enum V2TXLiveLogLevel : NSInteger

Log level.

Enumerator
V2TXLiveLogLevelAll 

Output all levels of log.

V2TXLiveLogLevelDebug 

Output DEBUG, INFO, WARNING, ERROR and FATAL level log.

V2TXLiveLogLevelInfo 

Output INFO, WARNING, ERROR and FATAL level log.

V2TXLiveLogLevelWarning 

Output WARNING, ERROR and FATAL level log.

V2TXLiveLogLevelError 

Output ERROR and FATAL level log.

V2TXLiveLogLevelFatal 

Only output FATAL level log.

V2TXLiveLogLevelNULL 

Does not output any sdk log.

◆ 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.

◆ V2TXLiveMixInputType

enum V2TXLiveMixInputType : NSInteger

Specify the type of streams to mix.

Enumerator
V2TXLiveMixInputTypeAudioVideo 

Audio and video.

V2TXLiveMixInputTypePureVideo 

Video only.

V2TXLiveMixInputTypePureAudio 

Audio only.

◆ V2TXLiveMode

enum V2TXLiveMode : NSUInteger

Supported protocol.

Enumerator
V2TXLiveMode_RTMP 

RTMP protocol.

V2TXLiveMode_RTC 

TRTC protocol.

◆ V2TXLivePixelFormat

enum V2TXLivePixelFormat : NSInteger

Pixel format of video frames.

Enumerator
V2TXLivePixelFormatUnknown 

Unknown.

V2TXLivePixelFormatI420 

YUV420P I420.

V2TXLivePixelFormatNV12 

YUV420SP NV12.

V2TXLivePixelFormatBGRA32 

BGRA8888.

V2TXLivePixelFormatTexture2D 

Texture2D.

◆ 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.

◆ 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.

◆ 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.