Skip to content

Add support for custom Mpeg2TsService in SRT streaming#1801

Merged
pedroSG94 merged 2 commits intopedroSG94:masterfrom
8thgencore:master
Apr 17, 2025
Merged

Add support for custom Mpeg2TsService in SRT streaming#1801
pedroSG94 merged 2 commits intopedroSG94:masterfrom
8thgencore:master

Conversation

@8thgencore
Copy link
Copy Markdown
Contributor

Description

This PR adds the ability to set a custom Mpeg2TsService with user-defined parameters for SRT streaming.

Changes

  • Modified SrtSender to accept a custom Mpeg2TsService instead of always using the default one
  • Added method in SrtClient to expose this functionality to higher levels
  • Added method in SrtStream to make it accessible at the application level
  • Added proper handling for streaming state and service reset

Usage example

// Create custom service
val customService = Mpeg2TsService(
    type = 0x01, // Digital TV or custom type
    id = 0x1234, // Custom service ID
    name = "MyCustomService", // Custom service name
    providerName = "MyProvider" // Custom provider name
)

// Set it before streaming starts
srtStream.setMpeg2TsService(customService)

Benefits

  • Allows customization of MPEG-TS service parameters
  • Provides more flexibility for integration with custom broadcasting systems
  • Enables customized service identification in the transport stream

@pedroSG94
Copy link
Copy Markdown
Owner

Hello,

Thank you for the PR.
All the code is fine but instead of set the method inside SrtStream class, it should be created inside:
https://github.com/pedroSG94/RootEncoder/blob/master/library/src/main/java/com/pedro/library/util/streamclient/SrtStreamClient.kt
This way you can use it with this code:

srtStream.getStreamClient().setMpeg2TsService(customService)

… SrtStream and add it to SrtStreamClient for better service management
@8thgencore
Copy link
Copy Markdown
Contributor Author

I fixed the code and sent a new commit.

@pedroSG94 pedroSG94 merged commit 771ca2b into pedroSG94:master Apr 17, 2025
1 check passed
@pedroSG94
Copy link
Copy Markdown
Owner

Ok, all is correct now. Merged
Thank you for the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants