various improvements
This commit is contained in:
+29
-17
@@ -25,28 +25,36 @@ extern "C" {
|
||||
#define COMPRESSION_TYPE_TARGETSIZE 2
|
||||
#define COMPRESSION_TYPE_TARGETBR 3
|
||||
|
||||
// structs that store parameters passed from the export dialogs to this thread
|
||||
|
||||
struct ExportParams {
|
||||
// export parameters
|
||||
QString filename;
|
||||
bool video_enabled;
|
||||
int video_codec;
|
||||
int video_width;
|
||||
int video_height;
|
||||
double video_frame_rate;
|
||||
int video_compression_type;
|
||||
double video_bitrate;
|
||||
bool audio_enabled;
|
||||
int audio_codec;
|
||||
int audio_sampling_rate;
|
||||
int audio_bitrate;
|
||||
long start_frame;
|
||||
long end_frame;
|
||||
};
|
||||
|
||||
struct VideoCodecParams {
|
||||
int pix_fmt;
|
||||
};
|
||||
|
||||
class ExportThread : public QThread {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ExportThread(QObject* parent = nullptr);
|
||||
ExportThread(const ExportParams& iparams, const VideoCodecParams& ivparams, QObject* parent = nullptr);
|
||||
void run();
|
||||
|
||||
// export parameters
|
||||
QString filename;
|
||||
bool video_enabled;
|
||||
int video_codec;
|
||||
int video_width;
|
||||
int video_height;
|
||||
double video_frame_rate;
|
||||
int video_compression_type;
|
||||
double video_bitrate;
|
||||
bool audio_enabled;
|
||||
int audio_codec;
|
||||
int audio_sampling_rate;
|
||||
int audio_bitrate;
|
||||
long start_frame;
|
||||
long end_frame;
|
||||
|
||||
QOffscreenSurface surface;
|
||||
|
||||
ExportDialog* ed;
|
||||
@@ -62,6 +70,10 @@ private:
|
||||
bool setupAudio();
|
||||
bool setupContainer();
|
||||
|
||||
// params imported from dialogs
|
||||
ExportParams params;
|
||||
VideoCodecParams vcodec_params;
|
||||
|
||||
AVFormatContext* fmt_ctx;
|
||||
AVStream* video_stream;
|
||||
AVCodec* vcodec;
|
||||
|
||||
Reference in New Issue
Block a user