summaryrefslogtreecommitdiff
path: root/kde-plasma/kpipewire/files/kpipewire-6.4.5-ffmpeg8.patch
blob: 8c721c47ac76e8eee8b0f021c8f2cf1bbb3a7368 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
From 6dc69b0674f9946641e88151c209ce58f085d06a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= <bero@lindev.ch>
Date: Wed, 27 Aug 2025 16:39:36 +0200
Subject: [PATCH] Fix build with ffmpeg >= 8.0

---
 src/h264vaapiencoder.cpp   | 12 +++++++++---
 src/libopenh264encoder.cpp | 12 +++++++++---
 src/libx264encoder.cpp     | 12 +++++++++---
 3 files changed, 27 insertions(+), 9 deletions(-)

diff --git a/src/h264vaapiencoder.cpp b/src/h264vaapiencoder.cpp
index 0cf251b..eaec8dd 100644
--- a/src/h264vaapiencoder.cpp
+++ b/src/h264vaapiencoder.cpp
@@ -18,6 +18,12 @@ extern "C" {
 
 #include "logging_record.h"
 
+#ifndef AV_PROFILE_H264_BASELINE // ffmpeg before 8.0
+#define AV_PROFILE_H264_BASELINE FF_PROFILE_H264_BASELINE
+#define AV_PROFILE_H264_MAIN FF_PROFILE_H264_MAIN
+#define AV_PROFILE_H264_HIGH FF_PROFILE_H264_HIGH
+#endif
+
 H264VAAPIEncoder::H264VAAPIEncoder(H264Profile profile, PipeWireProduce *produce)
     : HardwareEncoder(produce)
     , m_profile(profile)
@@ -130,13 +136,13 @@ bool H264VAAPIEncoder::initialize(const QSize &size)
 
     switch (m_profile) {
     case H264Profile::Baseline:
-        m_avCodecContext->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE;
+        m_avCodecContext->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE;
         break;
     case H264Profile::Main:
-        m_avCodecContext->profile = FF_PROFILE_H264_MAIN;
+        m_avCodecContext->profile = AV_PROFILE_H264_MAIN;
         break;
     case H264Profile::High:
-        m_avCodecContext->profile = FF_PROFILE_H264_HIGH;
+        m_avCodecContext->profile = AV_PROFILE_H264_HIGH;
         break;
     }
 
diff --git a/src/libopenh264encoder.cpp b/src/libopenh264encoder.cpp
index db6ed4d..294c0f2 100644
--- a/src/libopenh264encoder.cpp
+++ b/src/libopenh264encoder.cpp
@@ -21,6 +21,12 @@ extern "C" {
 
 #include "logging_record.h"
 
+#ifndef AV_PROFILE_H264_BASELINE // ffmpeg before 8.0
+#define AV_PROFILE_H264_CONSTRAINED_BASELINE FF_PROFILE_H264_CONSTRAINED_BASELINE
+#define AV_PROFILE_H264_MAIN FF_PROFILE_H264_MAIN
+#define AV_PROFILE_H264_HIGH FF_PROFILE_H264_HIGH
+#endif
+
 LibOpenH264Encoder::LibOpenH264Encoder(H264Profile profile, PipeWireProduce *produce)
     : SoftwareEncoder(produce)
     , m_profile(profile)
@@ -64,13 +70,13 @@ bool LibOpenH264Encoder::initialize(const QSize &size)
         // passes that through, but libopenh264 only allows BASELINE.
         // Until that bug is fixed there'll always be a warning that the
         // profile is not supported (https://github.com/cisco/openh264/issues/3613)
-        m_avCodecContext->profile = FF_PROFILE_H264_CONSTRAINED_BASELINE;
+        m_avCodecContext->profile = AV_PROFILE_H264_CONSTRAINED_BASELINE;
         break;
     case H264Profile::Main:
-        m_avCodecContext->profile = FF_PROFILE_H264_MAIN;
+        m_avCodecContext->profile = AV_PROFILE_H264_MAIN;
         break;
     case H264Profile::High:
-        m_avCodecContext->profile = FF_PROFILE_H264_HIGH;
+        m_avCodecContext->profile = AV_PROFILE_H264_HIGH;
         break;
     }
 
diff --git a/src/libx264encoder.cpp b/src/libx264encoder.cpp
index d9fe44f..a8f0e21 100644
--- a/src/libx264encoder.cpp
+++ b/src/libx264encoder.cpp
@@ -20,6 +20,12 @@ extern "C" {
 
 #include "logging_record.h"
 
+#ifndef AV_PROFILE_H264_BASELINE // ffmpeg before 8.0
+#define AV_PROFILE_H264_BASELINE FF_PROFILE_H264_BASELINE
+#define AV_PROFILE_H264_MAIN FF_PROFILE_H264_MAIN
+#define AV_PROFILE_H264_HIGH FF_PROFILE_H264_HIGH
+#endif
+
 using namespace Qt::StringLiterals;
 
 LibX264Encoder::LibX264Encoder(H264Profile profile, PipeWireProduce *produce)
@@ -68,13 +74,13 @@ bool LibX264Encoder::initialize(const QSize &size)
 
     switch (m_profile) {
     case H264Profile::Baseline:
-        m_avCodecContext->profile = FF_PROFILE_H264_BASELINE;
+        m_avCodecContext->profile = AV_PROFILE_H264_BASELINE;
         break;
     case H264Profile::Main:
-        m_avCodecContext->profile = FF_PROFILE_H264_MAIN;
+        m_avCodecContext->profile = AV_PROFILE_H264_MAIN;
         break;
     case H264Profile::High:
-        m_avCodecContext->profile = FF_PROFILE_H264_HIGH;
+        m_avCodecContext->profile = AV_PROFILE_H264_HIGH;
         break;
     }
 
-- 
GitLab