commit 5ac3a4712c7f2f4a8a87d7b56404077e8945823f
Author: Sérgio M. Basto <sergio(a)serjux.com>
Date: Thu Nov 7 23:57:11 2024 +0000
Add qTox-1.17.6-ffmpeg7.patch (Mamoru TASAKA) from rfbz #7096
qTox-1.17.6-ffmpeg7.patch | 55 +++++++++++++++++++++++++++++++++++++++++++++++
qtox.spec | 2 ++
2 files changed, 57 insertions(+)
---
diff --git a/qTox-1.17.6-ffmpeg7.patch b/qTox-1.17.6-ffmpeg7.patch
new file mode 100644
index 0000000..4a93ddf
--- /dev/null
+++ b/qTox-1.17.6-ffmpeg7.patch
@@ -0,0 +1,55 @@
+Port to use ffmpeg 7
+
+Use avdevice_list_input_sources(), similar with
+https://github.com/gpac/gpac/pull/2994/
+
+diff -urp '--exclude=*~' '--exclude=redhat-linux-build'
qTox-1.17.6.orig/src/video/cameradevice.cpp qTox-1.17.6/src/video/cameradevice.cpp
+--- qTox-1.17.6.orig/src/video/cameradevice.cpp 2022-03-06 23:31:31.000000000 +0900
++++ qTox-1.17.6/src/video/cameradevice.cpp 2024-11-04 22:27:14.943823061 +0900
+@@ -279,44 +279,14 @@ QVector<QPair<QString, QString>> CameraD
+ if (!getDefaultInputFormat())
+ return devices;
+
+- // Alloc an input device context
+- AVFormatContext* s;
+- if (!(s = avformat_alloc_context()))
+- return devices;
+-
+ if (!iformat->priv_class ||
!AV_IS_INPUT_DEVICE(iformat->priv_class->category)) {
+- avformat_free_context(s);
+ return devices;
+ }
+
+- s->iformat = iformat;
+- if (s->iformat->priv_data_size > 0) {
+- s->priv_data = av_mallocz(s->iformat->priv_data_size);
+- if (!s->priv_data) {
+- avformat_free_context(s);
+- return devices;
+- }
+- if (s->iformat->priv_class) {
+- *(const AVClass**)s->priv_data = s->iformat->priv_class;
+- av_opt_set_defaults(s->priv_data);
+- }
+- } else {
+- s->priv_data = nullptr;
+- }
+-
+ // List the devices for this context
+ AVDeviceInfoList* devlist = nullptr;
+- AVDictionary* tmp = nullptr;
+- av_dict_copy(&tmp, nullptr, 0);
+- if (av_opt_set_dict2(s, &tmp, AV_OPT_SEARCH_CHILDREN) < 0) {
+- av_dict_free(&tmp);
+- avformat_free_context(s);
+- return devices;
+- }
+- avdevice_list_devices(s, &devlist);
+- av_dict_free(&tmp);
+- avformat_free_context(s);
+- if (!devlist) {
++ int ret = avdevice_list_input_sources(iformat, nullptr, nullptr, &devlist);
++ if (ret < 0) {
+ qWarning() << "avdevice_list_devices failed";
+ return devices;
+ }
diff --git a/qtox.spec b/qtox.spec
index 2174d10..a859a57 100644
--- a/qtox.spec
+++ b/qtox.spec
@@ -13,6 +13,7 @@ Source0: %{url}/archive/v%{version}/%{name}-%{version}.tar.gz
# Remove project_group tag from appdata.xml
Patch0: qTox-c0e9a3b-remove_project_group.patch
+Patch1: qTox-1.17.6-ffmpeg7.patch
BuildRequires: gcc-c++
BuildRequires: cmake
@@ -75,6 +76,7 @@ appstream-util validate-relax --nonet
%{buildroot}%{_datadir}/metainfo/io.github
%changelog
* Wed Nov 06 2024 Sérgio Basto <sergio(a)serjux.com> - 1.17.6-9
- Rebuild for ffmpeg-7
+- Add qTox-1.17.6-ffmpeg7.patch (Mamoru TASAKA) from rfbz #7096
* Fri Aug 02 2024 RPM Fusion Release Engineering <sergiomb(a)rpmfusion.org> -
1.17.6-8
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild