diff options
Diffstat (limited to 'ffmpeg-5.diff')
-rw-r--r-- | ffmpeg-5.diff | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/ffmpeg-5.diff b/ffmpeg-5.diff new file mode 100644 index 000000000000..0c57f9756192 --- /dev/null +++ b/ffmpeg-5.diff @@ -0,0 +1,107 @@ +diff --color -ru a/indi-webcam/indi_webcam.cpp b/indi-webcam/indi_webcam.cpp +--- a/indi-webcam/indi_webcam.cpp 2022-01-17 05:16:50.000000000 +0100 ++++ b/indi-webcam/indi_webcam.cpp 2022-02-27 12:24:43.601908037 +0100 +@@ -125,7 +125,11 @@ + //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 @@ + 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 @@ + + 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 @@ + //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 @@ + 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 @@ + { + 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 +@@ -1668,3 +1692,4 @@ + + return true; + } ++ +diff --color -ru a/indi-webcam/indi_webcam.h b/indi-webcam/indi_webcam.h +--- a/indi-webcam/indi_webcam.h 2022-01-17 05:16:50.000000000 +0100 ++++ b/indi-webcam/indi_webcam.h 2022-02-27 12:30:56.733044539 +0100 +@@ -36,6 +36,7 @@ + #include <libavformat/avformat.h> + #include <libavutil/imgutils.h> + #include <libswscale/swscale.h> ++#include <libavutil/version.h> + + #ifdef __cplusplus + } +@@ -186,7 +187,11 @@ + 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; |