Exoplayer: Tunneling: Support selection of non-primary tunneling video codecs

Created on 26 Jul 2017  路  5Comments  路  Source: google/ExoPlayer

I'm trying to enable tunneling on an Android Tv device.

As i know enabling it should be just setting the audio session id with: trackSelector.setTunnelingAudioSessionId(C.generateAudioSessionIdV21(this));
but unfortunately, it won't start the tunneling just by setting this id in this device.

I can find the video_decoder.tunnel.secure decoder when debugging the MediaCodecUtil class. But when requesting the info at: mediacodec.MediaCodecUtil#getDecoderInfo it always returns the first item/decoder from the list which in my case will be video_decoder.secure (not the tunneling one, because it is on the index 1 in the list).

If I force it to use the tunneled one the playback starts.

Is it possible to improve Exoplayer algorithm to select the codec and go through the list of codecs until it finds a codec that supports tunneling instead of supposing that the first one supports tunneling?

The codec that supports tunneling has this tag on the media_codecs.xml file
<Feature name="tunneled-playback" required="true" />

Thanks!

Exoplayer version: 2.2.0
Android version: 7.0

bug

Most helpful comment

Any updates here? It effects a lot of internal projects to switch from ExoPlayer, or use customized version. Thanks.

All 5 comments

As a workaround, you can implement a custom MediaCodecSelector that picks the codec you want to use and pass that to the video renderer's constructor.

Please could you attach the media_codecs.xml file so we can take a look? I think normally the tunneling codec is most preferred (and the MediaCodec list should be sorted with the best decoder first). We might want to follow up with the OEM if the order is wrong, so a bug report would also be useful. Thanks!

Here you have the media_codecs.xml

We are trying to play secure avc, so you can see that there are 2 different codecs that support it. Only the second one supports tunneling.

That's the order required by the OEM because it seems that the tunneled codec don't support non tinneling playback. Then if they move it to the first position, the apps that don't use tunneling are not going to work
media_codecs.zip

Marking as a bug as it's allowed for decoders to support only tunneled playback.

Any updates here? It effects a lot of internal projects to switch from ExoPlayer, or use customized version. Thanks.

We're hoping to push a fix over the next few weeks.

Was this page helpful?
0 / 5 - 0 ratings