summaryrefslogtreecommitdiffstats
path: root/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegstreamdecoder_p.h
diff options
context:
space:
mode:
authorArtem Dyomin <artem.dyomin@qt.io>2023-03-30 18:54:44 +0200
committerArtem Dyomin <artem.dyomin@qt.io>2023-04-12 13:20:49 +0200
commit57ebebae16d9b4d984709541a1b37e711f48b14d (patch)
tree8f9f66cf7af6cb6c6284fc0234d2fe51210d4c22 /src/plugins/multimedia/ffmpeg/playbackengine/qffmpegstreamdecoder_p.h
parentbfae176fd3297089fb723cd1555b1ac981fed15a (diff)
Implement seamless ffmpeg playback looping
Users need seamless looping, in other words, looping without little delays on jumping from the media end to the start. The only way to make it seamles and smooth is to intrude into the playback engine. As result, we have just a regular delay between frames on shifting. Also, a bunch of adjuscent small improvements have been introduced: - simplify criteria of the demuxer's buffer size, it was more complex and a bit not relevant before. Actually, we need to check only max buffering time. - Improve handling of media with streams of different length. - Fix setting of the playback rate before opening sources. - Add new auto tests for looping. - Add debug logs. Pick-to: 6.5 Task-number: QTBUG-112305 Change-Id: Ic9073d77535f5aae19f9ea48d4e745c9f2fa9ea3 Reviewed-by: Lars Knoll <lars@knoll.priv.no>
Diffstat (limited to 'src/plugins/multimedia/ffmpeg/playbackengine/qffmpegstreamdecoder_p.h')
-rw-r--r--src/plugins/multimedia/ffmpeg/playbackengine/qffmpegstreamdecoder_p.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegstreamdecoder_p.h b/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegstreamdecoder_p.h
index cc12b1e9a..001ec6b90 100644
--- a/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegstreamdecoder_p.h
+++ b/src/plugins/multimedia/ffmpeg/playbackengine/qffmpegstreamdecoder_p.h
@@ -16,6 +16,7 @@
#include "playbackengine/qffmpegplaybackengineobject_p.h"
#include "playbackengine/qffmpegframe_p.h"
#include "playbackengine/qffmpegpacket_p.h"
+#include "playbackengine/qffmpegpositionwithoffset_p.h"
#include "private/qplatformmediaplayer_p.h"
#include <optional>
@@ -28,7 +29,7 @@ class StreamDecoder : public PlaybackEngineObject
{
Q_OBJECT
public:
- StreamDecoder(const Codec &codec, qint64 seekPos);
+ StreamDecoder(const Codec &codec, qint64 absSeekPos);
~StreamDecoder();
@@ -64,11 +65,13 @@ private:
private:
Codec m_codec;
- qint64 m_seekPos = 0;
+ const qint64 m_absSeekPos = 0;
const QPlatformMediaPlayer::TrackType m_trackType;
qint32 m_pendingFramesCount = 0;
+ LoopOffset m_offset;
+
QQueue<Packet> m_packets;
};