-
Notifications
You must be signed in to change notification settings - Fork 139
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
Convert VideoCodecParameters.extra_data to vector #323
base: dev-0.6
Are you sure you want to change the base?
Conversation
55b27cc
to
e44943f
Compare
added mkv dolby vision configuration extra data parsing |
e44943f
to
f75a276
Compare
fixed mkv dovi parsing with two BlockAdditionMapping elements, |
Did a quick skim of this and everything seems very reasonable to me!
That's fine. I generally like immutable variables, but past a few it can become messy and writing into a mutable struct is cleaner. Further thought: Do you think the builder methods should just be removed in general on the codec parameters structs? I believe a proper builder pattern would actually use a separate object all together.
I'm not attached to |
5474b40
to
b5a3ae9
Compare
I think the existing methods in the core codec parameters should be removed if we agree to adopt the struct initialization pattern. While a proper builder pattern does require a separate object, I’m not sure if you want to introduce the builder pattern in the library due to the potential runtime overhead.
Ok, let's try pattern alignment ;-). I've added two commits for your high-level review. These might be too many changes and potentially go against the contribution policy or introduce regressions, so feel free to reject them. I can then try to follow more closely to the existing code patterns in MP4. Anyway, here are my reasons for the changes:
This PR lacks the following:
Please propose trait names if you liked the idea and want them now, or this can be done later. |
Forgot to mention that AudioSampleEntry.sample_rate was changed from f64 to u32. It is u32 in AudioCodecParameters, so not sure why it was created as f64. |
Hi, thanks for your work! Hopefully responding to everything below:
It doesn't seem particularly worth it to have a separate builder. I recall the builder was introduced to force the user to set an This pattern seems reasonable: let params: VideoCodecParameters = Default::default();
params.codec = // CODEC_ID_ ...
// ...etc...
I'm not quite sure why
I like how this makes a solid distinction between what is read from the media source, and how we represent that in Symphonia. 👍 If the sample entry structs were intended to be the format-model object, then you can likely disregard my last comment. However, then the In this distinction it would make sense for the format-model objects to store their fields in the data type that most closely matched the data type in the file. That would help debugging, and adds value to what could be a lot of duplication. Then, the conversion would occur when converting into the generic-model.
Why would we need a trait for this? Is there value in it?
We might be able to cross some of these off based on the discussion on the points above.
This should now be answered above! On an administrative note, I think this entire PR can be reorganized. You can really squash everything down into 4 commits:
Also, let's not increase the scope of this PR any further than what we've discussed here so far. It is already going to be on the bigger side! Once we've reached a conclusion on all the points above, you can polish this PR off and I can then review and merge. |
Thanks for review.
I will not add more cleanups in this PR. Will make a separate PR.
Agree, I just observed that in some places it is read as u32, I will change it back to f64.
I hope that it might remove some boiler plate code and encourage further formats to follow the common pattern of conversion. I haven't tried it to see if it really worth the benefits. But I agree not to introduce them now.
This might make some commits to be non-buildable. I'm not sure this is a good, but if you insist I can do it. |
b5a3ae9
to
761d505
Compare
should be ready for detailed review now. Thanks for f64 note, the way I changed it to u32 was not correct. |
761d505
to
92a3459
Compare
Ah true, I guess you would have to make changes to adapt to I'll try to review this thoroughly in the next couple of days! |
92a3459
to
466109c
Compare
rebased, kept Dolby Vision changes commits separate from the refactoring commits. |
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 again. This all looks very clean to me. I have noted a couple nit-picks for your consideration, and one potential hazard.
For testing, I generally use my media library. Unfortunately, since it's copyrighted, I can't share it. However, here's what I generally test:
- AAC, ALAC, FLAC, PCM in MP4
- Test by passing file path to
symphonia-play
, but also by piping in viacat
.
- Test by passing file path to
- Movies
- Audio tracks should be playable. Other tracks detected.
- Fragmented MP4
- These should also work when played by file path, or piped in.
- Easiest way to get a fragmented MP4 is from YouTube using
yt-dlp
. Pass-f 140 --fixup never
to get a fragmented AAC audio file.
If these tests pass, it's generally good enough for me to merge.
When it comes to cutting a release, I run my entire library through symphonia-check
and make sure there haven't been any regressions since the last release.
466109c
to
168dbde
Compare
it is based on constants renaming commit from PR #322
This PR is to get early feedback, mkv changes are not finished, I will add another commit later
Notes: