UPDATE: strigi - FFmpeg API

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

UPDATE: strigi - FFmpeg API

Brad Smith-14
Update API usage to deal with current vs new FFmpeg API.


Index: Makefile
===================================================================
RCS file: /home/cvs/ports/databases/strigi/Makefile,v
retrieving revision 1.27
diff -u -p -u -p -r1.27 Makefile
--- Makefile 25 Nov 2018 16:30:37 -0000 1.27
+++ Makefile 20 Feb 2019 02:56:21 -0000
@@ -2,7 +2,7 @@
 
 COMMENT = document indexer
 DISTNAME = strigi-0.7.8
-
+REVISION = 0
 CATEGORIES = databases devel textproc sysutils
 
 HOMEPAGE = https://www.vandenoever.info/software/strigi/
Index: patches/patch-libstreamanalyzer_plugins_endplugins_ffmpegendanalyzer_cpp
===================================================================
RCS file: /home/cvs/ports/databases/strigi/patches/patch-libstreamanalyzer_plugins_endplugins_ffmpegendanalyzer_cpp,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 patch-libstreamanalyzer_plugins_endplugins_ffmpegendanalyzer_cpp
--- patches/patch-libstreamanalyzer_plugins_endplugins_ffmpegendanalyzer_cpp 21 May 2017 00:43:52 -0000 1.1
+++ patches/patch-libstreamanalyzer_plugins_endplugins_ffmpegendanalyzer_cpp 20 Feb 2019 02:55:41 -0000
@@ -1,5 +1,7 @@
 $OpenBSD: patch-libstreamanalyzer_plugins_endplugins_ffmpegendanalyzer_cpp,v 1.1 2017/05/21 00:43:52 espie Exp $
-prevent collision with std::mutex
+
+- prevent collision with std::mutex
+- Update for newer FFmpeg API
 
 Index: libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp
 --- libstreamanalyzer/plugins/endplugins/ffmpegendanalyzer.cpp.orig
@@ -13,3 +15,32 @@ Index: libstreamanalyzer/plugins/endplug
  STRIGI_MUTEX_DEFINE(mutex);
 
  static int
+@@ -355,7 +357,7 @@ FFMPEGEndAnalyzer::analyze(AnalysisResult& ar, ::Input
+ #endif
+
+   if(fc->bit_rate)
+-    ar.addValue(factory->bitrateProperty, fc->bit_rate);
++    ar.addValue(factory->bitrateProperty, (uint32_t)fc->bit_rate);
+   else if (fc->duration!= no_bitrate && fc->duration > 0) {
+     cout<<"Trying to estimate bitrate\n";
+     int64_t size;
+@@ -412,8 +414,8 @@ FFMPEGEndAnalyzer::analyze(AnalysisResult& ar, ::Input
+         if (size_t len = strlen(p->name)) {
+           ar.addTriplet(streamuri, codecPropertyName, string(p->name, len));
+         }
+-      } else if (size_t len = strlen(codec.codec_name)) {
+-        ar.addTriplet(streamuri, codecPropertyName, string(codec.codec_name, len));
++      } else if (size_t len = strlen(avcodec_get_name(codec.codec_id))) {
++        ar.addTriplet(streamuri, codecPropertyName, string(avcodec_get_name(codec.codec_id), len));
+       }
+ /*
+ 00792     } else if (enc->codec_id == CODEC_ID_MPEG2TS) {
+@@ -486,7 +488,7 @@ FFMPEGEndAnalyzer::analyze(AnalysisResult& ar, ::Input
+           outs << stream.r_frame_rate.num / stream.r_frame_rate.den;
+           ar.addTriplet(streamuri, frameRatePropertyName, outs.str());
+         }
+-        if (codec.pix_fmt != PIX_FMT_NONE) {}//FIXME pixel format
++        if (codec.pix_fmt != AV_PIX_FMT_NONE) {}//FIXME pixel format
+       }
+      
+     }