Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the commit! We have some details hope to be confirmed:
Is 10 the channel count of the compressed DD+JOC stream or the decoded stream? The reason why we are asking is similar to the discussion in another pull request. At track selection, we will check if the audio can be spatialized and then select that track if possible. If 10 is the channel count of the compressed DD+JOC stream, then we will call
spatializer.canBeSpatialized()againstCHANNEL_OUT_5POINT1POINT4. But if the decoder outputs a different channel count that the spatializer cannot spatialize, the user won't be able to hear the spatial audio.Could you please test this change on the device on Android 12L+? ExoPlayer didn't set the key
MediaFormat.KEY_MAX_OUTPUT_CHANNEL_COUNTuntil the API level 32, and according to the previous discussion, the DD+JOC decoder will output 2.0ch PCM in this case.Just curious, do you know if there is any compressed streams coming with
CHANNEL_OUT_7POINT1POINT2, since by making this change, we will assume that 10-channel is always mapped to 5.1.4.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below is my response to your questions:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @sqshet for the response!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And before I proceed with internal review of this pull request, I have one more question -
What is channel count for the original compressed stream? My concern on the other hand is that if the original channel count is different than 10, for example some other number that falls to
AudioFormat.CHANNEL_INVALIDmask during the track selection, thenSpatializer.canBeSpatialized()can return false with that invalid channel mask (even if the device is actually supports spatialization), then track selector will try to select an alternative track instead of DD+JOC track.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tianyif ,
The input channel count refers to the number of audio objects in the input stream whereas the output channel count maps to canonical channel masks up to 12 channels. As long as canonical channel mask up to 12 channels are supported, it should be OK.
The canonical channel mask what we wanted to add here is for the 10 channels (i.e, 5.1.4).
Thanks