-
-
Notifications
You must be signed in to change notification settings - Fork 71
Migration from 2.6.X to 3.X.X
Version 3.0.0 introduces dynamic endpoints.
With dynamic endpoints, streamers are not longer specific to an output (SRT, RTMP, File,...), the SingleStreamer
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:
CameraSingleStreamer
- ...
However, as you can pass an endpoint to the SingleStreamer
, a streamer can be specific.
Packages have been moved from io.github.thibaultbee
to io.github.thibaultbee.streampack
.
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 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'
As said in the introduction, specific streamers have been removed. Replace them by:
-
AudioOnlyXXXStreamer
->AudioOnlySingleStreamer
-
CameraXXXStreamer
->CameraSingleStreamer
-
ScreenRecorderXXXStreamer
->ScreenRecorderSingleStreamer
connect
/disconnect
/setFile
are replaced by open()
and close()
Streamers are now 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 bythrowable
StateFlow
. -
OnConnectionListener
has been replaced by:
-
onFailed
: an exception could be thrown byopen
(orstartStream
) when trying to open -
onSuccess
: ifopen
(orstartStream
) does not return an exception -
onLost
: you can get the streamer state withisOpen
StateFlow
(for SRT and RTMP, open = connected, closed = disconnected)
Instead of passing the regulator to the SrtLiveStreamer
, use addBitrateRegulatorController
and removeBitrateRegulatorController
APIs.
enableEchoCanceler
and enableNoiseSuppressor
have been removed from AudioConfig
because it is a not a generic config but is related to Android AudioRecord
class. Now, they are enabled by default. You can remove them when creating the CameraSingleStreamer
with:
val streamer = CameraSingleStreamer(
context = context,
audioSourceInternal = MicrophoneSource()
)