FMLiveSwitchLocalMediaBase Class Reference

A collection of local audio/video track base methods. More...

Instance Methods

(void) - abortStartWithPromise:exception:
 Aborts the start. More...
 
(FMLiveSwitchAudioEncodingConfig *) - audioEncoding
 Gets the local audio encoding configuration. More...
 
(NSMutableArray *) - audioEncodings
 Gets the local audio encoding configurations. More...
 
(bool) - audioSimulcastDisabled
 Gets whether audio simulcast is disabled. More...
 
(int) - audioSimulcastEncodingCount
 Gets the maximum number of simulcast encodings that this media produces for the audio stream. More...
 
(int) - audioSimulcastPreferredBitrate
 Gets the preferred audio simulcast bitrate, in kbps. More...
 
(NSMutableArray *) - doGetAudioEncodings
 Gets the local audio encodings. More...
 
(NSMutableArray *) - doGetVideoEncodings
 Gets the local video encodings. More...
 
(void) - doSetAudioEncodings:
 Sets the local audio encodings. More...
 
(void) - doSetVideoEncodings:
 Sets the local video encodings. More...
 
(FMLiveSwitchFuture< TLocalMedia > *) - doStart
 Starts the local media. More...
 
(FMLiveSwitchFuture< TLocalMedia > *) - doStop
 Stops the local media. More...
 
(instancetype) - init
 Initializes a new instance of the FMLiveSwitchLocalMediaBase`3 class. More...
 
(void) - lockAudioEncodings
 Locks the audio encodings in prior to initialization. More...
 
(void) - lockVideoEncodings
 Locks the video encodings in prior to initialization. More...
 
(void) - lockVideoEncodingsWithSourceType:
 Locks the video encodings in prior to initialization. More...
 
(void) - lockVideoEncodingsWithSourceType:sourceWidth:sourceHeight:sourceFrameRate:
 Locks the video encodings in prior to initialization. More...
 
(void) - setAudioEncodings:
 Sets the local audio encoding configurations. More...
 
(void) - setAudioSimulcastDisabled:
 Sets whether audio simulcast is disabled. More...
 
(void) - setAudioSimulcastEncodingCount:
 Sets the maximum number of simulcast encodings that this media produces for the audio stream. More...
 
(void) - setAudioSimulcastPreferredBitrate:
 Sets the preferred audio simulcast bitrate, in kbps. More...
 
(void) - setVideoEncodings:
 Sets the local video encoding configurations. More...
 
(void) - setVideoSimulcastBitsPerPixel:
 Sets the video simulcast bits per pixel (bpp). More...
 
(void) - setVideoSimulcastDegradationPreference:
 Sets the video’s simulcast degradation preference. More...
 
(void) - setVideoSimulcastDisabled:
 Sets whether video simulcast is disabled. More...
 
(void) - setVideoSimulcastEncodingCount:
 Sets the maximum number of simulcast encodings that this LocalMedia produces for the video stream. More...
 
(void) - setVideoSimulcastPreferredBitrate:
 Sets the preferred bitrate of a video simulcast in Kbps. More...
 
(FMLiveSwitchFuture< TLocalMedia > *) - start
 Starts media track sources. More...
 
(FMLiveSwitchLocalMediaState) - state
 Gets the current state of this media. More...
 
(FMLiveSwitchFuture< TLocalMedia > *) - stop
 Stops media track sources. More...
 
(FMLiveSwitchVideoEncodingConfig *) - videoEncoding
 Gets the local video encoding configuration. More...
 
(NSMutableArray *) - videoEncodings
 Gets the local video encoding configurations. More...
 
(double) - videoSimulcastBitsPerPixel
 Gets the video simulcast bits per pixel (bpp). More...
 
(FMLiveSwitchVideoDegradationPreference) - videoSimulcastDegradationPreference
 Gets the video’s simulcast degradation preference. More...
 
(bool) - videoSimulcastDisabled
 Gets whether video simulcast is disabled. More...
 
(int) - videoSimulcastEncodingCount
 Gets the maximum number of simulcast encodings that this LocalMedia produces for the video stream. More...
 
(int) - videoSimulcastPreferredBitrate
 Gets the preferred bitrate of a video simulcast in Kbps. More...
 

Class Methods

(double) + defaultVideoBitsPerPixel
 Gets the default bits-per-pixel for video. More...
 
(FMLiveSwitchLocalMediaBase *) + localMediaBase
 Initializes a new instance of the FMLiveSwitchLocalMediaBase`3 class. More...
 
(void) + setDefaultVideoBitsPerPixel:
 Sets the default bits-per-pixel for video. More...
 

Protected Attributes

 __pad0__: FMLiveSwitchMedia<TAudioTrack
 

Detailed Description

A collection of local audio/video track base methods.

Method Documentation

◆ abortStartWithPromise:exception:

- (void) abortStartWithPromise: (FMLiveSwitchPromise< TLocalMedia > *)  promise
exception: (NSException *)  exception 

Aborts the start.

Parameters
promiseThe promise.
exceptionThe exception.

◆ audioEncoding

- (FMLiveSwitchAudioEncodingConfig*) audioEncoding

Gets the local audio encoding configuration.

If there are multiple audio tracks in a custom media stack, this method calls into the first audio track.

◆ audioEncodings

- (NSMutableArray*) audioEncodings

Gets the local audio encoding configurations.

Audio encodings cannot be empty, so if you set an encoding with a null value or an empty array, this method creates an empty array with one AudioEncodingConfig in it.
If a new audio encodings array has the same number of encodings as the current one, the new audio encodings are applied to the local media’s audio track. Otherwise, an exception is thrown because the number of audio encodings cannot be changed once they are set.

◆ audioSimulcastDisabled

- (bool) audioSimulcastDisabled

Gets whether audio simulcast is disabled.

◆ audioSimulcastEncodingCount

- (int) audioSimulcastEncodingCount

Gets the maximum number of simulcast encodings that this media produces for the audio stream.


The number of encodings cannot be changed once they are set.
This property must be set before the media starts.

◆ audioSimulcastPreferredBitrate

- (int) audioSimulcastPreferredBitrate

Gets the preferred audio simulcast bitrate, in kbps.

The bitrate must be a positive integer.

◆ defaultVideoBitsPerPixel

+ (double) defaultVideoBitsPerPixel

Gets the default bits-per-pixel for video.

◆ doGetAudioEncodings

- (NSMutableArray*) doGetAudioEncodings

Gets the local audio encodings.

Returns
The local audio encodings.

Implemented in FMLiveSwitchLocalMedia.

◆ doGetVideoEncodings

- (NSMutableArray*) doGetVideoEncodings

Gets the local video encodings.

Returns
The local video encodings.

Implemented in FMLiveSwitchLocalMedia.

◆ doSetAudioEncodings:

- (void) doSetAudioEncodings: (NSMutableArray *)  encodings

Sets the local audio encodings.

Parameters
encodingsThe local audio encodings.

Implemented in FMLiveSwitchLocalMedia.

◆ doSetVideoEncodings:

- (void) doSetVideoEncodings: (NSMutableArray *)  encodings

Sets the local video encodings.

Parameters
encodingsThe local video encodings.

Implemented in FMLiveSwitchLocalMedia.

◆ doStart

- (FMLiveSwitchFuture<TLocalMedia>*) doStart

Starts the local media.

Implemented in FMLiveSwitchLocalMedia.

◆ doStop

- (FMLiveSwitchFuture<TLocalMedia>*) doStop

Stops the local media.

Implemented in FMLiveSwitchLocalMedia.

◆ init

- (instancetype) init

Initializes a new instance of the FMLiveSwitchLocalMediaBase`3 class.

Implemented in FMLiveSwitchLocalMedia.

◆ localMediaBase

+ (FMLiveSwitchLocalMediaBase*) localMediaBase

Initializes a new instance of the FMLiveSwitchLocalMediaBase`3 class.

◆ lockAudioEncodings

- (void) lockAudioEncodings

Locks the audio encodings in prior to initialization.

◆ lockVideoEncodings

- (void) lockVideoEncodings

Locks the video encodings in prior to initialization.

◆ lockVideoEncodingsWithSourceType:

- (void) lockVideoEncodingsWithSourceType: (FMLiveSwitchVideoType)  sourceType

Locks the video encodings in prior to initialization.

◆ lockVideoEncodingsWithSourceType:sourceWidth:sourceHeight:sourceFrameRate:

- (void) lockVideoEncodingsWithSourceType: (FMLiveSwitchVideoType)  sourceType
sourceWidth: (int)  sourceWidth
sourceHeight: (int)  sourceHeight
sourceFrameRate: (double)  sourceFrameRate 

Locks the video encodings in prior to initialization.

◆ setAudioEncodings:

- (void) setAudioEncodings: (NSMutableArray *)  value

Sets the local audio encoding configurations.

Audio encodings cannot be empty, so if you set an encoding with a null value or an empty array, this method creates an empty array with one AudioEncodingConfig in it.
If a new audio encodings array has the same number of encodings as the current one, the new audio encodings are applied to the local media’s audio track. Otherwise, an exception is thrown because the number of audio encodings cannot be changed once they are set.

◆ setAudioSimulcastDisabled:

- (void) setAudioSimulcastDisabled: (bool)  value

Sets whether audio simulcast is disabled.

◆ setAudioSimulcastEncodingCount:

- (void) setAudioSimulcastEncodingCount: (int)  value

Sets the maximum number of simulcast encodings that this media produces for the audio stream.


The number of encodings cannot be changed once they are set.
This property must be set before the media starts.

◆ setAudioSimulcastPreferredBitrate:

- (void) setAudioSimulcastPreferredBitrate: (int)  value

Sets the preferred audio simulcast bitrate, in kbps.

The bitrate must be a positive integer.

◆ setDefaultVideoBitsPerPixel:

+ (void) setDefaultVideoBitsPerPixel: (double)  value

Sets the default bits-per-pixel for video.

◆ setVideoEncodings:

- (void) setVideoEncodings: (NSMutableArray *)  value

Sets the local video encoding configurations.

Video encodings cannot be empty, so if you set the value of this method to null or an empty array, an exception is thrown.
The number of video encodings cannot be changed once set. If the number of new video encodings is different from the existing number of video encodings, an error is thrown. If a new video encoding array has the same number of encodings as the current one, the encodings are applied to the media’s VP8, VP9, H.264, and H.265 controllers, converters, encoders, and packetizers.
For controllers which inherit from FrameRatePipe, that means setting controller.OutputSynchronizationSource to the encoding.SynchronizationSource. If the encoding.FrameRate is greater than zero, this sets the controller.MaxFrameRate and controller.TargetFrameRate to the encoding.FrameRate.
For converters which are the ImageScalePipe type, that means setting converter.MaxScale and converter.TargetScale to encoding.Scale, as long as encoding.Scale is greater than zero.
For encoders, if the encoder's output format is not a fixed bitrate and encoding.Bitrate is greater than zero, that means setting the encoder.MaxBitrate and encoder.TargetBitrate to encoding.Bitrate.
For packetizers, that means setting packetizer.Deactivated to encoding.Deactivated.

◆ setVideoSimulcastBitsPerPixel:

- (void) setVideoSimulcastBitsPerPixel: (double)  value

Sets the video simulcast bits per pixel (bpp).

The bits per pixel value must be greater than or equal to zero.
If the video source has declared a target width, height, and frame rate, and VideoSimulcastBitsPerPixel has a set value, then the encoding bitrates are calculated with setVideoSimulcastBitsPerPixel’s value instead of the preferred bitrate.

◆ setVideoSimulcastDegradationPreference:

- (void) setVideoSimulcastDegradationPreference: (FMLiveSwitchVideoDegradationPreference)  value

Sets the video’s simulcast degradation preference.


The following degradation preferences can be set:
Automatic: Prefers to automate degradation based on video type. A Screen video type prefers to degrade FrameRate. A Camera video type prefers to degrade Resolution. An unknown video type prefers a Balanced approach.
Balanced: Prefers to degrade both FrameRate and Resolution together in smaller increments.
FrameRate: Prefers to degrade FrameRate instead of Resolution.
Resolution: Prefers to degrade Resolution instead of FrameRate.

◆ setVideoSimulcastDisabled:

- (void) setVideoSimulcastDisabled: (bool)  value

Sets whether video simulcast is disabled.

If true, video simulcast is disabled. If false, video simulcast is enabled.

◆ setVideoSimulcastEncodingCount:

- (void) setVideoSimulcastEncodingCount: (int)  value

Sets the maximum number of simulcast encodings that this LocalMedia produces for the video stream.

The default value is 2. For LiveSwitch Media Server, the maximum is 4 encodings. This property must be set before the LocalMedia starts.

◆ setVideoSimulcastPreferredBitrate:

- (void) setVideoSimulcastPreferredBitrate: (int)  value

Sets the preferred bitrate of a video simulcast in Kbps.

The bitrate must be a positive integer.

◆ start

- (FMLiveSwitchFuture<TLocalMedia>*) start

Starts media track sources.

This method does not take any parameters and executes asynchronously. Call this method when LocalMedia's state is New or Stopped. If you call this method when LocalMedia's state is not New or Stopped, then the Future returned by this method is rejected.

◆ state

- (FMLiveSwitchLocalMediaState) state

Gets the current state of this media.

The possible states are defined in the enumeration LocalMediaState. Use this property to check if, for example, the media instance is starting, has started, is stopping, or has stopped.

◆ stop

- (FMLiveSwitchFuture<TLocalMedia>*) stop

Stops media track sources.

This method does not take any parameters and executes asynchronously. Call this method when LocalMedia has started. If you call this method when LocalMedia has not started, then the Future returned by this method is rejected.

◆ videoEncoding

- (FMLiveSwitchVideoEncodingConfig*) videoEncoding

Gets the local video encoding configuration.


If there are multiple video tracks in a custom media stack, this method calls into the first video track. Returns the local VideoEncodingConfig.

◆ videoEncodings

- (NSMutableArray*) videoEncodings

Gets the local video encoding configurations.

Video encodings cannot be empty, so if you set the value of this method to null or an empty array, an exception is thrown.
The number of video encodings cannot be changed once set. If the number of new video encodings is different from the existing number of video encodings, an error is thrown. If a new video encoding array has the same number of encodings as the current one, the encodings are applied to the media’s VP8, VP9, H.264, and H.265 controllers, converters, encoders, and packetizers.
For controllers which inherit from FrameRatePipe, that means setting controller.OutputSynchronizationSource to the encoding.SynchronizationSource. If the encoding.FrameRate is greater than zero, this sets the controller.MaxFrameRate and controller.TargetFrameRate to the encoding.FrameRate.
For converters which are the ImageScalePipe type, that means setting converter.MaxScale and converter.TargetScale to encoding.Scale, as long as encoding.Scale is greater than zero.
For encoders, if the encoder's output format is not a fixed bitrate and encoding.Bitrate is greater than zero, that means setting the encoder.MaxBitrate and encoder.TargetBitrate to encoding.Bitrate.
For packetizers, that means setting packetizer.Deactivated to encoding.Deactivated.

◆ videoSimulcastBitsPerPixel

- (double) videoSimulcastBitsPerPixel

Gets the video simulcast bits per pixel (bpp).

The bits per pixel value must be greater than or equal to zero.
If the video source has declared a target width, height, and frame rate, and VideoSimulcastBitsPerPixel has a set value, then the encoding bitrates are calculated with setVideoSimulcastBitsPerPixel’s value instead of the preferred bitrate.

◆ videoSimulcastDegradationPreference

- (FMLiveSwitchVideoDegradationPreference) videoSimulcastDegradationPreference

Gets the video’s simulcast degradation preference.


The following degradation preferences can be set:
Automatic: Prefers to automate degradation based on video type. A Screen video type prefers to degrade FrameRate. A Camera video type prefers to degrade Resolution. An unknown video type prefers a Balanced approach.
Balanced: Prefers to degrade both FrameRate and Resolution together in smaller increments.
FrameRate: Prefers to degrade FrameRate instead of Resolution.
Resolution: Prefers to degrade Resolution instead of FrameRate.

◆ videoSimulcastDisabled

- (bool) videoSimulcastDisabled

Gets whether video simulcast is disabled.

If true, video simulcast is disabled. If false, video simulcast is enabled.

◆ videoSimulcastEncodingCount

- (int) videoSimulcastEncodingCount

Gets the maximum number of simulcast encodings that this LocalMedia produces for the video stream.

The default value is 2. For LiveSwitch Media Server, the maximum is 4 encodings. This property must be set before the LocalMedia starts.

◆ videoSimulcastPreferredBitrate

- (int) videoSimulcastPreferredBitrate

Gets the preferred bitrate of a video simulcast in Kbps.

The bitrate must be a positive integer.

Member Data Documentation

◆ __pad0__

- __pad0__
protected