Your message dated Wed, 31 Aug 2022 15:03:57 +0000
with message-id <[email protected]>
and subject line Bug#1015780: fixed in casparcg-server 2.3.3+dfsg-1
has caused the Debian Bug report #1015780,
regarding casparcg-server: FTBFS with ffmpeg 5.0
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
1015780: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1015780
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: casparcg-server
Version: 2.2.0+dfsg-2.1
Severity: serious
Tags: patch
Justification: FTBFS
User: [email protected]
Usertags: origin-ubuntu kinetic ubuntu-patch

Hi Petter,

casparcg-server fails to build against ffmpeg 5.0 which is now in unstable. 
The attached patch fixes the API incompatibilities.

Other fixes are needed to get casparcg-server building in general; I believe
there are bugs open for these other issues.

-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
[email protected]                                     [email protected]
diff -Nru casparcg-server-2.2.0+dfsg/debian/control 
casparcg-server-2.2.0+dfsg/debian/control
--- casparcg-server-2.2.0+dfsg/debian/control   2022-03-09 03:13:39.000000000 
-0800
+++ casparcg-server-2.2.0+dfsg/debian/control   2022-07-20 21:42:59.000000000 
-0700
@@ -1,6 +1,5 @@
 Source: casparcg-server
-Maintainer: Ubuntu Developers <[email protected]>
-XSBC-Original-Maintainer: Petter Reinholdtsen <[email protected]>
+Maintainer: Petter Reinholdtsen <[email protected]>
 Section: contrib/video
 Priority: optional
 Standards-Version: 4.3.0
diff -Nru casparcg-server-2.2.0+dfsg/debian/patches/ffmpeg-5.0.patch 
casparcg-server-2.2.0+dfsg/debian/patches/ffmpeg-5.0.patch
--- casparcg-server-2.2.0+dfsg/debian/patches/ffmpeg-5.0.patch  1969-12-31 
16:00:00.000000000 -0800
+++ casparcg-server-2.2.0+dfsg/debian/patches/ffmpeg-5.0.patch  2022-07-20 
21:42:59.000000000 -0700
@@ -0,0 +1,182 @@
+Description: Compatibility with ffmpeg 5.0.
+Author: Steve Langasek <[email protected]>
+Last-Update: 2022-07-20
+Forwarded: no
+
+Index: casparcg-server-2.2.0+dfsg/src/modules/ffmpeg/producer/av_producer.cpp
+===================================================================
+--- casparcg-server-2.2.0+dfsg.orig/src/modules/ffmpeg/producer/av_producer.cpp
++++ casparcg-server-2.2.0+dfsg/src/modules/ffmpeg/producer/av_producer.cpp
+@@ -38,6 +38,7 @@
+ #include <libavfilter/buffersrc.h>
+ #include <libavformat/avformat.h>
+ #include <libavutil/avutil.h>
++#include <libavutil/channel_layout.h>
+ #include <libavutil/error.h>
+ #include <libavutil/opt.h>
+ #include <libavutil/pixfmt.h>
+Index: casparcg-server-2.2.0+dfsg/src/modules/ffmpeg/util/av_util.cpp
+===================================================================
+--- casparcg-server-2.2.0+dfsg.orig/src/modules/ffmpeg/util/av_util.cpp
++++ casparcg-server-2.2.0+dfsg/src/modules/ffmpeg/util/av_util.cpp
+@@ -9,7 +9,9 @@
+ extern "C" {
+ #include <libavcodec/avcodec.h>
+ #include <libavfilter/avfilter.h>
++#include <libavutil/channel_layout.h>
+ #include <libavutil/frame.h>
++#include <libavutil/imgutils.h>
+ #include <libavutil/pixfmt.h>
+ }
+ #if defined(_MSC_VER)
+@@ -113,46 +115,52 @@
+ core::pixel_format_desc pixel_format_desc(AVPixelFormat pix_fmt, int width, 
int height)
+ {
+     // Get linesizes
+-    AVPicture dummy_pict;
+-    avpicture_fill(&dummy_pict, nullptr, pix_fmt, width, height);
++    uint8_t *pointers[4];
++    int linesize[4];
++    av_image_alloc(pointers, linesize, width, height, pix_fmt, 8);
+ 
+     core::pixel_format_desc desc = get_pixel_format(pix_fmt);
+ 
+     switch (desc.format) {
+         case core::pixel_format::gray:
+         case core::pixel_format::luma: {
+-            
desc.planes.push_back(core::pixel_format_desc::plane(dummy_pict.linesize[0], 
height, 1));
++            desc.planes.push_back(core::pixel_format_desc::plane(linesize[0], 
height, 1));
++            av_freep(&pointers[0]);
+             return desc;
+         }
+         case core::pixel_format::bgr:
+         case core::pixel_format::rgb: {
+-            
desc.planes.push_back(core::pixel_format_desc::plane(dummy_pict.linesize[0] / 
3, height, 3));
++            desc.planes.push_back(core::pixel_format_desc::plane(linesize[0] 
/ 3, height, 3));
++            av_freep(&pointers[0]);
+             return desc;
+         }
+         case core::pixel_format::bgra:
+         case core::pixel_format::argb:
+         case core::pixel_format::rgba:
+         case core::pixel_format::abgr: {
+-            
desc.planes.push_back(core::pixel_format_desc::plane(dummy_pict.linesize[0] / 
4, height, 4));
++            desc.planes.push_back(core::pixel_format_desc::plane(linesize[0] 
/ 4, height, 4));
++            av_freep(&pointers[0]);
+             return desc;
+         }
+         case core::pixel_format::ycbcr:
+         case core::pixel_format::ycbcra: {
+             // Find chroma height
+-            auto size2 = static_cast<int>(dummy_pict.data[2] - 
dummy_pict.data[1]);
+-            auto h2    = size2 / dummy_pict.linesize[1];
++            auto size2 = static_cast<int>(pointers[2] - pointers[1]);
++            auto h2    = size2 / linesize[1];
+ 
+-            
desc.planes.push_back(core::pixel_format_desc::plane(dummy_pict.linesize[0], 
height, 1));
+-            
desc.planes.push_back(core::pixel_format_desc::plane(dummy_pict.linesize[1], 
h2, 1));
+-            
desc.planes.push_back(core::pixel_format_desc::plane(dummy_pict.linesize[2], 
h2, 1));
++            desc.planes.push_back(core::pixel_format_desc::plane(linesize[0], 
height, 1));
++            desc.planes.push_back(core::pixel_format_desc::plane(linesize[1], 
h2, 1));
++            desc.planes.push_back(core::pixel_format_desc::plane(linesize[2], 
h2, 1));
+ 
+             if (desc.format == core::pixel_format::ycbcra)
+-                
desc.planes.push_back(core::pixel_format_desc::plane(dummy_pict.linesize[3], 
height, 1));
++                
desc.planes.push_back(core::pixel_format_desc::plane(linesize[3], height, 1));
+ 
++            av_freep(&pointers[0]);
+             return desc;
+         }
+         default:
+             desc.format = core::pixel_format::invalid;
++            av_freep(&pointers[0]);
+             return desc;
+     }
+ }
+Index: casparcg-server-2.2.0+dfsg/src/modules/ffmpeg/ffmpeg.cpp
+===================================================================
+--- casparcg-server-2.2.0+dfsg.orig/src/modules/ffmpeg/ffmpeg.cpp
++++ casparcg-server-2.2.0+dfsg/src/modules/ffmpeg/ffmpeg.cpp
+@@ -52,37 +52,6 @@
+ }
+ 
+ namespace caspar { namespace ffmpeg {
+-int ffmpeg_lock_callback(void** mutex, enum AVLockOp op)
+-{
+-    if (!mutex)
+-        return 0;
+-
+-    auto my_mutex = reinterpret_cast<std::recursive_mutex*>(*mutex);
+-
+-    switch (op) {
+-        case AV_LOCK_CREATE: {
+-            *mutex = new std::recursive_mutex();
+-            break;
+-        }
+-        case AV_LOCK_OBTAIN: {
+-            if (my_mutex)
+-                my_mutex->lock();
+-            break;
+-        }
+-        case AV_LOCK_RELEASE: {
+-            if (my_mutex)
+-                my_mutex->unlock();
+-            break;
+-        }
+-        case AV_LOCK_DESTROY: {
+-            delete my_mutex;
+-            *mutex = nullptr;
+-            break;
+-        }
+-    }
+-    return 0;
+-}
+-
+ static void sanitize(uint8_t* line)
+ {
+     while (*line) {
+@@ -141,13 +110,9 @@
+ 
+ void init(core::module_dependencies dependencies)
+ {
+-    av_lockmgr_register(ffmpeg_lock_callback);
+     av_log_set_callback(log_for_thread);
+ 
+-    avfilter_register_all();
+-    av_register_all();
+     avformat_network_init();
+-    avcodec_register_all();
+     avdevice_register_all();
+ 
+     dependencies.consumer_registry->register_consumer_factory(L"FFmpeg 
Consumer", create_consumer);
+@@ -160,6 +125,5 @@
+ {
+     // avfilter_uninit();
+     avformat_network_deinit();
+-    av_lockmgr_register(nullptr);
+ }
+ }} // namespace caspar::ffmpeg
+Index: 
casparcg-server-2.2.0+dfsg/src/modules/ffmpeg/consumer/ffmpeg_consumer.cpp
+===================================================================
+--- 
casparcg-server-2.2.0+dfsg.orig/src/modules/ffmpeg/consumer/ffmpeg_consumer.cpp
++++ casparcg-server-2.2.0+dfsg/src/modules/ffmpeg/consumer/ffmpeg_consumer.cpp
+@@ -58,6 +58,7 @@
+ #include <libavfilter/buffersink.h>
+ #include <libavfilter/buffersrc.h>
+ #include <libavformat/avformat.h>
++#include <libavutil/channel_layout.h>
+ #include <libavutil/opt.h>
+ #include <libavutil/pixfmt.h>
+ #include <libavutil/samplefmt.h>
+Index: 
casparcg-server-2.2.0+dfsg/src/modules/decklink/producer/decklink_producer.cpp
+===================================================================
+--- 
casparcg-server-2.2.0+dfsg.orig/src/modules/decklink/producer/decklink_producer.cpp
++++ 
casparcg-server-2.2.0+dfsg/src/modules/decklink/producer/decklink_producer.cpp
+@@ -63,6 +63,7 @@
+ #include <libavfilter/buffersink.h>
+ #include <libavfilter/buffersrc.h>
+ #include <libavformat/avformat.h>
++#include <libavutil/channel_layout.h>
+ #include <libavutil/opt.h>
+ #include <libavutil/pixfmt.h>
+ #include <libavutil/samplefmt.h>
diff -Nru casparcg-server-2.2.0+dfsg/debian/patches/series 
casparcg-server-2.2.0+dfsg/debian/patches/series
--- casparcg-server-2.2.0+dfsg/debian/patches/series    2021-11-20 
13:05:06.000000000 -0800
+++ casparcg-server-2.2.0+dfsg/debian/patches/series    2022-07-20 
21:39:55.000000000 -0700
@@ -1,1 +1,2 @@
 cmake-ftbfs.patch
+ffmpeg-5.0.patch

--- End Message ---
--- Begin Message ---
Source: casparcg-server
Source-Version: 2.3.3+dfsg-1
Done: Filip Hanes <[email protected]>

We believe that the bug you reported is fixed in the latest version of
casparcg-server, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Filip Hanes <[email protected]> (supplier of updated casparcg-server package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Tue, 31 Aug 2022 16:35:00 +0100
Source: casparcg-server
Architecture: source
Version: 2.3.3+dfsg-1
Distribution: unstable
Urgency: medium
Maintainer: Filip Hanes <[email protected]>
Changed-By: Filip Hanes <[email protected]>
Closes: 959106 959124 1015780
Changes:
 casparcg-server (2.3.3+dfsg-1) unstable; urgency=medium
 .
   [Filip Hanes]
   * New upstream version 2.3.3+dfsg.
   * New maintainer (Closes: #959124)
   * Added 0001-fix-missing-thread-includes-1396.patch
   * Added 0002-ffmpeg-5.0-1419.patch (Closes: #1015780)
   * Added 0003-fix-boost-1.73-ftbfs-1397.patch
   * Added 0004-fix-shader-frag.patch
   * Added 1001-cmake-ftbfs.patch
   * Added 1002-arm64-compatibility.patch
   * Added missing build dependency libboost-system-dev.
   * Added build dependency libsimde-dev for arm64 compatibility
   * Remove build dependency libgconf2-dev (Closes: #959106)
   * Update Maintainer, Uploaders, Standards-Version in d/control
   * Make ffmpeg5.0 patch compatible with ffmpeg 4.3
Checksums-Sha1:
 e8efb060bae5f66a7e202700480b34b4e08c05c1 2790 casparcg-server_2.3.3+dfsg-1.dsc
 32b5a0c2ca628a8e2d57f9768126682df427670f 703144 
casparcg-server_2.3.3+dfsg.orig.tar.xz
 55b1f572ed8b7c128f42d334280f204e3f377b1e 10832 
casparcg-server_2.3.3+dfsg-1.debian.tar.xz
 744f839f22aad22e23e6a17d91e44cfbbf3466f7 19134 
casparcg-server_2.3.3+dfsg-1_source.buildinfo
Checksums-Sha256:
 ce3a2ee865fe964d66ad059845299755a213c3c0a4c208a7dac3171ce1ef32b2 2790 
casparcg-server_2.3.3+dfsg-1.dsc
 2aea399c2fc04245a633298315d8dd20fbe0f83a283b062b772db208ba2b2d64 703144 
casparcg-server_2.3.3+dfsg.orig.tar.xz
 f279dfaa9c75345bfc1b58573f58843396ee15c3fd3d4781a11d1873aeb1fa2a 10832 
casparcg-server_2.3.3+dfsg-1.debian.tar.xz
 603a3b632099ed7889ab66a48750ead9b37fa3b148de84741f0e83f1e5b0f6aa 19134 
casparcg-server_2.3.3+dfsg-1_source.buildinfo
Files:
 c76df133b81e57bfd7701cf0735dbb06 2790 contrib/video optional 
casparcg-server_2.3.3+dfsg-1.dsc
 4d1432ccaed163d81dc2e02dae308d89 703144 contrib/video optional 
casparcg-server_2.3.3+dfsg.orig.tar.xz
 9851792b8c56bcaa74a9025a04062596 10832 contrib/video optional 
casparcg-server_2.3.3+dfsg-1.debian.tar.xz
 2e272cddfd42c12258350eafbe491dd2 19134 contrib/video optional 
casparcg-server_2.3.3+dfsg-1_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCAAdFiEERqLf4owIeylOb9kkgSgKoIe6+w4FAmMPdhsACgkQgSgKoIe6
+w5NvRAAjxqaXrnPURVAubwaTAyyltp6ws96mFRNdt1kbYoAZzlt+nZu6FgJyCq3
D3IOsVScON8aPk4NMB7c5jAIAIEku+lNtE56k31gObrAMEga8pFvNpnoxn2gm+gZ
CkBv2zoATEYl7CPASFzaJyk7ADzoQ7qgzwBorOr8XkaCH5dgRzJdDLMxqgcjbcOZ
Dfae9Fw34sInP28nMbbFJdQRqef7zg7bMCouVFnCoBSDiLbN2HyAgJl33NJxMWFw
ixlibV2MOyFHc/pcLCRj0QjwU3X94NiGCtDs1sGCZbf+XVp+xPfvAFZEVrq1e+ab
qupSXi6ZVISswJ5WNz6QUFMV6Xy5vUF5YZzCeq951Co0M8Sa13hunEsiQpYjck0c
Fu+drmp/oXH6JGFfgkc1Xvc/SnGoRXChAGeMXA0oRaagxmFwqHJyqjEQ/68oARs1
s8itr44v1wuHXdJWSsafef5wvySncEucrg+VEv8LRG6BxNbr0RNN9oYS0NMCUOnT
/hieldw8QR2wECuwciwo1FOS+pfmE/GcBH1cMZ10sA4iWW/sqDQtLASQ+aUWJPnh
3MULaq8AZ/5nps6/WJAeH25X/3tkkWwnmWX7TJnqyy3fmLWc2+varnPpiOQXJVd2
M190GCcSQ8f3Qt5OMV0F04EHb/+rTKbW0EPBKdn3uSpZj8lKcLY=
=nlUj
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to