pkgbuilds/qopenhd-git/0001-fix-compile-when-using-the-latest-GCC-and-FFmpeg-ver.patch

51 lines
1.6 KiB
Diff

From e950a5f3735bbb26622348d16a896c7eb6b229c1 Mon Sep 17 00:00:00 2001
From: Rihards Skuja <rihards@skuja.eu>
Date: Fri, 3 Nov 2023 15:23:14 +0200
Subject: [PATCH] fix compile when using the latest GCC and FFmpeg versions
That FFmpeg API function was deprecated more than 2 years ago.
---
app/telemetry/action/impl/xparam.h | 1 +
app/videostreaming/avcodec/avcodec_helper.hpp | 5 +++++
2 files changed, 6 insertions(+)
diff --git a/app/telemetry/action/impl/xparam.h b/app/telemetry/action/impl/xparam.h
index b80b7da44..27ecf44ec 100644
--- a/app/telemetry/action/impl/xparam.h
+++ b/app/telemetry/action/impl/xparam.h
@@ -8,6 +8,7 @@
#include <thread>
#include <functional>
#include <vector>
+#include <string>
#include "../../util/mavlink_include.h"
diff --git a/app/videostreaming/avcodec/avcodec_helper.hpp b/app/videostreaming/avcodec/avcodec_helper.hpp
index 3123ccfbf..c90cccda3 100644
--- a/app/videostreaming/avcodec/avcodec_helper.hpp
+++ b/app/videostreaming/avcodec/avcodec_helper.hpp
@@ -16,6 +16,7 @@ extern "C" {
#include <libavutil/imgutils.h>
#include <libavutil/buffer.h>
#include <libavutil/frame.h>
+#include <libavutil/version.h>
//
#include "libavutil/frame.h"
#include "libavutil/hwcontext.h"
@@ -60,7 +61,11 @@ static std::string safe_av_get_pix_fmt_name(enum AVPixelFormat pix_fmt){
return {tmp};
}
static std::string safe_av_get_colorspace_name(enum AVColorSpace val){
+#if defined(FF_API_COLORSPACE_NAME)
auto tmp= av_get_colorspace_name(val);
+#else
+ auto tmp= av_color_space_name(val);
+#endif
if(tmp== nullptr){
return "null";
}
--
2.42.0