Repository navigation
refactor(decoder): DecoderService in a worker thread - #77
Merged
Merged
Conversation
Introduce DecoderService, a QObject living in a QThread that owns the single FFmpegDecoder. MainWindow now opens, seeks and decodes through blocking invokes and caches the stream metadata (timestamps, frame rate, duration, seek stats) instead of touching the decoder directly. Behaviour is unchanged for now: calls are still synchronous from the GUI. This is the foundation for asynchronous seeking, preview frames, moving the frame cache into the service, and eventually the playback/audio loop (refs #70, #9).
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.
Summary
Foundation for #70/#9: the single
FFmpegDecodernow lives in a worker thread behindDecoderService.DecoderService(QObject moved to aQThread) owns the decoder and exposesOpen,Close,Seek,DecodeNextviaQVariantMapresults.MainWindowno longer holds or callsFFmpegDecoderdirectly; it builds the raw IDR index, passes it toOpen, and cacheshas_timestamps, frame rate, duration and the last seek stats.MainWindowfor this PR.Behaviour
Unchanged: calls are still blocking (
BlockingQueuedConnection), so the GUI waits for decodes exactly as before. The value is that decoder ownership is now single and off the GUI thread, so the next PR can makeSeek/DecodeNextasynchronous and add preview signals without moving code again.Verification
ctest: 75/75 pass (GUI/decoder behaviour unchanged).grep player_decoder_: no direct usage left inMainWindow../test/tools/tidy.sh decoderservice.cpp decoderservice.h mainwindow.cpp mainwindow.h: 0 issues.Next
RequestSeek(frame, generation)+PreviewReady/FrameReadysignals.FrameCacheinto the service.Refs #70, #9