[Debian-astro-maintainers] Bug#1004570: indi-webcam: diff for NMU version 1.0+20220129131520-1.1

Sebastian Ramacher sramacher at debian.org
Sun Apr 3 20:19:53 BST 2022


On 2022-04-03 21:12:17 +0200, Sebastian Ramacher wrote:
> Control: tags 1004570 + patch
> Control: tags 1004570 + pending
> 
> Dear maintainer,
> 
> I've prepared an NMU for indi-webcam (versioned as 1.0+20220129131520-1.1) and
> uploaded it to DELAYED/7. Please feel free to tell me if I
> should delay it longer.

Sorry, I forgot the -e 7.

Cheers

> 
> Cheers
> -- 
> Sebastian Ramacher

> diff -Nru indi-webcam-1.0+20220129131520/debian/changelog indi-webcam-1.0+20220129131520/debian/changelog
> --- indi-webcam-1.0+20220129131520/debian/changelog	2022-01-29 18:11:22.000000000 +0100
> +++ indi-webcam-1.0+20220129131520/debian/changelog	2022-04-03 21:09:03.000000000 +0200
> @@ -1,3 +1,10 @@
> +indi-webcam (1.0+20220129131520-1.1) unstable; urgency=medium
> +
> +  * Non-maintainer upload.
> +  * Apply upstream patch to build with ffmpeg 5.0 (Closes: #1004570)
> +
> + -- Sebastian Ramacher <sramacher at debian.org>  Sun, 03 Apr 2022 21:09:03 +0200
> +
>  indi-webcam (1.0+20220129131520-1) unstable; urgency=medium
>  
>    * build from indi-3rdparty git after release of version 1.9.4
> diff -Nru indi-webcam-1.0+20220129131520/debian/patches/ffmpeg-5.0.patch indi-webcam-1.0+20220129131520/debian/patches/ffmpeg-5.0.patch
> --- indi-webcam-1.0+20220129131520/debian/patches/ffmpeg-5.0.patch	1970-01-01 01:00:00.000000000 +0100
> +++ indi-webcam-1.0+20220129131520/debian/patches/ffmpeg-5.0.patch	2022-04-03 21:08:17.000000000 +0200
> @@ -0,0 +1,116 @@
> +From 229e795978e87fbf4d13ab14044d919f01f9c9b8 Mon Sep 17 00:00:00 2001
> +From: tentaisan <atsutomo.kotani at gmail.com>
> +Date: Sat, 12 Feb 2022 20:22:01 +0900
> +Subject: [PATCH] for ffmpeg 5.0 api changes
> +
> +https://github.com/FFmpeg/FFmpeg/blob/n5.0/doc/APIchanges#L179-L195
> +https://github.com/FFmpeg/FFmpeg/blob/n5.0/doc/APIchanges#L569-L572
> +---
> + indi-webcam/indi_webcam.cpp | 24 ++++++++++++++++++++++++
> + indi-webcam/indi_webcam.h   |  5 +++++
> + 2 files changed, 29 insertions(+)
> +
> +diff --git a/indi-webcam/indi_webcam.cpp b/indi-webcam/indi_webcam.cpp
> +index fd236d349..f79357983 100644
> +--- a/indi_webcam.cpp
> ++++ b/indi_webcam.cpp
> +@@ -125,7 +125,11 @@ void indi_webcam::findAVFoundationVideoSources()
> +     //This set of commands should open the avfoundation device to list its sources
> +     AVDictionary* options = nullptr;
> +     av_dict_set(&options,"list_devices","true",0);
> ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 0, 100)
> +     AVInputFormat *iformat = av_find_input_format("avfoundation");
> ++#else
> ++    const AVInputFormat *iformat = av_find_input_format("avfoundation");
> ++#endif
> +     avformat_open_input(&pFormatCtx,"",iformat,&options);
> +     avformat_close_input(&pFormatCtx);
> +     checkingDevices = false;
> +@@ -154,11 +158,15 @@ indi_webcam::indi_webcam()
> +   buffer = nullptr;
> +   
> +   // These calls are depreciated, but are required for some older FFMPEG distributions on Linux
> ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
> +   av_register_all();
> ++#endif
> +   //This registers all devices
> +   avdevice_register_all();
> +   //This registers all codecs
> ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 9, 100)
> +   avcodec_register_all();
> ++#endif
> + 
> +   //This call is required for the IP Camera functionality to work
> +   avformat_network_init();
> +@@ -238,7 +246,11 @@ bool indi_webcam::ConnectToSource(std::string device, std::string source, int fr
> + 
> +     AVDictionary* options = nullptr;
> +     av_dict_set(&options, "timeout", ffmpegTimeout.c_str(), 0); //Timeout for open_input and for read_frame.  VERY important.
> ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 0, 100)
> +     AVInputFormat *iformat = nullptr;
> ++#else
> ++    const AVInputFormat *iformat = nullptr;
> ++#endif
> +     if(device != "IP Camera")
> +     {
> +         //These items are not used by an IP Camera
> +@@ -506,7 +518,11 @@ bool indi_webcam::initProperties()
> + //This refreshes the input device list
> + bool indi_webcam::refreshInputDevices()
> + {
> ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 0, 100)
> +     AVInputFormat * d=nullptr;
> ++#else
> ++    const AVInputFormat * d=nullptr;
> ++#endif
> +     int i =0;
> +     int numDevices = getNumOfInputDevices();
> +     CaptureDevices = new ISwitch[numDevices + 1];
> +@@ -530,7 +546,11 @@ bool indi_webcam::refreshInputDevices()
> + int indi_webcam::getNumOfInputDevices()
> + {
> +     int i = 0;
> ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 0, 100)
> +     AVInputFormat * d=nullptr;
> ++#else
> ++    const AVInputFormat * d=nullptr;
> ++#endif
> +     while ((d = av_input_video_device_next(d)))
> +     {
> +         i++;
> +@@ -575,7 +595,11 @@ bool indi_webcam::refreshInputSources()
> +     {
> +         int nbdev=0;
> +         struct AVDeviceInfoList *devlist = nullptr;
> ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 0, 100)
> +         AVInputFormat *iformat = av_find_input_format(videoDevice.c_str());
> ++#else
> ++        const AVInputFormat *iformat = av_find_input_format(videoDevice.c_str());
> ++#endif
> +         nbdev=avdevice_list_input_sources(iformat, nullptr, nullptr, &devlist);
> + 
> +         //For this case the source list function is not implemented, we have to just list them by number
> +diff --git a/indi-webcam/indi_webcam.h b/indi-webcam/indi_webcam.h
> +index 57b8fd510..757c42064 100644
> +--- a/indi_webcam.h
> ++++ b/indi_webcam.h
> +@@ -36,6 +36,7 @@ extern "C" {
> + #include <libavformat/avformat.h>
> + #include <libavutil/imgutils.h>
> + #include <libswscale/swscale.h>
> ++#include <libavutil/version.h>
> + 
> + #ifdef __cplusplus
> + }
> +@@ -186,7 +187,11 @@ class indi_webcam : public INDI::CCD
> +     AVFormatContext *pFormatCtx;
> +     int              videoStream;
> +     AVCodecContext  *pCodecCtx;
> ++#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 0, 100)
> +     AVCodec         *pCodec;
> ++#else
> ++    const AVCodec         *pCodec;
> ++#endif
> +     AVFrame         *pFrame;
> +     AVFrame         *pFrameOUT;
> +     AVDictionary *optionsDict;
> diff -Nru indi-webcam-1.0+20220129131520/debian/patches/series indi-webcam-1.0+20220129131520/debian/patches/series
> --- indi-webcam-1.0+20220129131520/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
> +++ indi-webcam-1.0+20220129131520/debian/patches/series	2022-04-03 21:08:37.000000000 +0200
> @@ -0,0 +1 @@
> +ffmpeg-5.0.patch




-- 
Sebastian Ramacher



More information about the Debian-astro-maintainers mailing list