Added options for codecs, filters and formats#72
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds comprehensive FFmpeg AVOption API bindings to enable runtime inspection and configuration of codecs, filters, and formats. The implementation exposes options metadata through JSON APIs, making it possible for clients to discover and configure available options dynamically.
Key changes:
- New AVOption API bindings in
sys/ffmpeg80/avutil_opt.gowith get/set functions for all FFmpeg option types (string, int, double, rational, pixel format, etc.) - Added
PrivClass()methods to AVCodec, AVFilter, AVInputFormat, and AVOutputFormat to expose their option classes - Extended Codec, Filter, and Format schema types to include options lists in JSON responses
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| sys/ffmpeg80/avutil_opt.go | Implements comprehensive AVOption API bindings including getters, setters, iteration, serialization, and JSON marshaling for option metadata |
| sys/ffmpeg80/avutil_opt_test.go | Adds 23 test functions covering all AVOption API operations (set/get for various types, iteration, serialization, JSON output) |
| sys/ffmpeg80/avcodec_codec.go | Adds IsEncoder(), IsDecoder(), and PrivClass() methods; extends JSON output to include encoder/decoder flags |
| sys/ffmpeg80/avfilter_filter.go | Adds PrivClass() method to expose filter options class |
| sys/ffmpeg80/avformat_input.go | Adds PrivClass() method to expose input format options class |
| sys/ffmpeg80/avformat_output.go | Adds PrivClass() method to expose output format options class |
| pkg/ffmpeg/schema/codec.go | Extends Codec type with Opts field and custom JSON marshaling; adds help tags to request struct |
| pkg/ffmpeg/schema/filter.go | Extends Filter type with Opts field and custom JSON marshaling; adds help tag to request struct |
| pkg/ffmpeg/schema/format.go | Extends Format type with Opts field populated using FAKE_OBJ trick; adds help tags to request struct |
| pkg/ffmpeg/task/url.go | Modifies OpenReader and OpenReaderFromURL to accept variadic extra options, maintaining backward compatibility |
| pkg/ffmpeg/task/probe.go | Updates probe task to pass input options through to OpenReaderFromURL |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment Thanks for integrating Codecov - We've got you covered ☂️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This PR adds comprehensive FFmpeg AVOption API bindings to enable runtime inspection and configuration of codecs, filters, and formats. The implementation exposes options metadata through JSON APIs, making it possible for clients to discover and configure available options dynamically.
Key changes: