aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadpilot <madpilot@FreeBSD.org>2017-01-03 06:41:15 +0800
committermadpilot <madpilot@FreeBSD.org>2017-01-03 06:41:15 +0800
commit0a4157cbf9516696458c98b75be144c42683be51 (patch)
treef4a1e2b88b4406513e017272a8d5263d4147687d
parentc6deab5f9710c63e45299eb5c9f3b96b885bf537 (diff)
downloadfreebsd-ports-gnome-0a4157cbf9516696458c98b75be144c42683be51.tar.gz
freebsd-ports-gnome-0a4157cbf9516696458c98b75be144c42683be51.tar.zst
freebsd-ports-gnome-0a4157cbf9516696458c98b75be144c42683be51.zip
Modify amide port to use ffmpeg 3.x
Actual patch is a mix of work from subitter and my modifications based on debian patch from [1] While here, fix the DCMTK option. PR: 215240 Submitted by: jbeich Obtained From: https://anonscm.debian.org/viewvc/debian-med/trunk/packages/amide/trunk/debian/patches/libav10.patch?view=markup&pathrev=16327 [1]
-rw-r--r--graphics/amide/Makefile9
-rw-r--r--graphics/amide/files/patch-Makefile.in6
-rw-r--r--graphics/amide/files/patch-configure25
-rw-r--r--graphics/amide/files/patch-src-alignment_mutual_information.c6
-rw-r--r--graphics/amide/files/patch-src_mpeg__encode.c77
5 files changed, 104 insertions, 19 deletions
diff --git a/graphics/amide/Makefile b/graphics/amide/Makefile
index c7c349ef8c03..665f966bcfc3 100644
--- a/graphics/amide/Makefile
+++ b/graphics/amide/Makefile
@@ -2,7 +2,7 @@
PORTNAME= amide
PORTVERSION= 1.0.5
-PORTREVISION= 4
+PORTREVISION= 5
CATEGORIES= graphics
MASTER_SITES= SF
@@ -34,12 +34,13 @@ VOLPACK_DESC= Use volpack
XMEDCON_DESC= Use xmedcon
OPTIONS_SUB= yes
-DCMTK_CONFIGURE_ENABLE= libdcmdata
+DCMTK_CONFIGURE_ON= --enable-libdcmdata
+DCMTK_CONFIGURE_OFF= --enable-libdcmdata=no
DCMTK_LIB_DEPENDS= libdcmdata.so:devel/dcmtk
FAME_CONFIGURE_ENABLE= libfame
FAME_LIB_DEPENDS= libfame.so:multimedia/libfame
FFMPEG_CONFIGURE_ENABLE= ffmpeg
-FFMPEG_LIB_DEPENDS= libavcodec0.so:multimedia/ffmpeg0
+FFMPEG_LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg
GSL_CONFIGURE_ENABLE= libgsl
GSL_LIB_DEPENDS= libgsl.so:math/gsl
VOLPACK_CONFIGURE_ENABLE= libvolpack
@@ -53,8 +54,6 @@ post-patch:
${WRKSRC}/amide_config.h.in
@${REINPLACE_CMD} \
-e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
- -e 's|libavcodec|libavcodec0|g' \
- -e 's|libavutil|libavutil0|g' \
${WRKSRC}/configure
.include <bsd.port.mk>
diff --git a/graphics/amide/files/patch-Makefile.in b/graphics/amide/files/patch-Makefile.in
index b951f87fab04..08da412a6016 100644
--- a/graphics/amide/files/patch-Makefile.in
+++ b/graphics/amide/files/patch-Makefile.in
@@ -1,6 +1,6 @@
---- Makefile.in.orig 2014-01-25 23:25:32.000000000 +0100
-+++ Makefile.in 2014-01-27 13:14:16.876831395 +0100
-@@ -89,8 +89,7 @@
+--- Makefile.in.orig 2014-01-27 03:04:32 UTC
++++ Makefile.in
+@@ -89,8 +89,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/g
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
diff --git a/graphics/amide/files/patch-configure b/graphics/amide/files/patch-configure
index 8d0479577b7e..d161708f9b4b 100644
--- a/graphics/amide/files/patch-configure
+++ b/graphics/amide/files/patch-configure
@@ -1,6 +1,6 @@
---- configure.orig 2014-01-27 04:04:34.000000000 +0100
-+++ configure 2014-01-29 13:12:46.268622841 +0100
-@@ -16216,7 +16216,7 @@
+--- configure.orig 2014-01-27 03:04:34 UTC
++++ configure
+@@ -16216,7 +16216,7 @@ if test "x$ac_cv_func_bind_textdomain_co
DATADIRNAME=share
else
CATOBJEXT=.mo
@@ -9,7 +9,7 @@
fi
;;
-@@ -16226,7 +16226,7 @@
+@@ -16226,7 +16226,7 @@ fi
;;
*)
CATOBJEXT=.mo
@@ -18,7 +18,7 @@
;;
esac
fi
-@@ -16914,12 +16914,12 @@
+@@ -16914,12 +16914,12 @@ else
if test "x$ac_cv_func_bind_textdomain_codeset" = xyes; then :
DATADIRNAME=share
else
@@ -33,7 +33,7 @@
;;
esac
fi
-@@ -17612,8 +17612,8 @@
+@@ -17612,8 +17612,8 @@ else
THREAD_LIBS=""
fi
@@ -44,7 +44,16 @@
saved_libs="${LIBS}"
LIBS="${LIBS} ${AMIDE_LIBDCMDATA_LIBS}"
saved_cxxflags="${CXXFLAGS}"
-@@ -18154,6 +18154,7 @@
+@@ -17643,6 +17643,8 @@ if ac_fn_cxx_try_link "$LINENO"; then :
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libdcmdata was not found." >&5
+ $as_echo "$as_me: WARNING: libdcmdata was not found." >&2;}
++ AMIDE_LIBDCMDATA_LIBS=""
++ AMIDE_LIBDCMDATA_CFLAGS=""
+ fi
+ rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+@@ -18154,6 +18156,7 @@ $as_echo_n "checking for libfame - versi
ac_save_CFLAGS="$CFLAGS"
ac_save_LIBS="$LIBS"
CFLAGS="$CFLAGS $LIBFAME_CFLAGS"
@@ -52,7 +61,7 @@
LIBS="$LIBFAME_LIBS $LIBS"
rm -f conf.libfametest
if test "$cross_compiling" = yes; then :
-@@ -18165,6 +18166,7 @@
+@@ -18165,6 +18168,7 @@ else
#include <fame.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/graphics/amide/files/patch-src-alignment_mutual_information.c b/graphics/amide/files/patch-src-alignment_mutual_information.c
index d183a7570254..4f299e7bf312 100644
--- a/graphics/amide/files/patch-src-alignment_mutual_information.c
+++ b/graphics/amide/files/patch-src-alignment_mutual_information.c
@@ -1,5 +1,5 @@
---- src/alignment_mutual_information.c.orig 2012-01-22 17:25:06.000000000 +0100
-+++ src/alignment_mutual_information.c 2013-08-28 10:30:30.265534615 +0200
+--- src/alignment_mutual_information.c.orig 2012-01-22 16:25:06 UTC
++++ src/alignment_mutual_information.c
@@ -28,6 +28,13 @@
#include "amitk_data_set_DOUBLE_0D_SCALING.h"
#include "alignment_mutual_information.h"
@@ -14,7 +14,7 @@
/* this algorithm will calculate the amount of mutual information between two data sets in their current orientations */
/* it is a re-write of the original algorithm for purposes of improved speed. the hope is that it won't affect accuracy. */
/* rather than computing mutual information for the whole volume of data, the algorithm computes it for three orthogonal */
-@@ -209,7 +216,7 @@
+@@ -209,7 +216,7 @@ gdouble calculate_mutual_information(Ami
//g_print("\t\%i", mutual_information_array[i][j] ); // for point-wise counts
// g_print("\t\%4.3f", incremental_mi ); // for point-wise probability
diff --git a/graphics/amide/files/patch-src_mpeg__encode.c b/graphics/amide/files/patch-src_mpeg__encode.c
new file mode 100644
index 000000000000..7c1b178c2df1
--- /dev/null
+++ b/graphics/amide/files/patch-src_mpeg__encode.c
@@ -0,0 +1,77 @@
+--- src/mpeg_encode.c.orig 2014-01-23 20:13:52 UTC
++++ src/mpeg_encode.c
+@@ -143,6 +143,7 @@ static void convert_rgb_pixbuf_to_yuv(yu
+
+ #include <libavcodec/avcodec.h>
+
++#include <libavutil/frame.h>
+
+ typedef struct {
+ AVCodec *codec;
+@@ -234,11 +235,11 @@ gpointer mpeg_encode_setup(gchar * outpu
+
+ switch(type) {
+ case ENCODE_MPEG4:
+- codec_type = CODEC_ID_MPEG4;
++ codec_type = AV_CODEC_ID_MPEG4;
+ break;
+ case ENCODE_MPEG1:
+ default:
+- codec_type=CODEC_ID_MPEG1VIDEO;
++ codec_type=AV_CODEC_ID_MPEG1VIDEO;
+ break;
+ }
+
+@@ -268,7 +269,7 @@ gpointer mpeg_encode_setup(gchar * outpu
+ return NULL;
+ }
+
+- encode->picture= avcodec_alloc_frame();
++ encode->picture= av_frame_alloc();
+ if (!encode->picture) {
+ g_warning("couldn't allocate memory for encode->picture");
+ encode_free(encode);
+@@ -293,7 +294,7 @@ gpointer mpeg_encode_setup(gchar * outpu
+ encode->context->time_base= (AVRational){1,FRAMES_PER_SECOND};
+ encode->context->gop_size = 10; /* emit one intra frame every ten frames */
+ encode->context->max_b_frames=10;
+- encode->context->pix_fmt = PIX_FMT_YUV420P;
++ encode->context->pix_fmt = AV_PIX_FMT_YUV420P;
+
+ /* encoding parameters */
+ encode->context->sample_aspect_ratio= (AVRational){1,1}; /* our pixels are square */
+@@ -355,6 +356,10 @@ gpointer mpeg_encode_setup(gchar * outpu
+ encode->picture->linesize[1] = encode->context->width/2;
+ encode->picture->linesize[2] = encode->context->width/2;
+
++ encode->picture->width = xsize;
++ encode->picture->height = ysize;
++ encode->picture->format = AV_PIX_FMT_YUV420P;
++
+ return (gpointer) encode;
+ }
+
+@@ -362,12 +367,21 @@ gpointer mpeg_encode_setup(gchar * outpu
+ gboolean mpeg_encode_frame(gpointer data, GdkPixbuf * pixbuf) {
+ encode_t * encode = data;
+ gint out_size;
++ AVPacket packet = { 0 };
++ int ret, got_output = 0;
+
+ convert_rgb_pixbuf_to_yuv(encode->yuv, pixbuf);
+
+ /* encode the image */
+- out_size = avcodec_encode_video(encode->context, encode->output_buffer, encode->output_buffer_size, encode->picture);
+- fwrite(encode->output_buffer, 1, out_size, encode->output_file);
++ av_init_packet(&packet);
++ packet.data = encode->output_buffer;
++ packet.size = encode->output_buffer_size;
++ ret = avcodec_encode_video2(encode->context, &packet,
++ encode->picture, &got_output);
++ if (ret < 0)
++ return FALSE;
++
++ fwrite(packet.data, 1, packet.size, encode->output_file);
+
+ return TRUE;
+ };