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 AC-4 Level-4 ISO base media file format support #1265

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

ybai001
Copy link
Contributor

@ybai001 ybai001 commented Apr 11, 2024

This pull request is same as #875. Since 875 is broken due to too many commit numbers, I re-created this new one.

========================

AC-4 Level-4 (Object Based Audio) is a Dolby official audio stream type for Atmos Music. This code update enables Android Media3 support local MP4 and MPEG-DASH AC-4 Level-4 playback.

// Using first presentation (default presentation) channel count
int presentationIndex = 0;
Ac4Presentation ac4Presentation =
Objects.requireNonNull(ac4Presentations.get(presentationIndex));
Copy link
Contributor

Choose a reason for hiding this comment

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

@ybai001,

Why are we looping over all presentationIndex above and storing it in a Map when all we require is the ac4Presentation for the index 0?

Is it to verify if the file doesn't have bad data? Even in that case storing it in a Map seems an overkill, when we don't intend to use the map for anything else but index 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rohitjoins,
This AC4 parser implementation is similar as the one in Android Framework: https://cs.android.com/android/platform/superproject/main/+/main:frameworks/av/media/module/extractors/mp4/AC4Parser.cpp;drc=2e87c835abea90b0cf61b42dc9aa8a882f2ef5aa;l=292. It parses all the information for all presentations because there is API https://developer.android.com/reference/android/media/MediaExtractor#getAudioPresentations(int) to fetch the presentations info for appointed audio track.

Since AndroidX Media extractor doesn't support AudioPresentation, I know this loop is redundant now.

But I know Android framework MPEGExtractor was deprecated and it will be replaced by AndroidX Media extractor. Although AndroidX Media doesn't support AudioPresentation now but I believe it will support it sooner or later. That's why I use a Map to store all audio presentation info and keep this logic in my implementation.

If one audio track includes multiple audio presentations, and if application doesn't set which presentation should be played, the Dolby AC-4 decoder will decode the default presentation (the first presentation).

Copy link
Contributor

Choose a reason for hiding this comment

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

@ybai001,

I would suggest to remove any logic which will be used in the future as it can be added when required. For now we should only parse and use the first presentation.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rohitjoins , OK, I'll update the code.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@rohitjoins, I have updated the code as your suggestion.

Choose a reason for hiding this comment

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

Hi @rohitjoins ,

Do you have further updates on this CL. We have more support added for AC-4 presentations parsing for different containers that are dependent on this pull request. I am looking to create new pull requests once this pull request is reviewed and merged.

Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi, @rohitjoins,

Any update on this PR for internal review? Thanks.

Choose a reason for hiding this comment

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

Hi @rohitjoins,

Just wondering if this CL is good to go. Please let us know if you need any further clarification needed regarding the changes here.

We have few other dependent changes in the pipeline that needs to be pushed up for review once this CL gets merged.

Thanks

Copy link
Contributor

Choose a reason for hiding this comment

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

Hi @sqshet-dlb,

I’m currently making some updates to the PR, such as adding more documentation and refactoring some parts into new methods before sending it for internal review. I’ll keep you updated on the progress and aim to merge it soon.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @sqshet-dlb,

I’m currently making some updates to the PR, such as adding more documentation and refactoring some parts into new methods before sending it for internal review. I’ll keep you updated on the progress and aim to merge it soon.

Hi, @rohitjoins, as you mentioned on July 2nd,
I'll take a look and send this PR for internal review.
It's nearly 3 months. Could you help to explain why this pull request has not been sent for internal review? Could you give me a deadline? This is very important for us since it blocks several other contributions as @sqshet-dlb said.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants