/ fm / liveswitch / MediaBuffer
Class: MediaBuffer<TFormat, TBuffer>
fm.liveswitch.MediaBuffer
A media buffer.
Type parameters
Name | Type |
---|---|
TFormat |
MediaFormat<TFormat> |
TBuffer |
MediaBuffer<TFormat, TBuffer> |
Hierarchy
-
↳ MediaBuffer
↳↳ VideoBuffer
Table of contents
Constructors
Methods
- clone
- createInstance
- fmliveswitchMediaBufferInit
- free
- getDataBuffer
- getDataBuffers
- getDynamicProperties
- getDynamicValue
- getFootprint
- getFormat
- getIsMuted
- getLastSequenceNumber
- getRecoveredByFec
- getRtpHeader
- getRtpHeaders
- getRtpSequenceNumber
- getRtpSequenceNumbers
- getSequenceNumber
- getSequenceNumbers
- getSourceId
- getTypeString
- keep
- mute
- setDataBuffer
- setDataBuffers
- setDynamicValue
- setFormat
- setRecoveredByFec
- setRtpHeader
- setRtpHeaders
- setSequenceNumber
- setSequenceNumbers
- setSourceId
- toString
- tryKeep
- unsetDynamicValue
Constructors
constructor
+ new MediaBuffer<TFormat, TBuffer>(): MediaBuffer<TFormat, TBuffer>
Initializes a new instance of the [[fm.liveswitch.mediaBuffer]] class.
Type parameters:
Name | Type |
---|---|
TFormat |
MediaFormat<TFormat, TFormat> |
TBuffer |
MediaBuffer<TFormat, TBuffer, TBuffer> |
Returns: MediaBuffer<TFormat, TBuffer>
Inherited from: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:29
+ new MediaBuffer<TFormat, TBuffer>(dataBuffer
: DataBuffer, format
: TFormat): MediaBuffer<TFormat, TBuffer>
Initializes a new instance of the [[fm.liveswitch.mediaBuffer]] class.
Type parameters:
Name | Type |
---|---|
TFormat |
MediaFormat<TFormat, TFormat> |
TBuffer |
MediaBuffer<TFormat, TBuffer, TBuffer> |
Parameters:
Name | Type | Description |
---|---|---|
dataBuffer |
DataBuffer | The data buffer. |
format |
TFormat | The format. |
Returns: MediaBuffer<TFormat, TBuffer>
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:35
+ new MediaBuffer<TFormat, TBuffer>(dataBuffers
: DataBuffer[], format
: TFormat): MediaBuffer<TFormat, TBuffer>
Initializes a new instance of the [[fm.liveswitch.mediaBuffer]] class.
Type parameters:
Name | Type |
---|---|
TFormat |
MediaFormat<TFormat, TFormat> |
TBuffer |
MediaBuffer<TFormat, TBuffer, TBuffer> |
Parameters:
Name | Type | Description |
---|---|---|
dataBuffers |
DataBuffer[] | The data buffers. |
format |
TFormat | The format. |
Returns: MediaBuffer<TFormat, TBuffer>
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:43
Methods
clone
▸ clone(): TBuffer
Clones this instance.
Returns: TBuffer
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:83
createInstance
▸ Protected
Abstract
createInstance(): TBuffer
Creates a new instance.
Returns: TBuffer
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:107
fmliveswitchMediaBufferInit
▸ Private
fmliveswitchMediaBufferInit(): void
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:26
free
▸ free(): TBuffer
Frees the data buffers referenced by this instance.
Returns: TBuffer
This instance.
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:114
getDataBuffer
▸ getDataBuffer(): DataBuffer
Gets the data buffer.
Returns: DataBuffer
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:129
getDataBuffers
▸ getDataBuffers(): DataBuffer[]
Gets the data buffers.
Returns: DataBuffer[]
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:141
getDynamicProperties
▸ getDynamicProperties(): Hash<string, Object>
Gets all dynamic properties on this instance.
Returns: Hash<string, Object>
Inherited from: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:37
getDynamicValue
▸ getDynamicValue(key
: string): Object
Gets a property value from the local cache.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. |
Returns: Object
The stored value, if found; otherwise null.
Inherited from: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:58
getFootprint
▸ getFootprint(): number
Gets the approximate footprint of this media buffer by returning the sum of its data buffer lengths.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:154
getFormat
▸ getFormat(): TFormat
Gets the format.
Returns: TFormat
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:170
getIsMuted
▸ Abstract
getIsMuted(): boolean
Gets a value indicating whether this instance has been muted.
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:182
getLastSequenceNumber
▸ getLastSequenceNumber(): number
Gets the last sequence number.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:196
getRecoveredByFec
▸ getRecoveredByFec(): boolean
Gets a value indicating whether this buffer contains data recovered by forward error correction (FEC).
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:213
getRtpHeader
▸ getRtpHeader(): RtpPacketHeader
Gets the Rtp Packet Header for this media buffer.
Returns: RtpPacketHeader
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:225
getRtpHeaders
▸ getRtpHeaders(): RtpPacketHeader[]
Gets the RTP Packet Headers for this media buffer.
Returns: RtpPacketHeader[]
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:237
getRtpSequenceNumber
▸ getRtpSequenceNumber(): number
Gets the RTP sequence number.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:249
getRtpSequenceNumbers
▸ getRtpSequenceNumbers(): number[]
Gets the RTP sequence numbers.
Returns: number[]
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:265
getSequenceNumber
▸ getSequenceNumber(): number
Gets the sequence number.
Returns: number
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:290
getSequenceNumbers
▸ getSequenceNumbers(): number[]
Gets the sequence numbers.
Returns: number[]
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:306
getSourceId
▸ getSourceId(): string
Gets the source identifier.
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:318
getTypeString
▸ getTypeString(): string
Returns: string
Overrides: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:10
keep
▸ keep(): TBuffer
Keeps the data buffers referenced by this instance.
Returns: TBuffer
This instance.
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:331
mute
▸ Abstract
mute(): boolean
Mutes this instance. This is a one-way operation that clears
the underlying data buffer. If the buffer has an unsupported
format, this method will return false
.
Returns: boolean
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:348
setDataBuffer
▸ setDataBuffer(value
: DataBuffer): void
Sets the data buffer.
Parameters:
Name | Type |
---|---|
value |
DataBuffer |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:354
setDataBuffers
▸ setDataBuffers(value
: DataBuffer[]): void
Sets the data buffers.
Parameters:
Name | Type |
---|---|
value |
DataBuffer[] |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:369
setDynamicValue
▸ setDynamicValue(key
: string, value
: Object): void
Sets a property value in the local cache.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. |
value |
Object | The property value. This can be any object that needs to be stored for future use. |
Returns: void
Inherited from: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:95
setFormat
▸ setFormat(value
: TFormat): void
Sets the format.
Parameters:
Name | Type |
---|---|
value |
TFormat |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:384
setRecoveredByFec
▸ setRecoveredByFec(value
: boolean): void
Sets a value indicating whether this buffer contains data recovered by forward error correction (FEC).
Parameters:
Name | Type |
---|---|
value |
boolean |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:400
setRtpHeader
▸ setRtpHeader(value
: RtpPacketHeader): void
Sets the Rtp Packet Header for this media buffer.
Parameters:
Name | Type |
---|---|
value |
RtpPacketHeader |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:412
setRtpHeaders
▸ setRtpHeaders(value
: RtpPacketHeader[]): void
Sets the RTP Packet Headers for this media buffer.
Parameters:
Name | Type |
---|---|
value |
RtpPacketHeader[] |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:424
setSequenceNumber
▸ setSequenceNumber(value
: number): void
Sets the sequence number.
Parameters:
Name | Type |
---|---|
value |
number |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:436
setSequenceNumbers
▸ setSequenceNumbers(value
: number[]): void
Sets the sequence numbers.
Parameters:
Name | Type |
---|---|
value |
number[] |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:449
setSourceId
▸ setSourceId(value
: string): void
Sets the source identifier.
Parameters:
Name | Type |
---|---|
value |
string |
Returns: void
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:461
toString
▸ toString(): string
Returns a string that represents this instance.
Returns: string
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:473
tryKeep
▸ tryKeep(): boolean
Attempts to keep the data buffers referenced by this instance.
Returns: boolean
True if succeeded.
Defined in: Generated/TypeScript/fm.liveswitch/MediaBuffer.ts:486
unsetDynamicValue
▸ unsetDynamicValue(key
: string): boolean
Removes a property value from the local cache. Returns true if the value was removed and returns false otherwise.
Parameters:
Name | Type | Description |
---|---|---|
key |
string | The property key. This key is used internally only, but should be namespaced to avoid conflict with third-party extensions. |
Returns: boolean
true
if the value was removed; otherwise, false
.
Inherited from: Dynamic
Defined in: Generated/TypeScript/fm.liveswitch/Dynamic.ts:122