FMLiveSwitchMediaFrame Class Reference

A media frame. More...

Instance Methods

(void) - addBuffers:
 Adds some buffers. More...
 
(TBuffer) - buffer
 Gets the buffer. More...
 
(NSMutableArray *) - buffers
 Gets the buffers. More...
 
(TFrame) - clone
 Clones this instance. More...
 
(NSMutableArray *) - contributingSources
 Gets the contributing sources. More...
 
(TFrame) - createInstance
 Creates a new instance. More...
 
(TBufferCollection) - createMediaBufferCollection
 Creates a media buffer collection. More...
 
(bool) - discard
 Gets whether this frame should be discarded. More...
 
(int) - footprint
 Gets the approximate footprint of this media frame by returning the sum of its media buffer footprints. More...
 
(TFrame) - free
 Frees the buffers referenced by this instance. More...
 
(TBuffer) - getBufferWithFormat:
 Gets the last buffer whose format is compatible with the specified format. More...
 
(TBuffer) - getBufferWithFormat:sourceId:
 Gets the last buffer whose format is compatible with the specified format and whose source ID matches the specified source ID. More...
 
(TBuffer) - getBufferWithFormatName:
 Gets the last buffer whose format name matches the specified format name. More...
 
(TBuffer) - getBufferWithIsPacketized:
 Gets the last buffer whose format packetization flag matches the specified flag. More...
 
(TBuffer) - getBufferWithIsPacketized:isEncrypted:
 Gets the last buffer whose format packetization and encryption flags matches the specified flags. More...
 
(bool) - hasBufferWithFormat:
 Checks if a buffer exists with format equivalence. More...
 
(bool) - hasBufferWithFormat:sourceId:
 Checks if a buffer exists with format equivalence and source ID. More...
 
(instancetype) - init
 Initializes a new instance of the FMLiveSwitchMediaFrame`4 class. More...
 
(instancetype) - initWithBuffer:
 Initializes a new instance of the FMLiveSwitchMediaFrame`4 class. More...
 
(instancetype) - initWithBuffers:
 Initializes a new instance of the FMLiveSwitchMediaFrame`4 class. More...
 
(TFrame) - keep
 Keeps the buffers referenced by this instance. More...
 
(TBuffer) - lastBuffer
 Gets the most recent buffer. More...
 
(NSString *) - mid
 Gets the MID. More...
 
(long long) - networkSystemTimestamp
 Gets the network system timestamp. More...
 
(long long) - ntpTimestampTicks
 Gets the NTP timestamp ticks matching FMLiveSwitchMediaFrame`4timestamp, set by RTP receivers for synchronization of inbound media streams. More...
 
(void) - removeBuffer:
 Removes a buffer. More...
 
(void) - removeBuffers
 Removes all buffers. More...
 
(void) - removeBuffers:
 Removes some buffers. More...
 
(NSString *) - repairedRtpStreamId
 Gets the repaired RTP stream identifier. More...
 
(int) - rtpSequenceNumber
 Gets the RTP sequence number. More...
 
(NSString *) - rtpStreamId
 Gets the RTP stream identifier. More...
 
(long long) - rtpTimestamp
 Gets the RTP timestamp. More...
 
(long long) - sequenceNumber
 Gets the sequence number. More...
 
(void) - setBuffer:
 Sets the buffer. More...
 
(void) - setBuffers:
 Sets the buffers. More...
 
(void) - setContributingSources:
 Sets the contributing sources. More...
 
(void) - setDiscard:
 Sets whether this frame should be discarded. More...
 
(void) - setMid:
 Sets the MID. More...
 
(void) - setNetworkSystemTimestamp:
 Sets the network system timestamp. More...
 
(void) - setNtpTimestampTicks:
 Sets the NTP timestamp ticks matching FMLiveSwitchMediaFrame`4timestamp, set by RTP receivers for synchronization of inbound media streams. More...
 
(void) - setRepairedRtpStreamId:
 Sets the repaired RTP stream identifier. More...
 
(void) - setRtpSequenceNumber:
 Sets the RTP sequence number. More...
 
(void) - setRtpStreamId:
 Sets the RTP stream identifier. More...
 
(void) - setRtpTimestamp:
 Sets the RTP timestamp. More...
 
(void) - setSequenceNumber:
 Sets the sequence number. More...
 
(void) - setSynchronizationSource:
 Sets the synchronization source. More...
 
(void) - setSynchronized:
 Sets whether this frame has a FMLiveSwitchMediaFrame`4systemTimestamp that is actively synchronized with other streams. More...
 
(void) - setSystemTimestamp:
 Sets the system timestamp matching FMLiveSwitchMediaFrame`4timestamp but measured in system ticks. More...
 
(void) - setTimestamp:
 Sets the timestamp, measured according to the last buffer format's clock rate. More...
 
(void) - setTransportSystemTimestamp:
 Sets the transport system timestamp. More...
 
(long long) - synchronizationSource
 Gets the synchronization source. More...
 
(bool) - synchronized
 Gets whether this frame has a FMLiveSwitchMediaFrame`4systemTimestamp that is actively synchronized with other streams. More...
 
(long long) - systemTimestamp
 Gets the system timestamp matching FMLiveSwitchMediaFrame`4timestamp but measured in system ticks. More...
 
(long long) - timestamp
 Gets the timestamp, measured according to the last buffer format's clock rate. More...
 
(long long) - transportSystemTimestamp
 Gets the transport system timestamp. More...
 
(void) - updateTimestampWithBaseTimestamp:baseRtpTimestamp:inputClockRate:outputClockRate:
 Updates the timestamp to match resampling. More...
 

Class Methods

(long long) + calculateSystemTimestampWithBaseSystemTimestamp:timestamp:clockRate:baseTimestamp:
 Calculates a system timestamp given a base system timestamp, the current timestamp, a clock rate, and a base timestamp. More...
 
(long long) + calculateTimestampWithBaseSystemTimestamp:systemTimestamp:clockRate:
 Calculates a timestamp given a base system timestamp, the current system timestamp, and a clock rate. More...
 
(long long) + calculateTimestampWithBaseSystemTimestamp:systemTimestamp:clockRate:baseTimestamp:
 Calculates a timestamp given a base system timestamp, the current system timestamp, a clock rate, and a base timestamp. More...
 
(FMLiveSwitchMediaFrame *) + mediaFrame
 Initializes a new instance of the FMLiveSwitchMediaFrame`4 class. More...
 
(FMLiveSwitchMediaFrame *) + mediaFrameWithBuffer:
 Initializes a new instance of the FMLiveSwitchMediaFrame`4 class. More...
 
(FMLiveSwitchMediaFrame *) + mediaFrameWithBuffers:
 Initializes a new instance of the FMLiveSwitchMediaFrame`4 class. More...
 

Protected Attributes

 __pad0__: FMLiveSwitchDynamic- (void) addBuffer:(TBuffer)buffer
 

Detailed Description

A media frame.

Method Documentation

◆ addBuffers:

- (void) addBuffers: (NSMutableArray *)  buffers

Adds some buffers.

Parameters
buffersThe buffers.

◆ buffer

- (TBuffer) buffer

Gets the buffer.

◆ buffers

- (NSMutableArray*) buffers

Gets the buffers.

◆ calculateSystemTimestampWithBaseSystemTimestamp:timestamp:clockRate:baseTimestamp:

+ (long long) calculateSystemTimestampWithBaseSystemTimestamp: (long long)  baseSystemTimestamp
timestamp: (long long)  timestamp
clockRate: (int)  clockRate
baseTimestamp: (long long)  baseTimestamp 

Calculates a system timestamp given a base system timestamp, the current timestamp, a clock rate, and a base timestamp.

Parameters
baseSystemTimestampThe base system timestamp (offset).
timestampThe current timestamp.
clockRateThe clock rate of the media.
baseTimestampThe base timestamp (offset).

◆ calculateTimestampWithBaseSystemTimestamp:systemTimestamp:clockRate:

+ (long long) calculateTimestampWithBaseSystemTimestamp: (long long)  baseSystemTimestamp
systemTimestamp: (long long)  systemTimestamp
clockRate: (int)  clockRate 

Calculates a timestamp given a base system timestamp, the current system timestamp, and a clock rate.

This method assumes the base timestamp is zero.

Parameters
baseSystemTimestampThe base system timestamp (offset).
systemTimestampThe current system timestamp.
clockRateThe clock rate of the media.

◆ calculateTimestampWithBaseSystemTimestamp:systemTimestamp:clockRate:baseTimestamp:

+ (long long) calculateTimestampWithBaseSystemTimestamp: (long long)  baseSystemTimestamp
systemTimestamp: (long long)  systemTimestamp
clockRate: (int)  clockRate
baseTimestamp: (long long)  baseTimestamp 

Calculates a timestamp given a base system timestamp, the current system timestamp, a clock rate, and a base timestamp.

Parameters
baseSystemTimestampThe base system timestamp (offset).
systemTimestampThe current system timestamp.
clockRateThe clock rate of the media.
baseTimestampThe base timestamp (offset).

◆ clone

- (TFrame) clone

Clones this instance.

Implemented in FMLiveSwitchVideoFrame, and FMLiveSwitchAudioFrame.

◆ contributingSources

- (NSMutableArray*) contributingSources

Gets the contributing sources.

◆ createInstance

- (TFrame) createInstance

Creates a new instance.

Implemented in FMLiveSwitchVideoFrame, and FMLiveSwitchAudioFrame.

◆ createMediaBufferCollection

- (TBufferCollection) createMediaBufferCollection

Creates a media buffer collection.

Implemented in FMLiveSwitchVideoFrame, and FMLiveSwitchAudioFrame.

◆ discard

- (bool) discard

Gets whether this frame should be discarded.

◆ footprint

- (int) footprint

Gets the approximate footprint of this media frame by returning the sum of its media buffer footprints.

◆ free

- (TFrame) free

Frees the buffers referenced by this instance.

Returns
This instance.

◆ getBufferWithFormat:

- (TBuffer) getBufferWithFormat: (TFormat)  format

Gets the last buffer whose format is compatible with the specified format.

Parameters
formatThe format.

◆ getBufferWithFormat:sourceId:

- (TBuffer) getBufferWithFormat: (TFormat)  format
sourceId: (NSString *)  sourceId 

Gets the last buffer whose format is compatible with the specified format and whose source ID matches the specified source ID.

Parameters
formatThe format.
sourceIdThe source identifier.

◆ getBufferWithFormatName:

- (TBuffer) getBufferWithFormatName: (NSString *)  formatName

Gets the last buffer whose format name matches the specified format name.

Parameters
formatNameThe format name.

◆ getBufferWithIsPacketized:

- (TBuffer) getBufferWithIsPacketized: (bool)  isPacketized

Gets the last buffer whose format packetization flag matches the specified flag.

Parameters
isPacketizedWhether the buffer is packetized.

◆ getBufferWithIsPacketized:isEncrypted:

- (TBuffer) getBufferWithIsPacketized: (bool)  isPacketized
isEncrypted: (bool)  isEncrypted 

Gets the last buffer whose format packetization and encryption flags matches the specified flags.

Parameters
isPacketizedWhether the buffer is packetized.
isEncryptedWhether the buffer is encrypted.

◆ hasBufferWithFormat:

- (bool) hasBufferWithFormat: (TFormat)  format

Checks if a buffer exists with format equivalence.

Parameters
formatThe format.
Returns
true if the buffer exists; otherwise, false.

◆ hasBufferWithFormat:sourceId:

- (bool) hasBufferWithFormat: (TFormat)  format
sourceId: (NSString *)  sourceId 

Checks if a buffer exists with format equivalence and source ID.

Parameters
formatThe format.
sourceIdThe source identifier.
Returns
true if the buffer exists; otherwise, false.

◆ init

- (instancetype) init

Initializes a new instance of the FMLiveSwitchMediaFrame`4 class.

Implemented in FMLiveSwitchVideoFrame.

◆ initWithBuffer:

- (instancetype) initWithBuffer: (TBuffer)  buffer

Initializes a new instance of the FMLiveSwitchMediaFrame`4 class.

Parameters
bufferThe buffer.

◆ initWithBuffers:

- (instancetype) initWithBuffers: (NSMutableArray *)  buffers

Initializes a new instance of the FMLiveSwitchMediaFrame`4 class.

Parameters
buffersThe buffers.

Implemented in FMLiveSwitchVideoFrame.

◆ keep

- (TFrame) keep

Keeps the buffers referenced by this instance.

Returns
This instance.

◆ lastBuffer

- (TBuffer) lastBuffer

Gets the most recent buffer.

◆ mediaFrame

+ (FMLiveSwitchMediaFrame*) mediaFrame

Initializes a new instance of the FMLiveSwitchMediaFrame`4 class.

◆ mediaFrameWithBuffer:

+ (FMLiveSwitchMediaFrame*) mediaFrameWithBuffer: (TBuffer)  buffer

Initializes a new instance of the FMLiveSwitchMediaFrame`4 class.

Parameters
bufferThe buffer.

◆ mediaFrameWithBuffers:

+ (FMLiveSwitchMediaFrame*) mediaFrameWithBuffers: (NSMutableArray *)  buffers

Initializes a new instance of the FMLiveSwitchMediaFrame`4 class.

Parameters
buffersThe buffers.

◆ mid

- (NSString*) mid

Gets the MID.

◆ networkSystemTimestamp

- (long long) networkSystemTimestamp

Gets the network system timestamp.

For inbound media, this value is calculated in the network layer as soon as the packet payload is determined to contain media.

◆ ntpTimestampTicks

- (long long) ntpTimestampTicks

Gets the NTP timestamp ticks matching FMLiveSwitchMediaFrame`4timestamp, set by RTP receivers for synchronization of inbound media streams.

Deprecated:
Use SystemTimestamp instead.

◆ removeBuffer:

- (void) removeBuffer: (TBuffer)  buffer

Removes a buffer.

Parameters
bufferThe buffer.

◆ removeBuffers

- (void) removeBuffers

Removes all buffers.

◆ removeBuffers:

- (void) removeBuffers: (NSMutableArray *)  buffers

Removes some buffers.

Parameters
buffersThe buffers.

◆ repairedRtpStreamId

- (NSString*) repairedRtpStreamId

Gets the repaired RTP stream identifier.

◆ rtpSequenceNumber

- (int) rtpSequenceNumber

Gets the RTP sequence number.

◆ rtpStreamId

- (NSString*) rtpStreamId

Gets the RTP stream identifier.

◆ rtpTimestamp

- (long long) rtpTimestamp

Gets the RTP timestamp.

◆ sequenceNumber

- (long long) sequenceNumber

Gets the sequence number.

◆ setBuffer:

- (void) setBuffer: (TBuffer)  value

Sets the buffer.

◆ setBuffers:

- (void) setBuffers: (NSMutableArray *)  value

Sets the buffers.

◆ setContributingSources:

- (void) setContributingSources: (NSMutableArray *)  value

Sets the contributing sources.

◆ setDiscard:

- (void) setDiscard: (bool)  value

Sets whether this frame should be discarded.

◆ setMid:

- (void) setMid: (NSString *)  value

Sets the MID.

◆ setNetworkSystemTimestamp:

- (void) setNetworkSystemTimestamp: (long long)  value

Sets the network system timestamp.

For inbound media, this value is calculated in the network layer as soon as the packet payload is determined to contain media.

◆ setNtpTimestampTicks:

- (void) setNtpTimestampTicks: (long long)  value

Sets the NTP timestamp ticks matching FMLiveSwitchMediaFrame`4timestamp, set by RTP receivers for synchronization of inbound media streams.

Deprecated:
Use SystemTimestamp instead.

◆ setRepairedRtpStreamId:

- (void) setRepairedRtpStreamId: (NSString *)  value

Sets the repaired RTP stream identifier.

◆ setRtpSequenceNumber:

- (void) setRtpSequenceNumber: (int)  value

Sets the RTP sequence number.

◆ setRtpStreamId:

- (void) setRtpStreamId: (NSString *)  value

Sets the RTP stream identifier.

◆ setRtpTimestamp:

- (void) setRtpTimestamp: (long long)  value

Sets the RTP timestamp.

◆ setSequenceNumber:

- (void) setSequenceNumber: (long long)  value

Sets the sequence number.

◆ setSynchronizationSource:

- (void) setSynchronizationSource: (long long)  value

Sets the synchronization source.

◆ setSynchronized:

- (void) setSynchronized: (bool)  value

Sets whether this frame has a FMLiveSwitchMediaFrame`4systemTimestamp that is actively synchronized with other streams.

◆ setSystemTimestamp:

- (void) setSystemTimestamp: (long long)  value

Sets the system timestamp matching FMLiveSwitchMediaFrame`4timestamp but measured in system ticks.

For local frames, this value uses the same clock as FMLiveSwitchManagedStopwatch. For remote frames, this value uses a clock known only to the remote sender.

◆ setTimestamp:

- (void) setTimestamp: (long long)  value

Sets the timestamp, measured according to the last buffer format's clock rate.

◆ setTransportSystemTimestamp:

- (void) setTransportSystemTimestamp: (long long)  value

Sets the transport system timestamp.

For inbound media, this value is calculated after the network layer in the transport layer when the packet payload is picked up for processing (decryption, dejitter, track routing, etc.).

◆ synchronizationSource

- (long long) synchronizationSource

Gets the synchronization source.

◆ synchronized

- (bool) synchronized

Gets whether this frame has a FMLiveSwitchMediaFrame`4systemTimestamp that is actively synchronized with other streams.

◆ systemTimestamp

- (long long) systemTimestamp

Gets the system timestamp matching FMLiveSwitchMediaFrame`4timestamp but measured in system ticks.

For local frames, this value uses the same clock as FMLiveSwitchManagedStopwatch. For remote frames, this value uses a clock known only to the remote sender.

◆ timestamp

- (long long) timestamp

Gets the timestamp, measured according to the last buffer format's clock rate.

◆ transportSystemTimestamp

- (long long) transportSystemTimestamp

Gets the transport system timestamp.

For inbound media, this value is calculated after the network layer in the transport layer when the packet payload is picked up for processing (decryption, dejitter, track routing, etc.).

◆ updateTimestampWithBaseTimestamp:baseRtpTimestamp:inputClockRate:outputClockRate:

- (void) updateTimestampWithBaseTimestamp: (long long)  baseTimestamp
baseRtpTimestamp: (long long)  baseRtpTimestamp
inputClockRate: (int)  inputClockRate
outputClockRate: (int)  outputClockRate 

Updates the timestamp to match resampling.

Parameters
baseTimestampThe base timestamp, captured once for the first frame.
baseRtpTimestampThe base RTP timestamp, captured once for the first frame.
inputClockRateThe input clock rate.
outputClockRateThe output clock rate.

Member Data Documentation

◆ __pad0__

- __pad0__
protected