Copilot/add codec details to paths api #5307
Open
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 pull request updates the API and internal data structures to provide detailed codec information for each track in a path, replacing the previous approach of representing tracks as simple strings. The changes affect the OpenAPI schema, Go structs, serialization, and related tests, enabling clients to access richer metadata for video and audio tracks.
API and Schema Changes
PathTrackschema toapi/openapi.yamlthat includes detailed fields for codec type, video dimensions, frame rate, profiles, levels, and audio properties. Thetracksproperty in thePathschema is now an array ofPathTrackobjects instead of strings. [1] [2]Go Struct and Serialization Updates
APIPathTrackstruct ininternal/defs/api.gowith fields for codec, video, and audio details. Updated theAPIPathstruct and all relevant usages to use[]APIPathTrackinstead of[]stringfor tracks.internal/core/path.goand related test mocks to populate detailed track info using the newMediasToTracksandFormatsToTracksfunctions. [1] [2]Track Information Extraction
internal/defs/source.go. These functions parse codec parameters and buildAPIPathTrackobjects with appropriate fields. [1] [2]Test Updates
APIPathTrackstruct for tracks, ensuring correct serialization and deserialization of detailed track info. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11]Unit Tests for Track Extraction
internal/defs/source_test.go, covering all supported codecs and validating correct population of metadata fields.