check: refactored to add check-mode (info, audio). Info mode compares format structure #333
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.
Refactored symphonia-check to have different run modes: audio, info, ...
It's a draft PR to receive feedback.
High level overview of changes:
The audio check functionality was moved with minimal changes. Error handling and messages were adjusted to consistently prefix errors with "FAIL:" when something goes wrong.
The info check mode runs mediainfo, producing JSON output (added serde and json dependencies). This JSON output is converted to FormatReader, which is then compared against Symphonia's FormatReader data.
Implemented a basic comparison for FormatReader data: Generic Format, Track Format, and Track ID/count.
A command must now be specified (audio or info), followed by the respective parameters for that command. Updated to the latest version of clap using declarative objects. It is currently not possible to make the audio command the default because clap would interpret parameters as commands, this is a limitation of the library.
Observations:
From<FourCc>
, which might falsely imply that you can create a VideoCodecId from a FourCc and retrieve it later. Implementing a generic passthrough for unknown codecs in symphonia-check not easy because the existing VideoCodecId values (from well_known) do not correspond to valid FourCc values. There is no straightforward way to pass unsupported codec IDs from the demuxer through FormatReader. Adding a placeholder string to pass through what was found, alongside CODEC_ID_NULL_VIDEO, would be beneficial.Tags and menu chapters provide additional information and should not block playback when invalid.
Todo: (to be addressed in separate PRs)
pos
andsize
fields to the Packet struct to support better video checks.