This commit is contained in:
2026-05-28 21:43:57 +08:00
11 changed files with 61 additions and 59 deletions
+1 -3
View File
@@ -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)
+17 -20
View File
@@ -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 <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
@@ -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();
-14
View File
@@ -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
*/
+9
View File
@@ -21,6 +21,11 @@
#include "ffmpegencoder.h"
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#endif
extern "C" {
#include <libavfilter/buffersink.h>
#include <libavfilter/buffersrc.h>
@@ -1038,4 +1043,8 @@ const AVCodec *FFmpegEncoder::GetEncoder(ExportCodec::Codec c,
return nullptr;
}
#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif
}
+4
View File
@@ -33,8 +33,10 @@
#include <QStyleFactory>
#include "window/mainwindow/mainwindowundo.h"
#ifdef Q_OS_WINDOWS
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include <QtPlatformHeaders/QWindowsWindowFunctions>
#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
+8
View File
@@ -97,6 +97,10 @@ ColorProcessor::ColorProcessor(OCIO::ConstProcessorRcPtr processor)
void ColorProcessor::ConvertFrame(Frame *f)
{
if (!cpu_processor_) {
return;
}
OCIO::BitDepth ocio_bit_depth =
OCIOUtils::GetOCIOBitDepthFromPixelFormat(f->format());
@@ -115,6 +119,10 @@ void ColorProcessor::ConvertFrame(Frame *f)
Color ColorProcessor::ConvertColor(const Color &in)
{
if (!cpu_processor_) {
return in;
}
// I've been bamboozled
float c[4] = { float(in.red()), float(in.green()), float(in.blue()),
float(in.alpha()) };
+5 -1
View File
@@ -1107,7 +1107,11 @@ void ViewerDisplayWidget::EmitColorAtCursor(QMouseEvent *e)
reference =
renderer()->GetPixelFromTexture(texture_.get(), pixel_pos);
display = color_service()->ConvertColor(reference);
if (color_service()) {
display = color_service()->ConvertColor(reference);
} else {
display = reference;
}
}
emit CursorColor(reference, display);
+5
View File
@@ -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<MSG *>(message)->message == taskbar_btn_id_) {
// Attempt to create taskbar button progress handle
+6 -1
View File
@@ -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:
-14
View File
@@ -1,14 +0,0 @@
{
"name": "oak-video-editor-docs",
"private": true,
"type": "module",
"scripts": {
"docs:dev": "vuepress dev docs",
"docs:build": "vuepress build docs"
},
"devDependencies": {
"@vuepress/bundler-vite": "^2.0.0-rc.19",
"vuepress": "^2.0.0-rc.19",
"vuepress-theme-hope": "^2.0.0-rc.42"
}
}
+6 -6
View File
@@ -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;