Libvlc4 api update#434
Open
mfkl wants to merge 10 commits into
Open
Conversation
Wrap the new libvlc_parser_t (MediaParser) with Task-based parse/thumbnail helpers that replace the removed libvlc_media_parse_*/thumbnail_request_* entry points, and update the Picture/PictureList bindings used to return generated thumbnails.
…VLC 4 Adjust the marshaled structures for LibVLC 4: media track gains the I1-marshaled id_stable/selected bool fields, ModuleDescription.HelpHtml, the OutputCallbacks union, and the microsecond TimePoint/MediaPosition time base. Add the shared MarshalUtils.NewCompletionSource helper and minor marshaling/core tweaks.
Dialog callbacks gain the version field and split error callback with get/set context. MediaDiscoverer switches release to destroy and marshals is_running as I1; both discoverers are adjusted for the LibVLC 4 API.
Reroute Media.ParseAsync/GenerateThumbnailAsync through the new parser, add IsParsed and mark ParsedStatus/ParseStop obsolete, and update durations to the microsecond time base. Adapt the Media and MediaList wrappers to the LibVLC 4 API and expose the hooks the managed event dispatchers bridge onto.
Update MediaPlayer for the LibVLC 4 API: microsecond SeekTo/time, the track list/selection entry points with I1-marshaled bool params, PlayAsync(Media), and async helpers routed through the shared completion-source factory. Harden LibVLC/MediaPlayer disposal against double-dispose and unset-without-set.
LibVLC 4 removed libvlc_event_attach/detach and the per-object event managers. Event delivery now flows through versioned libvlc_*_cbs callback structs passed at construction: EventManager becomes a managed-only dispatcher (Register/Unregister/FromOpaque) and MediaPlayer, RendererDiscoverer and MediaDiscoverer build one shared native cbs struct with a per-instance opaque. Media and MediaList no longer have a native event source, so their existing public event APIs are re-surfaced by bridging from the media player callbacks (parsed/meta/subitems/attachments) and by synthesizing media-list add/remove events from the managed wrapper mutations. This commit completes the build started by the bindings migration.
Add NativeBindingAssertions and rework LibVLCAPICoverage to assert, by type, that the LibVLC 4 entry points and versioned callback structs are bound and that removed LibVLC 3 APIs are no longer exposed. Add MediaParserTests for the new parser bindings and bump the native VideoLAN.LibVLC.Windows test package to a LibVLC 4 build.
Drive the playback tests through PlayAsync/StopAsync with bounded polling for tracks, seekable and selection state instead of fixed delays, and use dummy aout/vout so they no longer depend on a working audio device. TrackDescription pauses right after playback starts so the short sample does not reach EOF before selection is queried, and the discoverer test waits for the stop to complete. Dispose the LibVLC instance per test and share StopWithTimeout / NewCompletionSource from BaseSetup.
Route the attached-thumbnails picture test through the new MediaParser API, make the error-dialog test resilient with a bounded wait and contains-based assertions, and update the event/renderer discoverer tests for the LibVLC 4 event flow.
A minimal console sample that generates a thumbnail from a media file using the new LibVLC 4 parser/thumbnail API (Media.GenerateThumbnailAsync).
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.
No description provided.