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

Allow registration of custom codecs in MimeTypes class #4264

Closed
robin2046 opened this issue May 17, 2018 · 3 comments
Closed

Allow registration of custom codecs in MimeTypes class #4264

robin2046 opened this issue May 17, 2018 · 3 comments

Comments

@robin2046
Copy link

robin2046 commented May 17, 2018

When I am trying to adding new codec, I have to copy all the source code of mp4/ts extractor just to modify a bit of it.
And what is more, since I cannot modify MimeTypes class, I have to fork ExoPlayer instead of just have a simple dependency on it as a library.

So, is it possible to have extension hooks in extractors and functions like MimeTypes.getMediaMimeType() to ease this pain in future?

@robin2046 robin2046 changed the title Is it possible to add hook to extending extractors? Is it possible to add hook for extending extractors? May 17, 2018
@andrewlewis andrewlewis self-assigned this May 17, 2018
@andrewlewis
Copy link
Collaborator

Is this for a standard/widely used format, or is it for a custom codec? If it's the former, we can probably just add support, or feel free to send a PR and we'll take a look. If it's the latter, this seems like a very specialized use case and I'm not sure we can justify the work and extra complexity to make every extractor extensible for this.

Could you elaborate on what customizations you needed to make in MimeTypes? Is it related to handling of codecs strings?

@robin2046
Copy link
Author

Thanks for your reply. I can copy and modify the mp4/ts extractor to add my extension. It is acceptable since I am adding unofficial modification to those famous containers.

However, methods like getMediaMimeType() and getAudioMediaMimeType() is widely used in other modules like HLS/SS/DASH, which I don't want to copy and modify them just for adding a new MIME type string.

My intention is just to support some new codec, which is not published yet. The container is still mp4/ts and can be streamed by HLS/SS/DASH. In order to easily keep the track of exoplayer updates, I want to just use it as a library instead of fork my own branch.

Thanks again for the comment.

@ojw28
Copy link
Contributor

ojw28 commented May 29, 2018

We could probably look at adding some static methods to MimeTypes to allow injection of custom codec information?

@ojw28 ojw28 changed the title Is it possible to add hook for extending extractors? Allow registration of custom codecs in MimeTypes class May 29, 2018
ojw28 pushed a commit that referenced this issue Jun 18, 2018
Also add a few missing MP4 object types.

Issue: #4264

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199778373
ojw28 pushed a commit that referenced this issue Jun 18, 2018
Also add a few missing MP4 object types.

Issue: #4264

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=199778373
@ojw28 ojw28 closed this as completed Jun 18, 2018
@google google locked and limited conversation to collaborators Nov 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants