SoftwareDecoder
@3dverse/livelink / SoftwareDecoder
Class: SoftwareDecoder
Defined in: livelink.js/sources/rendering/decoders/SoftwareDecoder.ts:66
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
new SoftwareDecoder()
new SoftwareDecoder(
params
):SoftwareDecoder
Defined in: livelink.js/sources/rendering/decoders/SoftwareDecoder.ts:88
Create a new software decoder.
Parameters
params
decoded_frame_consumer
The decoded frame consumer that will receive the decoded frames
Returns
Overrides
EncodedFrameConsumer
.constructor
Methods
_onFrameDecoded()
protected
_onFrameDecoded(frame
):void
Defined in: livelink.js/sources/rendering/decoders/EncodedFrameConsumer.ts:90
Must be called by the implementation as soon as the frame is decoded to update the cameras in the scene.
Parameters
frame
The decoded frame data
decoded_frame
OffscreenCanvas
| VideoFrame
The decoded frame data
meta_data
The frame meta data
Returns
void
Inherited from
EncodedFrameConsumer
._onFrameDecoded
configure()
configure(
params
):Promise
<EncodedFrameConsumer
>
Defined in: livelink.js/sources/rendering/decoders/SoftwareDecoder.ts:102
Configure the decoder with the codec and frame dimensions. This method replaces the constructor to allow for async initialization.
Parameters
params
codec
The codec used to encode the frames
frame_dimensions
The 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
release()
release():
void
Defined in: livelink.js/sources/rendering/decoders/SoftwareDecoder.ts:129
Release any resources used by the decoder.
Returns
void
Overrides
consumeEncodedFrame()
consumeEncodedFrame(
params
):void
Defined in: livelink.js/sources/rendering/decoders/SoftwareDecoder.ts:139
Consume an encoded frame. Called as soon as a frame is received.
Parameters
params
encoded_frame
DataView
The encoded frame data
meta_data
The frame meta data
Returns
void