diff --git a/CMakeLists.txt b/CMakeLists.txt index 2a89d1e13..521a3f3a2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -248,9 +248,7 @@ else() endif() endif() -if (WIN32) - list(APPEND OLIVE_DEFINITIONS "-DUNICODE -D_UNICODE") -elseif (APPLE) +if (APPLE) list(APPEND OLIVE_LIBRARIES "-framework IOKit") elseif(UNIX) list(APPEND OLIVE_LIBRARIES Qt${QT_VERSION_MAJOR}::DBus) diff --git a/app/codec/ffmpeg/ffmpegdecoder.cpp b/app/codec/ffmpeg/ffmpegdecoder.cpp index cf6816d7d..40ecdac16 100644 --- a/app/codec/ffmpeg/ffmpegdecoder.cpp +++ b/app/codec/ffmpeg/ffmpegdecoder.cpp @@ -21,6 +21,23 @@ #include "ffmpegdecoder.h" +namespace olive { + +static VideoParams::Interlacing FFmpegFieldOrderToOlive(AVFieldOrder fo) +{ + switch (fo) { + case AV_FIELD_TT: + return VideoParams::kInterlacedTopFirst; + case AV_FIELD_BB: + return VideoParams::kInterlacedBottomFirst; + case AV_FIELD_PROGRESSIVE: + default: + return VideoParams::kInterlaceNone; + } +} + +} + extern "C" { #include #include @@ -349,18 +366,6 @@ TexturePtr FFmpegDecoder::RetrieveVideoInternal(const RetrieveVideoParams &p) return nullptr; } - // Diagnostic: check if decoded frame is all black - bool all_black = true; - if (f->data[0]) { - int check_rows = std::min(f->height, 8); - int check_bytes = check_rows * f->linesize[0]; - for (int i = 0; i < check_bytes; ++i) { - if (f->data[0][i] != 0) { - all_black = false; - break; - } - } - } // Finally, perform any GPU processing required TexturePtr texture = ProcessFrameIntoTexture(f, p, original); @@ -454,14 +459,6 @@ FootageDescription FFmpegDecoder::Probe(const QString &filename, avstream->codecpar->codec_type == AVMEDIA_TYPE_AUDIO || avstream->codecpar->codec_type == AVMEDIA_TYPE_SUBTITLE)) { if (avstream->codecpar->codec_type == AVMEDIA_TYPE_VIDEO) { - AVPixelFormat compatible_pix_fmt = AV_PIX_FMT_NONE; - - bool image_is_still = false; - rational pixel_aspect_ratio; - rational frame_rate; - VideoParams::Interlacing interlacing = - VideoParams::kInterlaceNone; - { // Read at least two frames to get more information about this video stream AVPacket *pkt = av_packet_alloc(); diff --git a/app/codec/ffmpeg/ffmpegdecoder.h b/app/codec/ffmpeg/ffmpegdecoder.h index 09201a2b5..98d432124 100644 --- a/app/codec/ffmpeg/ffmpegdecoder.h +++ b/app/codec/ffmpeg/ffmpegdecoder.h @@ -43,20 +43,6 @@ extern "C" { namespace olive { -// 头文件里先备好枚举映射 -static VideoParams::Interlacing FFmpegFieldOrderToOlive(AVFieldOrder fo) -{ - switch (fo) { - case AV_FIELD_TT: // 隔行,顶场在前 - return VideoParams::kInterlacedTopFirst; - case AV_FIELD_BB: // 隔行,底场在前 - return VideoParams::kInterlacedBottomFirst; - case AV_FIELD_PROGRESSIVE: - default: - return VideoParams::kInterlaceNone; - } -} - /** * @brief A Decoder derivative that wraps FFmpeg functions as on Olive decoder */ diff --git a/app/codec/ffmpeg/ffmpegencoder.cpp b/app/codec/ffmpeg/ffmpegencoder.cpp index 39edb06ac..983b275dd 100644 --- a/app/codec/ffmpeg/ffmpegencoder.cpp +++ b/app/codec/ffmpeg/ffmpegencoder.cpp @@ -21,6 +21,11 @@ #include "ffmpegencoder.h" +#ifdef __GNUC__ +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif + extern "C" { #include #include @@ -1038,4 +1043,8 @@ const AVCodec *FFmpegEncoder::GetEncoder(ExportCodec::Codec c, return nullptr; } +#ifdef __GNUC__ +#pragma GCC diagnostic pop +#endif + } diff --git a/app/core.cpp b/app/core.cpp index fcc9f7811..b48f33cd6 100644 --- a/app/core.cpp +++ b/app/core.cpp @@ -33,8 +33,10 @@ #include #include "window/mainwindow/mainwindowundo.h" #ifdef Q_OS_WINDOWS +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) #include #endif +#endif #include "audio/audiomanager.h" #include "cli/clitask/clitaskdialog.h" @@ -910,10 +912,12 @@ void Core::StartGUI(bool full_screen) } #ifdef Q_OS_WINDOWS +#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) // Workaround for Qt bug where menus don't appear in full screen mode // See: https://doc.qt.io/qt-5/windows-issues.html QWindowsWindowFunctions::setHasBorderInFullScreen( main_window_->windowHandle(), true); +#endif #endif // Start autorecovery timer using the config value as its interval diff --git a/app/window/mainwindow/mainwindow.cpp b/app/window/mainwindow/mainwindow.cpp index 69343a9c1..0778b04db 100644 --- a/app/window/mainwindow/mainwindow.cpp +++ b/app/window/mainwindow/mainwindow.cpp @@ -498,8 +498,13 @@ void MainWindow::closeEvent(QCloseEvent *e) } #ifdef Q_OS_WINDOWS +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +bool MainWindow::nativeEvent(const QByteArray &eventType, void *message, + qintptr *result) +#else bool MainWindow::nativeEvent(const QByteArray &eventType, void *message, long *result) +#endif { if (static_cast(message)->message == taskbar_btn_id_) { // Attempt to create taskbar button progress handle diff --git a/app/window/mainwindow/mainwindow.h b/app/window/mainwindow/mainwindow.h index a6ff40e3a..c4ae592e7 100644 --- a/app/window/mainwindow/mainwindow.h +++ b/app/window/mainwindow/mainwindow.h @@ -109,8 +109,13 @@ protected: virtual void closeEvent(QCloseEvent *e) override; #ifdef Q_OS_WINDOWS +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) virtual bool nativeEvent(const QByteArray &eventType, void *message, - long *result); + qintptr *result) override; +#else + virtual bool nativeEvent(const QByteArray &eventType, void *message, + long *result) override; +#endif #endif private: diff --git a/third_party/openfx/HostSupport/include/ofxhPropertySuite.h b/third_party/openfx/HostSupport/include/ofxhPropertySuite.h index cb73d922d..52efd6858 100644 --- a/third_party/openfx/HostSupport/include/ofxhPropertySuite.h +++ b/third_party/openfx/HostSupport/include/ofxhPropertySuite.h @@ -307,18 +307,18 @@ namespace OFX { // get multiple values void getValueN(APIType *value, int count) const; -#ifdef WINDOWS -#pragma warning( disable : 4181 ) -#endif +#ifdef _MSC_VER +#pragma warning( disable : 4181 ) +#endif /// get one value const ReturnType getValue(int index=0) const; /// get one value, without going through the getHook const ReturnType getValueRaw(int index=0) const; -#ifdef WINDOWS -#pragma warning( default : 4181 ) -#endif +#ifdef _MSC_VER +#pragma warning( default : 4181 ) +#endif // get multiple values, without going through the getHook void getValueNRaw(APIType *value, int count) const;