-
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 tunneling in ExoPlayer #1688
Comments
We looked into this a while back but found little performance difference between tunneling and normal playback on devices we tested. I think the primary claimed benefits at the time were around improved audio/video synchronization and allowing OEMs to customize decoding and rendering. We also found some device-specific bugs with stability and seeking, though these are likely fixed now. Could you give some examples of devices where this feature is needed to play 4k streams? If there is sufficient demand may be able to prioritize it. Thanks! |
This is a first step toward supporting tunneled playback Issue: google#1688 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=141167501
Is the support for this feature under progress? I can see that the following recent changes in dev-v2: e125ed7 Report tunneling support via RendererCapabilities API If so, is there a plan on when to complete the initial support? Actually, we are also adding this feature internally in our organization as we thought the official support might not meet our timeline. Basically we require this feature by end of March this year. |
At this point the renderers all have TODOs in enable(), and turning on tunneling is reduced to the problem of propagating a tunneling ID to these points. Issue: #1688 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=144619393
Yes, this is being worked on. As of the most recent commit To complete support we need to (a) check whether both audio + video renderers provide support for tunneling for the media being played, (b) generate an audio session ID for tunneling if they do (there's a static method in We hope to complete this work soon. We don't give exact time estimates. Note that if you want to add the feature internally in the meantime then you'd be best off building on the changes so far, since they do all of what's required aside from the remaining piece described above. |
Thanks for sharing the information. I rebased my changes on the latest dev-v2. I think my understanding on the changes needed is aligned with yours. Since video tunneling needs to work together with audio hw av sync, the decision to enable video tunneling needs to be done in a place where both renderers' information can be accessed. After the decision is made, one thing left is to signal the enabling of tunneling in both renderers. As you pointed out, the multiple period use case makes the signal more difficult. Our current change is here: It's complete, but I couldn't test it yet as we are still waiting for the device with video tunneling support. My guess is it's not same as what you have in mind on how to implement it. But in case you think it makes sense, you can apply it. |
My current plan is to have a track selector make the decision (since it knows about the capabilities of each renderer). The selector effectively becomes more of a binder that decides (a) which tracks to select, and (b) what the corresponding renderer configuration should be when using the selection. I'm not completely sure it's the best approach, as opposed to something directly in ExoPlayerImplInternal, but we're weighing it up internally and hope to have some news fairly soon. |
- Tunneling can be enabled by calling: trackSelector.setTunnelingAudioSessionId( C.generateAudioSessionIdV21(this)); - If enabled, tunneling is automatically used when the renderers and track selection combination support it. Tunneling is automatically turned on and off through playlists if the support changes. Issue: #1688
@ojw28, thanks for the changes and sharing the information. The current approach i.e. using track selector, seems to be more efficient to me. Looking forward to the final design. Seems this feature is almost complete, except the following change that I'm aware of: |
I'm not sure any special logic is required for skipping output buffer processing. In any case, the solution appears to work fine end-to-end as it is. |
I was referencing the CTS test case in MediaCodecTunneledPlayer.java for the usage of this feature. It suggests skipping the handling of video output buffer when tunneling is enabled. Just checked the implementation of the native library, looks like when tunneling is on, empty buffer array would be returned from MediaCodec.getOutputBuffers() and dequeueOutputBuffer() would return TRY_AGAIN. That's probably why the current MediaCodecRenderer works without changes. |
Hi there.
Is there any plans on adding tunneling support to ExoPlayer? Several Android devices (especially for Android TV) contain video decoders with tunneling support but it doesn't look like ExoPlayer attempts to take advantage of them yet. Some 4K streams are almost impossible to play properly without video tunneling.
thks,
L
The text was updated successfully, but these errors were encountered: