Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial playback capability testing #3062

Merged

Conversation

nielsvanvelzen
Copy link
Member

Changes

This PR adds a few things:

  • Media information in MediaStream (container/tracks)
    • This only contains container/audio tracks right now with the others coming later (0.17)
    • The data model is far from finished
  • Add supportsStream function to backend
    • This uses the media information to query the backend for playback support
    • Currently implemented for ExoPlayer audio testing only
  • Test is a given stream is supported and warn to the logs if it is not
    • Future PR (0.16 release blocker) will add the behavior to fallback to remux/transcode when a stream is not supported

Some future changes that are likely to happen:

  • Add MediaInfo class to contain the container/tracks and use that for the supportsStream function instead of a full MediaStream instance. This way we can query the backend before building the stream URL etc.
  • Add video/subtitle tracks
  • Add more properties/info to container/audio track
  • Extend codec->mime mapping
  • Move codec->mime mapping to core (could be useful for other backends)

Issues

Important part of #1057

@nielsvanvelzen nielsvanvelzen added enhancement New feature or request playback Issue related to media playback labels Sep 21, 2023
@nielsvanvelzen nielsvanvelzen added this to the v0.16.0 milestone Sep 21, 2023
val sampleRate: Int,
) : MediaStreamTrack

// TODO: Add Video/Subtitle tracks

Check warning

Code scanning / detekt

Flags a forbidden comment.

Forbidden TODO todo marker in comment, please do the changes.
"vobsub" to MimeTypes.APPLICATION_VOBSUB,
"wav" to MimeTypes.AUDIO_WAV,
"webm" to MimeTypes.APPLICATION_WEBM,
// TODO: Find mime types for all these formats...

Check warning

Code scanning / detekt

Flags a forbidden comment.

Forbidden TODO todo marker in comment, please do the changes.
"pcm_mulaw" to MimeTypes.AUDIO_MLAW,
"truehd" to MimeTypes.AUDIO_TRUEHD,
"vorbis" to MimeTypes.AUDIO_VORBIS,
// TODO: Find mime types for all these codecs...

Check warning

Code scanning / detekt

Flags a forbidden comment.

Forbidden TODO todo marker in comment, please do the changes.
else -> null
}

private fun hardwareAccelerationFromFlags(flags: Int) = when (RendererCapabilities.getHardwareAccelerationSupport(flags)) {

Check warning

Code scanning / detekt

Line detected, which is longer than the defined maximum line length in the code style.

Line detected, which is longer than the defined maximum line length in the code style.
)

// TODO Implement Video track type
private fun getVideooTrack(stream: MediaStream) = null

Check warning

Code scanning / detekt

A function that only returns a constant is misleading. Consider declaring a constant instead.

getVideooTrack is returning a constant. Prefer declaring a constant instead.
private fun getVideooTrack(stream: MediaStream) = null

// TODO Implement Subtitle track type
private fun getSubtitleTrack(stream: MediaStream) = null

Check warning

Code scanning / detekt

A function that only returns a constant is misleading. Consider declaring a constant instead.

getSubtitleTrack is returning a constant. Prefer declaring a constant instead.
)

// TODO Implement Video track type
private fun getVideooTrack(stream: MediaStream) = null

Check warning

Code scanning / detekt

Function parameter is unused and should be removed.

Function parameter `stream` is unused.
private fun getVideooTrack(stream: MediaStream) = null

// TODO Implement Subtitle track type
private fun getSubtitleTrack(stream: MediaStream) = null

Check warning

Code scanning / detekt

Function parameter is unused and should be removed.

Function parameter `stream` is unused.
@nielsvanvelzen nielsvanvelzen marked this pull request as ready for review September 21, 2023 12:56
Copy link
Member

@crobibero crobibero left a comment

Choose a reason for hiding this comment

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

mapping will be ..fun to populate

@nielsvanvelzen nielsvanvelzen merged commit bfecd1c into jellyfin:master Sep 21, 2023
@nielsvanvelzen nielsvanvelzen deleted the playback-capability-test branch September 21, 2023 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request playback Issue related to media playback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants