-
Notifications
You must be signed in to change notification settings - Fork 6k
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
Support Renderers that don't consume tracks #3212
Comments
We've been meaning to add support back into V2 for this for a while. Marking as an enhancement. |
I take it as the approach is not all that crazy. Is there any reason to believe a custom |
I don't really understand what your approach is. What does it mean for a track selector to return a renderer? A track selector returns track selections, and (I think?) the problem in this case is that there aren't any tracks to actually select for the renderers to consume. I don't think it would work to invent some dummy tracks in the selector. You'd probably need to have your |
Sorry, maybe I was not thinking straight. The idea was to create a sort of dummy |
You would probably need to create dummy tracks in the |
So, we tried to go this route and indeed we need to do some hacks to get it right. One thing we ran into was that |
If that's the only issue, can you just have your renderer say that it's type |
Currently our Renderer is always associated with and consume data from some SampleStreams, which were constructed from the provided MediaSource. There are use-cases, in which the users want to have simple Renderer implementation that does not consume data from SampleStream at all, but render using their custom logic at each rendering position - they mostly just need ExoPlayer to keep track of the playback position and enable/disable the renderer. This CL adds support for such Renderer by adding a TRACK_TYPE_NONE. Renderer of such type will be: - Associated with null TrackSelection as the result of track-selection operation. - Associated with EmptySampleStream. GitHub: #3212 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=168545749
We've added support for this in |
Previously with ExoPlayer 1 we were using two custom
Renderers
. One for showing debug information overlaid on top of the surface and another one to periodically report back to a listener when 15s of media was played. Both of them, well at least the latter, not really aRenderer
per se but it felt pretty clean, we didn't need to periodically poll the position and we didn't need to manage any additional threads.With ExoPlayer 2 we run into some difficulties trying to maintain this approach. There are no
Formats
in theMediaPeriod
associated with theseRenderers
so they are not returned byDefaultTrackSelector
. I suppose we could implement our ownDefaultTrackSelector
and return these twoRenderers
when needed but this leads me to the question whether or not this is a bad approach? Sure, we could go the same approach asDebugTextViewHelper
for our first use case even though I prefer to view it as aRenderer
and handle it accordingly. But what about the other use case of reporting back whenever (roughly) 15s of media has been played. What would be your recommended way of dealing with that?Thoughts and comments much appreciated.
The text was updated successfully, but these errors were encountered: