Skip to content

Migration from 2.6.X to 3.X.X

Thibault Beyou edited this page Sep 24, 2024 · 8 revisions

Version 3.0.0 introduces dynamic endpoints.

Thanks to dynamic endpoints, streamers are not longer specific to an output (SRT, RTMP, File,...), the DefaultStreamer will infer the output from the parameter passed to open.

Thus, specific streamers such as:

  • CameraSrtLiveStreamer
  • CameraRtmpLiveStreamer
  • CameraMp4FileStreamer
  • ... have been removed in favor of the streamer with dynamic endpoint:
  • DefaultCameraStreamer
  • ...

Packages

Packages have been moved from io.github.thibaultbee to io.github.thibaultbee.streampack.

Core

The package is now io.github.thibaultbee.streampack:streampack-core:3.X.X.

Classes from core has been moved from io.github.thibaultbee.streampack to io.github.thibaultbee.streampack.core.

Views, services

Views, services are now located in separate packages:

// For UI (incl. PreviewView)
implementation 'io.github.thibaultbee.streampack:streampack-ui:3.X.X'
// For ScreenRecorder service
implementation 'io.github.thibaultbee.streampack:streampack-services:3.X.X'

Streamers

As said in the introduction, specific streamers have been removed. Replace them by:

  • AudioOnlyXXXStreamer -> DefaultAudioOnlyStreamer
  • CameraXXXStreamer -> DefaultCameraStreamer
  • ScreenRecorderXXXStreamer -> DefaultScreenRecorderStreamer

connect/disconnect/setFile

connect/disconnect/setFile are replaced by open() and close()

Callbacks

Streamers are not split in 2 parts:

  • pure Kotlin coroutine based streamers
  • callback streamers

For coroutine based streamers, callbacks has been replaced by Flow:

  • OnErrorListener has been replaced by throwable StateFlow.
  • OnConnectionListener has been replaced by:
  1. onFailed: an exception could be thrown by open (or startStream) when trying to open
  2. onSuccess: if open (or startStream) does not return an exception
  3. onLost: you can get the streamer state with isOpen StateFlow (for SRT and RTMP, open = connected, closed = disconnected)

Bitrate regulator

Instead of passing the regulator to the SrtLiveStreamer, use addBitrateRegulatorController and removeBitrateRegulatorController APIs.

Configuration

AudioConfig

enableEchoCanceler and enableNoiseSuppressor have been removed from AudioConfig because it is a not a generic config but is related to AudioRecord class. Now, they are enabled by default and you can disable them in the MicrophoneSource constructor.