-
Notifications
You must be signed in to change notification settings - Fork 61
/
converter.h
35 lines (30 loc) · 897 Bytes
/
converter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#include <QDebug>
#include <QString>
#include <QThread>
#include "qsvreader.h"
#include "datamodel.h"
extern "C" {
#include "libavcodec/avcodec.h"
#include "libavformat/avformat.h"
#include "libswscale/swscale.h"
#include "libavdevice/avdevice.h"
}
int readFromSegment(void *opaque, uint8_t *buf, int buf_size);
class ConverterThread : public QThread {
Q_OBJECT
private:
int curRowIndex;
InputFileModel* curFile;
void convertAllFiles();
void convertSingleFile();
AVFormatContext* createInputContext(QsvUnpacker* unpacker);
AVFormatContext* createOutputContext(const char* outputPath, AVFormatContext* inCtx);
int copyStreams(AVFormatContext* outCtx, AVFormatContext* inCtx, QsvUnpacker* unpacker);
public:
ConverterThread(QObject* parent = nullptr);
protected:
void run();
signals:
void fileStatusChanged(int rowIndex);
};