summaryrefslogtreecommitdiffstats
path: root/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegplaybackengineobject_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Playback engine atomic variables cleanupArtem Dyomin2023-08-101-5/+4
| | | | | | | | | | | | | | | | | * use acquire-release memory order instead of default mem-seq. The strict sequeintial order is not needed if not having special sync requirements; the order might be a bottle-neck if widely used in many threads. In the future, it might be investigated and optimized with relaxed operations in some cases. * use QAtomic instead of std::atomic, since QAtomic has explicit convenient methods and std::atomic sets the mem-seq order by default. Pick-to: 6.5 6.6 Change-Id: Iabd9c1bc072db491e0eba7eacaf8f4ea8343cee4 Reviewed-by: Jøger Hansegård <joger.hansegard@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Minor cleanup in PlaybackEngineObjectArtem Dyomin2023-08-011-2/+8
| | | | | | | | | | | | * QTimer fwd declaration * std::unique_ptr<QTimer> instead of raw ptr * timeout slot instead of lambda * add warning, for checking on CI Pick-to: 6.6 6.5 Change-Id: Ib5954c5f0d58341d82dccd76cbf2856303077987 Reviewed-by: Pavel Dubsky <pavel.dubsky@qt.io> Reviewed-by: Artem Dyomin <artem.dyomin@qt.io>
* Filter queued events from outdated objects in mediaplayerArtem Dyomin2023-07-101-0/+6
| | | | | | | | | | | The flakiness appeared in tests, the patch fixes it. The idea is having an unique id for each playback engine object and filter some events by id. Pick-to: 6.6 6.5 Change-Id: I59dda5dabc4e5485b401463b96ec06cdb8100aad Reviewed-by: Artem Dyomin <artem.dyomin@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Code cleanup: remove old ffmpeg decoderArtem Dyomin2022-12-221-2/+2
| | | | | | | | | | | | | | What's done: - remove old decoder - namespace PlaybackEngineInternal seems to be not needed, so it's removed - some minor clean up with unique_ptr usage - logic is not changed Pick-to: 6.5 Change-Id: I5089c87ef4c424930bca96d5f2935bfd88c20f5f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars@knoll.priv.no>
* Redesign of ffmpeg decoderArtem Dyomin2022-10-171-0/+73
Main principles of the new design are described in documentation in the file qffmpegplaybackengine_p.h The idea is to make the ffmpeg playback more stable, faster, and easier for support. For this reason, a new design has been implemented. Currently, the implementation has similar interface with Decoder, so it's possible not to remove the old one while testing and aligning of the functionality. Read main principles of the new design in documentation in the file qffmpegplaybackengine_p.h Problems with the previous design (in general: not stable and hard for support). - No clear mutex-locking policy: cross-calls under mutexes potentially cause deadlocks; not all data is strictly protected by mutexes. - a lot of mutex locking causes reducing of performance - Not transparent protocol of interractions between threads. Hence, further extension and fixes are complicated. - Too weak encapsulation of internal objects - Explicit managing of queues with which might be implemented via threading event loops and slots/signals mechanizm. - Hard to unit test separate objects What has been done: - The common business logic of playing is the same as in previous impl. - Renamings and decomposition - Use QThread event loop instead of custom ones. - Don't use mutexes at all. All synchronization is based on Queued connections. - Introduce mechanizm of "soft" synchronization to avoid bumpy playing. - Decouple working objects from threads to make it more flexible. E.g., it's possible to customize usage different threads by different jobs. Tested on linux, macos, windows: - play/pause/stop - OK - seek in playing and paused states - OK - playback rate change - OK - av track change - OK - sound volume, muting - OK - playing with subtitles - OK - time synchromization (via artificial sound delays) - OK - UT tst_mediaplayerbackend using new backend: linux, windows, macos - OK To do: - Integrate the engine with AudioPlayer - Align minor details with old implementation (Decoder) and delete it - Add unit tests for PlaybackEngine and for its objects as well - Improve errors handling Task-number: QTBUG-106259 Change-Id: I05481df84be3fd5f17ec66348cb1ab1f8261775a Reviewed-by: Lars Knoll <lars@knoll.priv.no>