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 STREAMDEMUXER_H
0009 #define STREAMDEMUXER_H
0010 
0011 #include <QThread>
0012 
0013 namespace SubtitleComposer {
0014 class VideoState;
0015 class FFPlayer;
0016 
0017 class StreamDemuxer : public QThread
0018 {
0019     Q_OBJECT
0020 
0021 public:
0022     static VideoState * open(const char *filename);
0023     static void close(VideoState *vs);
0024     void pauseToggle();
0025     void seek(qint64 time);
0026     void stepFrame();
0027     bool abortRequested();
0028     int relativeStreamIndex(int codecType, int absoluteIndex);
0029     int absoluteStreamIndex(int codecType, int relativeIndex);
0030     void selectStream(int codecType, int streamIndex);
0031 
0032 private:
0033     StreamDemuxer(VideoState *vs, QObject *parent = nullptr);
0034 
0035     VideoState *m_vs;
0036 
0037     void run() override;
0038 
0039     int componentOpen(int streamIndex);
0040     void componentClose(int streamIndex);
0041     void cycleStream(int codecType);
0042 };
0043 }
0044 
0045 #endif // STREAMDEMUXER_H