enableHardwareDecoder method
- bool enable
Enables or disables hardware decoding.
Available since: 1.1.0 Description: Control whether hardware decoding is used when playing streams, with hardware decoding enabled the SDK will use the GPU for decoding, reducing CPU usage. Use cases: If developers find that the device heats up badly when playing large resolution audio and video streams during testing on some models, consider calling this function to enable hardware decoding. Default value: Hardware decoding is disabled by default when this interface is not called. When to call: This function needs to be called after createEngine creates an instance. Restrictions: None. Caution: Need to be called before calling startPlayingStream, if called after playing the stream, it will only take effect after stopping the stream and re-playing it. Once this configuration has taken effect, it will remain in force until the next call takes effect.
enable
Whether to turn on hardware decoding switch, true: enable hardware decoding, false: disable hardware decoding.
Implementation
Future<void> enableHardwareDecoder(bool enable) async {
return await ZegoExpressImpl.instance.enableHardwareDecoder(enable);
}