Skip to content

Conversation

Profpatsch
Copy link
Contributor

@Profpatsch Profpatsch commented Dec 22, 2024

Instead of pushing the media.ccc recordings straight into the StreamExtractor straightjacket (which does not really provide the correct API for handling the semantics of the media.ccc data), we parse into an intermediate structure first that contains all relevant information about the different streams.

This is required for correct handling of the different languages.

It should not change the API, since its specfic to the media.ccc Extractor. I just type-cast in frankenplayer at the moment.
I skipped adding getters/setters in the MediaCCCRecording structs, once this repository is migrated to Kotlin (?), it would just be a data class.

  • I carefully read the contribution guidelines and agree to them.
  • I have tested the API against NewPipe.
  • I agree to create a pull request for NewPipe as soon as possible to make it compatible with the changed API.

Instead of pushing the `media.ccc` recordings straight into the
StreamExtractor straightjacket (which does not really provide the
correct API for handling the semantics of the media.ccc data), we
parse into an intermediate structure first that contains all relevant
information about the different streams.

This is required for correct handling of the different languages.
@ShareASmile ShareASmile added media.ccc.de service, https://media.ccc.de enhancement New feature or request labels Dec 23, 2024
Copy link
Member

@Stypox Stypox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the late review, I think this PR is well organized. Thanks!
Btw, please do not forget to fill in or dismiss the checkboxes in the PR description.

Comment on lines +143 to +147
.flatMap(r ->
r instanceof MediaCCCRecording.Video
? Stream.of((MediaCCCRecording.Video) r)
: Stream.empty()
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(also in other places)

Suggested change
.flatMap(r ->
r instanceof MediaCCCRecording.Video
? Stream.of((MediaCCCRecording.Video) r)
: Stream.empty()
)
.filter(MediaCCCRecording.Video::isInstance)
.map(MediaCCCRecording.Video::cast)

MAIN,
/** A side-recording of a talk/event that has the slides full-screen.
* Usually if there is a slide-recording there is a MAIN recording as well */
SLIDES
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably we should add something like this but for videos, to distinguish between the main and secondary types

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I’d go for “as small an enum here as possible” and then convert on the NewPipe side to the enum that NewPlayer expects. I’d slowly expand these as I find new edge-cases in the mediaCCC APIs (they add new kinds of features every year or so, usually with backwards compat in mind).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but it's something that should be exposed at the extractor-level APIs, not be specific for every service. This way it would be easy in clients to add a switch that allows choosing the video track type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, maybe, once we figured out which parts are specific to media.ccc.de and which ones can be abstracted :)

I think a major issue with NPE is that it’s trying to unify the services too much, and then we get lots of workarounds on the NewPipe side cause we have to reconstruct specific service behaviour again that was unified on the NPE side. I’d rather cast on the class and then have some service-specific functionality available if I need it in the player.

@Stypox
Copy link
Member

Stypox commented Oct 2, 2025

I would be ok with merging this as-is (after you fix my other comment), since it's not adding any new functionality for now but just adds the ability to load all recordings. Going forward, I believe it's important to make the API general (especially when it comes to just classifying the type of audio/video, be it slides, normal video, voiceover, etc.), but to also allow subclasses with service-specific information as suggested by Audric in #858 (comment) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request media.ccc.de service, https://media.ccc.de
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants