OSDN Git Service

Added option to choose between 8-Bit and 10-Bit encoding at runtime. We now include...
[x264-launcher/x264-launcher.git] / src / thread_encode.h
index cd35f32..0ed9b37 100644 (file)
@@ -53,7 +53,7 @@ public:
                JobStatus_Undefined = 666
        };
        
-       EncodeThread(const QString &sourceFileName, const QString &outputFileName, const OptionsModel *options, const QString &binDir, bool x264_x64, bool avs2yuv_x64);
+       EncodeThread(const QString &sourceFileName, const QString &outputFileName, const OptionsModel *options, const QString &binDir, bool x264_x64, bool x264_10bit, bool avs2yuv_x64);
        ~EncodeThread(void);
 
        QUuid getId(void) { return this->m_jobId; };
@@ -79,7 +79,9 @@ public:
 
 protected:
        static QMutex m_mutex_startProcess;
-       static const int m_processTimeoutCounter = 24;
+       static const unsigned int m_processTimeoutInterval = 2500;
+       static const unsigned int m_processTimeoutMaxCounter = 120;
+       static const unsigned int m_processTimeoutWarning = 24;
 
        //Constants
        const QUuid m_jobId;
@@ -88,6 +90,7 @@ protected:
        const OptionsModel *m_options;
        const QString m_binDir;
        const bool m_x264_x64;
+       const bool m_x264_10bit;
        const bool m_avs2yuv_x64;
 
        //Flags
@@ -110,9 +113,9 @@ protected:
        
        //Encode functions
        void encode(void);
-       bool runEncodingPass(bool x264_x64, bool avs2yuv_x64, bool usePipe, unsigned int frames, const QString &indexFile, int pass = 0, const QString &passLogFile = QString());
-       QStringList buildCommandLine(bool usePipe, unsigned int frames, const QString &indexFile, int pass = 0, const QString &passLogFile = QString());
-       unsigned int checkVersionX264(bool x64, bool &modified);
+       bool runEncodingPass(bool x264_x64, bool x264_10bit, bool avs2yuv_x64, bool usePipe, unsigned int frames, const QString &indexFile, int pass = 0, const QString &passLogFile = QString());
+       QStringList buildCommandLine(bool usePipe, bool use10Bit, unsigned int frames, const QString &indexFile, int pass = 0, const QString &passLogFile = QString());
+       unsigned int checkVersionX264(bool use_x64, bool use_10bit, bool &modified);
        unsigned int checkVersionAvs2yuv(bool x64);
        bool checkProperties(bool x64, unsigned int &frames);
 
@@ -122,8 +125,13 @@ protected:
        inline void setProgress(unsigned int newProgress);
        inline void setDetails(const QString &text);
        bool startProcess(QProcess &process, const QString &program, const QStringList &args, bool mergeChannels = true);
-       
+       QString pathToLocal(const QString &longPath, bool create = false, bool keep = true);
+       QStringList splitParams(const QString &params);
+       qint64 estimateSize(int progress);
+
+       //Static functions
        static QString commandline2string(const QString &program, const QStringList &arguments);
+       static QString sizeToString(qint64 size);
 
 signals:
        void statusChanged(const QUuid &jobId, EncodeThread::JobStatus newStatus);