Add ffmpeg v7 patch

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2024-06-29 21:51:04 +02:00
parent 7c92b96e8c
commit 11361ca1cb
Signed by: luzifer
SSH key fingerprint: SHA256:/xtE5lCgiRDQr8SLxHMS92ZBlACmATUmF1crK16Ks4E
3 changed files with 78 additions and 95 deletions

99
.gitignore vendored
View file

@ -1,93 +1,6 @@
*.tar *
obs-studio-git/ !.gitignore
ftl-sdk !.SRCINFO
obs-browser !0001-obs-ffmpeg-Fix-incompatible-pointer-types-with-FFmpe.patch
pkg/ !PKGBUILD
src/ !update_version.sh
#binaries
*.exe
*.dll
*.dylib
*.so
#cmake
/cmbuild/
/build/
/build32/
/build64/
/release/
/release32/
/release64/
/debug/
/debug32/
/debug64/
/builds/
*.o.d
*.ninja
.ninja*
.dirstamp
#xcode
*.xcodeproj/
#other stuff (windows stuff, qt moc stuff, etc)
Release_MD/
Release/
Debug/
x64/
ipch/
GeneratedFiles/
.moc/
/other/
#make stuff
configure
depcomp
install-sh
Makefile.in
Makefile
#random useless file stuff
*.dmg
*.app
.DS_Store
.directory
.hg
.depend
tags
*.trace
*.vsp
*.psess
*.swp
*.dat
*.clbin
*.log
*.tlog
*.sdf
*.opensdf
*.xml
*.ipch
*.css
*.xslt
*.aps
*.suo
*.ncb
*.user
*.lo
*.ilk
*.la
*.o
*.obj
*.pdb
*.res
*.manifest
*.dep
*.zip
*.lnk
*.chm
*~
.DS_Store
*/.DS_Store
*/**/.DS_Store

View file

@ -0,0 +1,67 @@
From 8dbad9ac2974f9db776838e3f87c57c15291e983 Mon Sep 17 00:00:00 2001
From: tytan652 <tytan652@tytanium.xyz>
Date: Sat, 6 Apr 2024 08:50:07 +0200
Subject: [PATCH] obs-ffmpeg: Fix incompatible-pointer-types with FFmpeg 7
---
plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c | 5 +++++
plugins/obs-ffmpeg/obs-ffmpeg-mpegts.c | 18 ++++++++++++------
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c b/plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c
index a05c33c94..b4e9203bf 100644
--- a/plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c
+++ b/plugins/obs-ffmpeg/ffmpeg-mux/ffmpeg-mux.c
@@ -886,7 +886,12 @@ static int64_t ffmpeg_mux_seek_av_buffer(void *opaque, int64_t offset,
return 0;
}
+#if LIBAVFORMAT_VERSION_MAJOR >= 61
+static int ffmpeg_mux_write_av_buffer(void *opaque, const uint8_t *buf,
+ int buf_size)
+#else
static int ffmpeg_mux_write_av_buffer(void *opaque, uint8_t *buf, int buf_size)
+#endif
{
struct ffmpeg_mux *ffm = opaque;
diff --git a/plugins/obs-ffmpeg/obs-ffmpeg-mpegts.c b/plugins/obs-ffmpeg/obs-ffmpeg-mpegts.c
index f23bf25c0..69ec8a7c2 100644
--- a/plugins/obs-ffmpeg/obs-ffmpeg-mpegts.c
+++ b/plugins/obs-ffmpeg/obs-ffmpeg-mpegts.c
@@ -421,6 +421,12 @@ fail:
return err;
}
+#if LIBAVFORMAT_VERSION_MAJOR >= 61
+typedef int (*write_packet_cb)(void *, const uint8_t *, int);
+#else
+typedef int (*write_packet_cb)(void *, uint8_t *, int);
+#endif
+
static inline int allocate_custom_aviocontext(struct ffmpeg_output *stream,
bool is_rist)
{
@@ -437,13 +443,13 @@ static inline int allocate_custom_aviocontext(struct ffmpeg_output *stream,
return AVERROR(ENOMEM);
/* allocate custom avio_context */
if (is_rist)
- s = avio_alloc_context(
- buffer, buffer_size, AVIO_FLAG_WRITE, h, NULL,
- (int (*)(void *, uint8_t *, int))librist_write, NULL);
+ s = avio_alloc_context(buffer, buffer_size, AVIO_FLAG_WRITE, h,
+ NULL, (write_packet_cb)librist_write,
+ NULL);
else
- s = avio_alloc_context(
- buffer, buffer_size, AVIO_FLAG_WRITE, h, NULL,
- (int (*)(void *, uint8_t *, int))libsrt_write, NULL);
+ s = avio_alloc_context(buffer, buffer_size, AVIO_FLAG_WRITE, h,
+ NULL, (write_packet_cb)libsrt_write,
+ NULL);
if (!s)
goto fail;
s->max_packet_size = h->max_packet_size;
--
2.45.1

View file

@ -7,7 +7,7 @@
pkgname=obs-studio-browser pkgname=obs-studio-browser
pkgver=30.1.2 pkgver=30.1.2
pkgrel=1 pkgrel=2
pkgdesc="Free and open source software for video recording and live streaming. Built with the browser plugin." pkgdesc="Free and open source software for video recording and live streaming. Built with the browser plugin."
arch=("i686" "x86_64") arch=("i686" "x86_64")
url="https://github.com/obsproject/obs-studio" url="https://github.com/obsproject/obs-studio"
@ -58,12 +58,15 @@ provides=("obs-studio=$pkgver")
conflicts=("obs-studio") conflicts=("obs-studio")
source=( source=(
"$pkgname::git+https://github.com/obsproject/obs-studio.git#tag=$pkgver" "$pkgname::git+https://github.com/obsproject/obs-studio.git#tag=$pkgver"
0001-obs-ffmpeg-Fix-incompatible-pointer-types-with-FFmpe.patch
) )
sha256sums=('0390743a85c3294abdb73ddf7d5d60354b5283f77cc9680026b2641600ae5384') sha256sums=('0390743a85c3294abdb73ddf7d5d60354b5283f77cc9680026b2641600ae5384'
'f4356ddabd4b54662f685ec88432e2830cdeb1904665d14c64d2daa3ea7d254e')
prepare() { prepare() {
cd $pkgname cd $pkgname
git submodule update --init --recursive git submodule update --init --recursive
patch -Np1 <"$srcdir"/0001-obs-ffmpeg-Fix-incompatible-pointer-types-with-FFmpe.patch
} }
build() { build() {