packages feed

cpkg-0.2.1.0: pkgs/patches/pHash.patch

--- src/cimgffmpeg.cpp	2019-06-22 20:18:05.632517868 -0500
+++ src/cimgffmpeg.cpp	2019-06-22 20:18:45.569003435 -0500
@@ -100,12 +100,12 @@
         AVFrame *pFrame;
 
 	// Allocate video frame
-	pFrame=avcodec_alloc_frame();
+	pFrame=av_frame_alloc();
 	if (pFrame==NULL)
 	    return -1;
 
 	// Allocate an AVFrame structure
-	AVFrame *pConvertedFrame = avcodec_alloc_frame();
+	AVFrame *pConvertedFrame = av_frame_alloc();
 	if(pConvertedFrame==NULL)
 	  return -1;
 		
@@ -254,10 +254,10 @@
 	AVFrame *pFrame;
 
 	// Allocate video frame
-	pFrame=avcodec_alloc_frame();
+	pFrame=av_frame_alloc();
 		
 	// Allocate an AVFrame structure
-	AVFrame *pConvertedFrame = avcodec_alloc_frame();
+	AVFrame *pConvertedFrame = av_frame_alloc();
 	if(pConvertedFrame==NULL){
 	  return -1;
 	}
--- configure.ac	2019-06-22 21:22:10.582842002 -0500
+++ configure.ac	2019-06-22 21:21:48.962982961 -0500
@@ -122,7 +122,7 @@
 AC_DEFUN([AC_CHECK_FFMPEG],
 [
 AC_MSG_CHECKING([whether FFmpeg is present])
-AC_CHECK_LIB([avcodec], [avcodec_alloc_frame], [], [AC_MSG_ERROR([
+AC_CHECK_LIB([avutil], [av_frame_alloc], [], [AC_MSG_ERROR([
 
 *** libavcodec not found.
 You need FFmpeg. Get it at <http://ffmpeg.org/>])])
--- src/pHash.h	2019-06-23 11:31:15.678771295 -0500
+++ src/pHash.h	2019-06-23 11:31:31.754816275 -0500
@@ -47,6 +47,8 @@
 #if defined(HAVE_IMAGE_HASH) || defined(HAVE_VIDEO_HASH)
 #define cimg_debug 0
 #define cimg_display 0
+#define cimg_use_png
+#define cimg_use_jpeg
 #include "CImg.h"
 using namespace cimg_library;
 #endif
--- src/cimgffmpeg.cpp	2019-06-22 21:50:15.060403190 -0500
+++ src/cimgffmpeg.cpp	2019-06-22 21:56:50.839827371 -0500
@@ -39,11 +39,11 @@
 int ReadFrames(VFInfo *st_info, CImgList<uint8_t> *pFrameList, unsigned int low_index, unsigned int hi_index)
 {
         //target pixel format
-	PixelFormat ffmpeg_pixfmt;
+	AVPixelFormat ffmpeg_pixfmt;
 	if (st_info->pixelformat == 0)
-	    ffmpeg_pixfmt = PIX_FMT_GRAY8;
+	    ffmpeg_pixfmt = AV_PIX_FMT_GRAY8;
 	else 
-	    ffmpeg_pixfmt = PIX_FMT_RGB24;
+	    ffmpeg_pixfmt = AV_PIX_FMT_RGB24;
 
 	st_info->next_index = low_index;
 
@@ -123,7 +123,7 @@
 	int size = 0;
 	
 
-        int channels = ffmpeg_pixfmt == PIX_FMT_GRAY8 ? 1 : 3;
+        int channels = ffmpeg_pixfmt == AV_PIX_FMT_GRAY8 ? 1 : 3;
 
 	AVPacket packet;
 	int result = 1;
@@ -189,11 +189,11 @@
 
 int NextFrames(VFInfo *st_info, CImgList<uint8_t> *pFrameList)
 {
-        PixelFormat ffmpeg_pixfmt;
+        AVPixelFormat ffmpeg_pixfmt;
 	if (st_info->pixelformat == 0)
-	    ffmpeg_pixfmt = PIX_FMT_GRAY8;
+	    ffmpeg_pixfmt = AV_PIX_FMT_GRAY8;
         else 
-	    ffmpeg_pixfmt = PIX_FMT_RGB24;
+	    ffmpeg_pixfmt = AV_PIX_FMT_RGB24;
 
 	if (st_info->pFormatCtx == NULL)
 	{
@@ -287,7 +287,7 @@
 			break;
 		if(packet.stream_index == st_info->videoStream) {
 			
-		int channels = ffmpeg_pixfmt == PIX_FMT_GRAY8 ? 1 : 3;
+		int channels = ffmpeg_pixfmt == AV_PIX_FMT_GRAY8 ? 1 : 3;
  		AVPacket avpkt;
                 av_init_packet(&avpkt);
                 avpkt.data = packet.data;
--- src/cimgffmpeg.h	2019-06-23 11:47:59.046307628 -0500
+++ src/cimgffmpeg.h	2019-06-23 11:32:14.754956444 -0500
@@ -30,6 +30,8 @@
 #define cimg_display 0
 #define cimg_debug 0
 
+#define cimg_use_png
+#define cimg_use_jpeg
 #include "CImg.h"
 
 #define __STDC_CONSTANT_MACROS