Skip to main content

Class: SoftwareDecoder

Defined in: livelink.clients/livelink.js/sources/rendering/streaming/SoftwareDecoder.ts:76

Software decoder that uses Broadway.js to decode h264 encoded frames.

This decoder is not recommended for production use. It is not optimized for performance. It is mainly provided as a reference implementation.

As a last resort, it can be used as a fallback when hardware decoding is not available.

See​

https://github.com/mbebenita/Broadway

Extends​

Constructors​

Constructor​

new SoftwareDecoder(params: {
decoded_frame_consumer: DecodedFrameConsumer;
}): SoftwareDecoder;

Defined in: livelink.clients/livelink.js/sources/rendering/streaming/SoftwareDecoder.ts:98

Create a new software decoder.

Parameters​

ParameterTypeDescription
params{ decoded_frame_consumer: DecodedFrameConsumer; }-
params.decoded_frame_consumerDecodedFrameConsumerThe decoded frame consumer that will receive the decoded frames

Returns​

SoftwareDecoder

Overrides​

EncodedFrameConsumer.constructor

Methods​

_onFrameDecoded()​

protected _onFrameDecoded(params: {
decoded_frame: DecodedFrame;
}): void;

Defined in: livelink.clients/livelink.js/sources/rendering/streaming/EncodedFrameConsumer.ts:132

Must be called by the implementation as soon as the frame is decoded to update the cameras in the scene.

Parameters​

ParameterTypeDescription
params{ decoded_frame: DecodedFrame; }-
params.decoded_frameDecodedFrameThe decoded frame

Returns​

void

Inherited from​

EncodedFrameConsumer._onFrameDecoded


configure()​

configure(params: {
codec: CodecType;
frame_dimensions: Vec2;
}): Promise<EncodedFrameConsumer>;

Defined in: livelink.clients/livelink.js/sources/rendering/streaming/SoftwareDecoder.ts:112

Configure the decoder with the codec and frame dimensions. This method replaces the constructor to allow for async initialization.

Parameters​

ParameterTypeDescription
params{ codec: CodecType; frame_dimensions: Vec2; }-
params.codecCodecTypeThe codec used to encode the frames
params.frame_dimensionsVec2The dimensions of the frame

Returns​

Promise<EncodedFrameConsumer>

Returns a promise to this so that the method can be chained to the constructor.

Overrides​

EncodedFrameConsumer.configure


resize()​

resize(params: {
frame_dimensions: Vec2;
}): void;

Defined in: livelink.clients/livelink.js/sources/rendering/streaming/SoftwareDecoder.ts:142

Resize the decoder with the new frame dimensions.

Parameters​

ParameterTypeDescription
params{ frame_dimensions: Vec2; }-
params.frame_dimensionsVec2The new frame dimensions

Returns​

void

Overrides​

EncodedFrameConsumer.resize


release()​

release(): void;

Defined in: livelink.clients/livelink.js/sources/rendering/streaming/SoftwareDecoder.ts:157

Release any resources used by the decoder.

Returns​

void

Overrides​

EncodedFrameConsumer.release


consumeEncodedFrame()​

consumeEncodedFrame(params: {
encoded_frame: EncodedFrame;
}): void;

Defined in: livelink.clients/livelink.js/sources/rendering/streaming/SoftwareDecoder.ts:166

Consume an encoded frame. Called as soon as a frame is received.

Parameters​

ParameterTypeDescription
params{ encoded_frame: EncodedFrame; }-
params.encoded_frameEncodedFrameThe encoded frame

Returns​

void

Overrides​

EncodedFrameConsumer.consumeEncodedFrame