Skip to content

Commit 53fc65c

Browse files
committed
fix(core): codec config is now a sealed class
1 parent d9672bc commit 53fc65c

File tree

2 files changed

+5
-3
lines changed
  • core/src
    • main/java/io/github/thibaultbee/streampack/core/elements/encoders
    • test/java/io/github/thibaultbee/streampack/core/elements/endpoints/composites/muxers/ts/tables

2 files changed

+5
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import io.github.thibaultbee.streampack.core.elements.encoders.mediacodec.MediaC
2222
* Base configuration class.
2323
* If you don't know how to set class members, [Video encoding recommendations](https://developer.android.com/guide/topics/media/media-formats#video-encoding) should give you hints.
2424
*/
25-
open class CodecConfig(
25+
sealed class CodecConfig(
2626
/**
2727
* The encoder mime type.
2828
*

core/src/test/java/io/github/thibaultbee/streampack/core/elements/endpoints/composites/muxers/ts/tables/PmtTest.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@
1616
package io.github.thibaultbee.streampack.core.elements.endpoints.composites.muxers.ts.tables
1717

1818
import android.media.MediaFormat
19+
import io.github.thibaultbee.streampack.core.elements.encoders.AudioCodecConfig
1920
import io.github.thibaultbee.streampack.core.elements.encoders.CodecConfig
21+
import io.github.thibaultbee.streampack.core.elements.encoders.VideoCodecConfig
2022
import io.github.thibaultbee.streampack.core.elements.endpoints.composites.muxers.ts.TSResourcesUtils
2123
import io.github.thibaultbee.streampack.core.elements.endpoints.composites.muxers.ts.data.Service
2224
import io.github.thibaultbee.streampack.core.elements.endpoints.composites.muxers.ts.data.Stream
@@ -45,10 +47,10 @@ class PmtTest {
4547
)
4648
val streams = listOf(
4749
Stream(
48-
CodecConfig(MediaFormat.MIMETYPE_VIDEO_MPEG2, 2 * 1024 * 1024),
50+
VideoCodecConfig(MediaFormat.MIMETYPE_VIDEO_MPEG2, 2 * 1024 * 1024),
4951
256
5052
),
51-
Stream(CodecConfig(MediaFormat.MIMETYPE_AUDIO_MPEG, 2 * 1024 * 1024), 257)
53+
Stream(AudioCodecConfig(MediaFormat.MIMETYPE_AUDIO_MPEG, 2 * 1024 * 1024), 257)
5254
)
5355
Pmt(listener, service, streams, 0x1000).run {
5456
write()

0 commit comments

Comments
 (0)