Skip to content

Commit b1eb427

Browse files
committed
feat(core): annotate internal interfaces with @internalapi for better visibility
1 parent 7974333 commit b1eb427

61 files changed

Lines changed: 313 additions & 51 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎core/src/main/java/io/github/thibaultbee/streampack/core/elements/encoders/IEncoder.kt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import io.github.thibaultbee.streampack.core.elements.interfaces.SuspendReleasab
2222
import io.github.thibaultbee.streampack.core.elements.interfaces.SuspendStreamable
2323
import kotlinx.coroutines.channels.SendChannel
2424
import java.nio.ByteBuffer
25+
import io.github.thibaultbee.streampack.core.utils.InternalAPI
2526

2627
interface IEncoder {
2728
/**
@@ -60,6 +61,7 @@ interface IEncoder {
6061
fun requestKeyFrame()
6162
}
6263

64+
@InternalAPI
6365
interface IEncoderInternal : SuspendStreamable, SuspendReleasable,
6466
IEncoder {
6567

‎core/src/main/java/io/github/thibaultbee/streampack/core/elements/encoders/mediacodec/MediaCodecEncoder.kt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ import io.github.thibaultbee.streampack.core.elements.utils.extensions.put
3535
import io.github.thibaultbee.streampack.core.elements.utils.extensions.removePrefixes
3636
import io.github.thibaultbee.streampack.core.elements.utils.pool.FramePool
3737
import io.github.thibaultbee.streampack.core.logger.Logger
38+
import io.github.thibaultbee.streampack.core.utils.InternalAPI
3839
import kotlinx.coroutines.CoroutineDispatcher
3940
import kotlinx.coroutines.CoroutineScope
4041
import kotlinx.coroutines.SupervisorJob
@@ -51,6 +52,7 @@ import kotlin.math.min
5152
*
5253
* @param encoderConfig the encoder configuration
5354
*/
55+
@OptIn(InternalAPI::class)
5456
internal class MediaCodecEncoder
5557
internal constructor(
5658
private val encoderConfig: EncoderConfig<*>,

‎core/src/main/java/io/github/thibaultbee/streampack/core/elements/endpoints/CombineEndpoint.kt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import io.github.thibaultbee.streampack.core.elements.utils.extensions.intersect
2424
import io.github.thibaultbee.streampack.core.logger.Logger
2525
import io.github.thibaultbee.streampack.core.pipelines.IDispatcherProvider
2626
import io.github.thibaultbee.streampack.core.pipelines.utils.MultiThrowable
27+
import io.github.thibaultbee.streampack.core.utils.InternalAPI
2728
import kotlinx.coroutines.CompletableDeferred
2829
import kotlinx.coroutines.CoroutineDispatcher
2930
import kotlinx.coroutines.CoroutineScope
@@ -43,6 +44,7 @@ import kotlinx.coroutines.launch
4344
* @param endpoints Endpoints to combine
4445
* @param coroutineDispatcher Coroutine dispatcher to use for frame writing
4546
*/
47+
@OptIn(InternalAPI::class)
4648
fun CombineEndpoint(vararg endpoints: IEndpointInternal, coroutineDispatcher: CoroutineDispatcher) =
4749
CombineEndpoint(endpoints.toList(), coroutineDispatcher)
4850

@@ -59,6 +61,7 @@ fun CombineEndpoint(vararg endpoints: IEndpointInternal, coroutineDispatcher: Co
5961
* @param endpointInternals List of endpoints to combine
6062
* @param coroutineDispatcher Coroutine dispatcher to use for frame writing
6163
*/
64+
@OptIn(InternalAPI::class)
6265
open class CombineEndpoint(
6366
protected val endpointInternals: List<IEndpointInternal>,
6467
coroutineDispatcher: CoroutineDispatcher
@@ -284,12 +287,14 @@ open class CombineEndpoint(
284287
/**
285288
* A factory to build a [CombineEndpoint] from a varargs of [IEndpointInternal.Factory].
286289
*/
290+
@OptIn(InternalAPI::class)
287291
fun CombineEndpointFactory(vararg endpointFactory: IEndpointInternal.Factory) =
288292
CombineEndpointFactory(endpointFactory.toList())
289293

290294
/**
291295
* A factory to build a [CombineEndpoint] from a list of [IEndpointInternal.Factory].
292296
*/
297+
@OptIn(InternalAPI::class)
293298
class CombineEndpointFactory(private val endpointFactory: List<IEndpointInternal.Factory>) :
294299
IEndpointInternal.Factory {
295300
override fun create(

‎core/src/main/java/io/github/thibaultbee/streampack/core/elements/endpoints/DualEndpoint.kt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import androidx.core.net.toUri
2121
import io.github.thibaultbee.streampack.core.configuration.mediadescriptor.MediaDescriptor
2222
import io.github.thibaultbee.streampack.core.configuration.mediadescriptor.UriMediaDescriptor
2323
import io.github.thibaultbee.streampack.core.pipelines.IDispatcherProvider
24+
import io.github.thibaultbee.streampack.core.utils.InternalAPI
2425
import kotlinx.coroutines.CoroutineDispatcher
2526
import kotlinx.coroutines.sync.Mutex
2627
import kotlinx.coroutines.sync.withLock
@@ -37,6 +38,7 @@ import kotlinx.coroutines.sync.withLock
3738
* @param secondEndpoint the second endpoint
3839
* @param coroutineDispatcher the coroutine dispatcher
3940
*/
41+
@OptIn(InternalAPI::class)
4042
open class DualEndpoint(
4143
private val mainEndpoint: IEndpointInternal,
4244
private val secondEndpoint: IEndpointInternal,
@@ -152,6 +154,7 @@ suspend fun DualEndpoint.startStreamSecond(uriString: String) =
152154
/**
153155
* A factory to build a [DualEndpoint].
154156
*/
157+
@OptIn(InternalAPI::class)
155158
class DualEndpointFactory(
156159
private val mainEndpointFactory: IEndpointInternal.Factory,
157160
private val secondEndpointFactory: IEndpointInternal.Factory

‎core/src/main/java/io/github/thibaultbee/streampack/core/elements/endpoints/DummyEndpoint.kt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,15 @@ import io.github.thibaultbee.streampack.core.configuration.mediadescriptor.Media
2020
import io.github.thibaultbee.streampack.core.elements.data.Frame
2121
import io.github.thibaultbee.streampack.core.elements.encoders.CodecConfig
2222
import io.github.thibaultbee.streampack.core.pipelines.IDispatcherProvider
23+
import io.github.thibaultbee.streampack.core.utils.InternalAPI
2324
import kotlinx.coroutines.flow.MutableStateFlow
2425
import kotlinx.coroutines.flow.StateFlow
2526
import kotlinx.coroutines.flow.asStateFlow
2627

2728
/**
2829
* A dummy endpoint for testing.
2930
*/
31+
@OptIn(InternalAPI::class)
3032
class DummyEndpoint : IEndpointInternal {
3133
private val _isOpenFlow = MutableStateFlow(false)
3234
override val isOpenFlow = _isOpenFlow.asStateFlow()
@@ -75,6 +77,7 @@ class DummyEndpoint : IEndpointInternal {
7577
/**
7678
* The factory to create [DummyEndpoint].
7779
*/
80+
@OptIn(InternalAPI::class)
7881
class DummyEndpointFactory : IEndpointInternal.Factory {
7982
override fun create(
8083
context: Context,
@@ -87,6 +90,7 @@ class DummyEndpointFactory : IEndpointInternal.Factory {
8790
/**
8891
* The factory to create [DummyEndpoint].
8992
*/
93+
@OptIn(InternalAPI::class)
9094
class DummyEndpointDummyFactory(val dummyEndpoint: DummyEndpoint) : IEndpointInternal.Factory {
9195
override fun create(
9296
context: Context,

‎core/src/main/java/io/github/thibaultbee/streampack/core/elements/endpoints/DynamicEndpoint.kt‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import io.github.thibaultbee.streampack.core.elements.metrics.WithEndpointMetric
3131
import io.github.thibaultbee.streampack.core.elements.utils.ConflatedJob
3232
import io.github.thibaultbee.streampack.core.logger.Logger
3333
import io.github.thibaultbee.streampack.core.pipelines.IDispatcherProvider
34+
import io.github.thibaultbee.streampack.core.utils.InternalAPI
3435
import kotlinx.coroutines.CoroutineDispatcher
3536
import kotlinx.coroutines.CoroutineScope
3637
import kotlinx.coroutines.cancelChildren
@@ -47,6 +48,7 @@ import kotlinx.coroutines.sync.withLock
4748
*
4849
* @param context The application context
4950
*/
51+
@OptIn(InternalAPI::class)
5052
open class DynamicEndpoint(
5153
private val context: Context,
5254
private val defaultDispatcher: CoroutineDispatcher,
@@ -276,6 +278,7 @@ open class DynamicEndpoint(
276278
/**
277279
* A factory to build a [DynamicEndpoint].
278280
*/
281+
@OptIn(InternalAPI::class)
279282
class DynamicEndpointFactory : IEndpointInternal.Factory {
280283
override fun create(
281284
context: Context,

‎core/src/main/java/io/github/thibaultbee/streampack/core/elements/endpoints/DynamicLocalEndpoint.kt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package io.github.thibaultbee.streampack.core.elements.endpoints
1818
import android.content.Context
1919
import io.github.thibaultbee.streampack.core.configuration.mediadescriptor.MediaDescriptor
2020
import io.github.thibaultbee.streampack.core.pipelines.IDispatcherProvider
21+
import io.github.thibaultbee.streampack.core.utils.InternalAPI
2122
import kotlinx.coroutines.CoroutineDispatcher
2223

2324
/**
@@ -42,6 +43,7 @@ class DynamicLocalEndpoint(
4243
}
4344
}
4445

46+
@OptIn(InternalAPI::class)
4547
class DynamicLocalEndpointFactory : IEndpointInternal.Factory {
4648
override fun create(
4749
context: Context,

‎core/src/main/java/io/github/thibaultbee/streampack/core/elements/endpoints/Endpoints.kt‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@ import io.github.thibaultbee.streampack.core.elements.endpoints.composites.Compo
66
import io.github.thibaultbee.streampack.core.elements.endpoints.composites.sinks.ISinkWithMetricsInternal
77
import io.github.thibaultbee.streampack.core.elements.endpoints.composites.muxers.ts.TsMuxer
88
import io.github.thibaultbee.streampack.core.elements.endpoints.composites.muxers.ts.data.TSServiceInfo
9+
import io.github.thibaultbee.streampack.core.utils.InternalAPI
910
import kotlinx.coroutines.CoroutineDispatcher
1011

1112
object Endpoints {
1213
/**
1314
* Creates an endpoint for RTMP (with a FLV muxer)
1415
*/
16+
@OptIn(InternalAPI::class)
1517
internal fun createRtmpEndpoint(
1618
defaultDispatcher: CoroutineDispatcher,
1719
ioDispatcher: CoroutineDispatcher
@@ -36,6 +38,7 @@ object Endpoints {
3638
/**
3739
* Creates an endpoint for FLV File
3840
*/
41+
@OptIn(InternalAPI::class)
3942
internal fun createFlvFileEndpoint(
4043
defaultDispatcher: CoroutineDispatcher,
4144
ioDispatcher: CoroutineDispatcher
@@ -61,6 +64,7 @@ object Endpoints {
6164
/**
6265
* Creates an endpoint for FLV File
6366
*/
67+
@OptIn(InternalAPI::class)
6468
internal fun createFlvContentEndpoint(
6569
context: Context,
6670
defaultDispatcher: CoroutineDispatcher,
@@ -90,6 +94,7 @@ object Endpoints {
9094
/**
9195
* Creates an endpoint for SRT (with a TS muxer)
9296
*/
97+
@OptIn(InternalAPI::class)
9398
internal fun createSrtEndpoint(
9499
serviceInfo: TSServiceInfo?,
95100
coroutineDispatcher: CoroutineDispatcher

‎core/src/main/java/io/github/thibaultbee/streampack/core/elements/endpoints/IEndpoint.kt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ import io.github.thibaultbee.streampack.core.elements.interfaces.SuspendReleasab
2525
import io.github.thibaultbee.streampack.core.elements.interfaces.SuspendStreamable
2626
import io.github.thibaultbee.streampack.core.pipelines.IDispatcherProvider
2727
import kotlinx.coroutines.flow.StateFlow
28+
import io.github.thibaultbee.streampack.core.utils.InternalAPI
2829

30+
@InternalAPI
2931
interface IEndpointInternal : IEndpoint, SuspendStreamable,
3032
SuspendCloseable, SuspendReleasable {
3133

‎core/src/main/java/io/github/thibaultbee/streampack/core/elements/endpoints/MediaMuxerEndpoint.kt‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import io.github.thibaultbee.streampack.core.elements.data.Frame
2828
import io.github.thibaultbee.streampack.core.elements.encoders.CodecConfig
2929
import io.github.thibaultbee.streampack.core.logger.Logger
3030
import io.github.thibaultbee.streampack.core.pipelines.IDispatcherProvider
31+
import io.github.thibaultbee.streampack.core.utils.InternalAPI
3132
import kotlinx.coroutines.CoroutineDispatcher
3233
import kotlinx.coroutines.flow.MutableStateFlow
3334
import kotlinx.coroutines.flow.StateFlow
@@ -40,6 +41,7 @@ import java.security.InvalidParameterException
4041
/**
4142
* An [IEndpointInternal] implementation of the [MediaMuxer].
4243
*/
44+
@OptIn(InternalAPI::class)
4345
class MediaMuxerEndpoint(
4446
private val context: Context,
4547
private val ioDispatcher: CoroutineDispatcher
@@ -491,7 +493,9 @@ class MediaMuxerEndpoint(
491493
/**
492494
* Factory for [MediaMuxerEndpoint].
493495
*/
494-
class MediaMuxerEndpointFactory : IEndpointInternal.Factory {
496+
@OptIn(InternalAPI::class)
497+
class MediaMuxerEndpointFactory :
498+
IEndpointInternal.Factory {
495499
override fun create(
496500
context: Context, dispatcherProvider: IDispatcherProvider
497501
): IEndpointInternal {

0 commit comments

Comments
 (0)