File indexing completed on 2024-06-16 04:38:30

0001 /*
0002     SPDX-FileCopyrightText: 2003 Fabrice Bellard
0003     SPDX-FileCopyrightText: 2020-2022 Mladen Milinkovic <max@smoothware.net>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #ifndef RENDERTHREAD_H
0009 #define RENDERTHREAD_H
0010 
0011 #include <QThread>
0012 
0013 struct SwsContext;
0014 struct AVFrame;
0015 struct AVPixFmtDescriptor;
0016 
0017 namespace SubtitleComposer {
0018 class VideoState;
0019 struct Frame;
0020 
0021 class RenderThread : public QThread
0022 {
0023     Q_OBJECT
0024 
0025     friend class AudioDecoder;
0026 
0027 public:
0028     explicit RenderThread(VideoState *state, QObject *parent = nullptr);
0029 
0030     void run() override;
0031 
0032 private:
0033     void videoRefresh(double *remainingTime);
0034     void videoDisplay();
0035     double vpDuration(Frame *vp, Frame *nextvp);
0036     void updateVideoPts(double pts, int64_t pos, int serial);
0037     double computeTargetDelay(double delay);
0038     void updateSampleDisplay(short *samples, int samplesSize);
0039     void toggleAudioDisplay();
0040     void videoImageDisplay();
0041     void videoAudioDisplay();
0042 
0043 private:
0044     VideoState *m_vs;
0045     bool m_isYUV;
0046     bool m_isPlanar;
0047 };
0048 }
0049 
0050 #endif // RENDERTHREAD_H