mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-28 05:29:48 +00:00
- When FFMPEG=on, link to multimedia/ffmpeg.
- Respect PREFIX. - Conversion for avcodec_encode_video(). PR: ports/214199 PR: ports/214644
This commit is contained in:
parent
73cf2539ec
commit
8b33ba39e9
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=426602
@ -3,6 +3,7 @@
|
||||
|
||||
PORTNAME= netgen
|
||||
PORTVERSION= 5.3.1
|
||||
PORTREVISION= 3
|
||||
CATEGORIES= cad
|
||||
MASTER_SITES= SF/netgen-mesher/netgen-mesher/${PORTVERSION:C|\.[[:digit:]]+$||}/
|
||||
|
||||
@ -15,13 +16,13 @@ LIB_DEPENDS= libTix8.4.3.so:x11-toolkits/tix \
|
||||
OCC_BROKEN= Does not compile because of issues with cad/opencascade
|
||||
|
||||
USE_LDCONFIG= yes
|
||||
USES= gmake jpeg libtool tk:tea
|
||||
USE_GL= yes
|
||||
USE_XORG= xmu xi
|
||||
USES= gmake jpeg libtool localbase tk:tea
|
||||
USE_GL= gl glu
|
||||
USE_XORG= x11 xmu xi
|
||||
MAKE_JOBS_UNSAFE= yes
|
||||
LDFLAGS+= -L${LOCALBASE}/lib
|
||||
CPPFLAGS+= -I${LOCALBASE}/include -I${LOCALBASE}/lib/Togl-1.7
|
||||
CPPFLAGS+= -isystem ${LOCALBASE}/lib/Togl-1.7
|
||||
CONFIGURE_ARGS= --enable-jpeglib
|
||||
INSTALL_TARGET= install-strip
|
||||
|
||||
FETCH_BEFORE_ARGS+= -o ${DISTDIR}/${DISTNAME}${EXTRACT_SUFX}
|
||||
|
||||
@ -36,7 +37,7 @@ OCC_LIB_DEPENDS= libTKernel.so:cad/opencascade
|
||||
OCC_CXXFLAGS= -DOCCGEOMETRY -DHAVE_CONFIG_H -D${ARCH} -I${LOCALBASE}/include/OpenCASCADE
|
||||
OCC_CONFIGURE_ON= --enable-occ
|
||||
|
||||
FFMPEG_LIB_DEPENDS= libavcodec0.so:multimedia/ffmpeg0
|
||||
FFMPEG_LIB_DEPENDS= libavcodec.so:multimedia/ffmpeg
|
||||
FFMPEG_CONFIGURE_ON= --enable-ffmpeg
|
||||
|
||||
MACHINE= ${OPSYS:tu}
|
||||
@ -48,14 +49,11 @@ MAKE_ENV= TK_VER=${TK_VER} TCL_VER=${TCL_VER} \
|
||||
TK_INCLUDEDIR="${TK_INCLUDEDIR}" \
|
||||
MACHINE=${MACHINE} MAKE=${MAKE_CMD}
|
||||
|
||||
pre-configure:
|
||||
@${REINPLACE_CMD} -e "s|%%DATADIR%%|${DATADIR}|" \
|
||||
post-patch:
|
||||
@${REINPLACE_CMD} -e '/ngdir/s,"\.","${PREFIX}/bin",' \
|
||||
${WRKSRC}/ng/ng.tcl \
|
||||
${WRKSRC}/ng/ngappinit.cpp
|
||||
|
||||
post-configure:
|
||||
@${REINPLACE_CMD} -e "s|%%LOCALBASE%%|${LOCALBASE}|" \
|
||||
${WRKSRC}/configure
|
||||
|
||||
post-install:
|
||||
# copy some additional headers for build cad/salome-netgenplugin
|
||||
${MKDIR} ${STAGEDIR}${DATADIR}/include
|
||||
|
@ -153,15 +153,3 @@
|
||||
need_version=no
|
||||
need_lib_prefix=no
|
||||
;;
|
||||
@@ -15534,9 +15534,9 @@ fi
|
||||
ffmpegon=false
|
||||
# Check whether --enable-ffmpeg was given.
|
||||
if test "${enable_ffmpeg+set}" = set; then :
|
||||
- enableval=$enable_ffmpeg; FFMPEG_INCLUDES="-DFFMPEG -D__STDC_CONSTANT_MACROS"
|
||||
+ enableval=$enable_ffmpeg; FFMPEG_INCLUDES="-I/usr/local/include/ffmpeg0 -DFFMPEG -D__STDC_CONSTANT_MACROS"
|
||||
|
||||
- FFMPEG_LIBS="-lavutil -lavformat -lavcodec -lavutil -lswscale -lz -lbz2"
|
||||
+ FFMPEG_LIBS="-L/usr/local/lib/ffmpeg0 -lavutil0 -lavformat0 -lavcodec0 -lavutil0 -lswscale -lz -lbz2"
|
||||
|
||||
if test "$enableval" = yes; then ffmpegon=true; else ffmpegon=false; fi
|
||||
|
||||
|
@ -1,11 +0,0 @@
|
||||
--- ng/ng.tcl.orig 2014-08-29 09:54:01 UTC
|
||||
+++ ng/ng.tcl
|
||||
@@ -32,7 +32,7 @@ if { [lsearch [array names env] NETGENDI
|
||||
set ngdir $env(NETGENDIR)
|
||||
}
|
||||
if { [string length $ngdir] == 0 } {
|
||||
- set ngdir "."
|
||||
+ set ngdir "/usr/local/bin"
|
||||
}
|
||||
|
||||
set nguserdir ""
|
@ -1,11 +0,0 @@
|
||||
--- ng/ngappinit.cpp.orig 2014-08-29 09:54:01 UTC
|
||||
+++ ng/ngappinit.cpp
|
||||
@@ -149,7 +149,7 @@ int main(int argc, char ** argv)
|
||||
if (getenv ("NETGENDIR") && strlen (getenv ("NETGENDIR")))
|
||||
ngdir = getenv ("NETGENDIR");
|
||||
else
|
||||
- ngdir = ".";
|
||||
+ ngdir = "/usr/local/bin";
|
||||
|
||||
verbose = parameters.GetDefineFlag ("V");
|
||||
|
93
cad/netgen/files/patch-ng_ngpkg.cpp
Normal file
93
cad/netgen/files/patch-ng_ngpkg.cpp
Normal file
@ -0,0 +1,93 @@
|
||||
--- ng/ngpkg.cpp.orig 2014-08-29 09:54:01 UTC
|
||||
+++ ng/ngpkg.cpp
|
||||
@@ -2266,7 +2266,7 @@ namespace netgen
|
||||
static int gopsize = DEFAULT_GOP_SIZE;
|
||||
static int bframes = DEFAULT_B_FRAMES;
|
||||
static int MPGbufsize = DEFAULT_MPG_BUFSIZE;
|
||||
- static CodecID codec_id = CODEC_ID_MPEG1VIDEO;
|
||||
+ static AVCodecID codec_id = AV_CODEC_ID_MPEG1VIDEO;
|
||||
static FILE *MPGfile;
|
||||
static buffer_t buff;
|
||||
static struct SwsContext *img_convert_ctx;
|
||||
@@ -2338,7 +2338,7 @@ namespace netgen
|
||||
context->time_base = s;
|
||||
context->gop_size = gopsize;
|
||||
context->max_b_frames = bframes;
|
||||
- context->pix_fmt = PIX_FMT_YUV420P;
|
||||
+ context->pix_fmt = AV_PIX_FMT_YUV420P;
|
||||
context->flags |= CODEC_FLAG_PSNR;
|
||||
|
||||
// if( avcodec_open( context, codec ) < 0 ) {
|
||||
@@ -2351,7 +2351,7 @@ namespace netgen
|
||||
return TCL_ERROR;
|
||||
}
|
||||
|
||||
- YUVpicture = avcodec_alloc_frame();
|
||||
+ YUVpicture = av_frame_alloc();
|
||||
|
||||
YUVpicture->data[0] = buff.YUV;
|
||||
YUVpicture->data[1] = buff.YUV + PIXsize;
|
||||
@@ -2360,7 +2360,7 @@ namespace netgen
|
||||
YUVpicture->linesize[1] = nx / 2;
|
||||
YUVpicture->linesize[2] = nx / 2;
|
||||
|
||||
- RGBpicture = avcodec_alloc_frame();
|
||||
+ RGBpicture = av_frame_alloc();
|
||||
|
||||
RGBpicture->data[0] = buff.RGB;
|
||||
RGBpicture->data[1] = buff.RGB;
|
||||
@@ -2405,8 +2405,8 @@ namespace netgen
|
||||
// Convert to YUV:
|
||||
//----------------
|
||||
if( img_convert_ctx == NULL )
|
||||
- img_convert_ctx = sws_getContext( nx, ny, PIX_FMT_RGB24,
|
||||
- nx, ny, PIX_FMT_YUV420P,
|
||||
+ img_convert_ctx = sws_getContext( nx, ny, AV_PIX_FMT_RGB24,
|
||||
+ nx, ny, AV_PIX_FMT_YUV420P,
|
||||
SWS_BICUBIC, NULL, NULL, NULL );
|
||||
|
||||
if( img_convert_ctx == NULL ) {
|
||||
@@ -2420,8 +2420,15 @@ namespace netgen
|
||||
|
||||
// Encode frame:
|
||||
//--------------
|
||||
- bytes = avcodec_encode_video( context, buff.MPG,
|
||||
- MPGbufsize, YUVpicture );
|
||||
+ AVPacket pkt;
|
||||
+ av_init_packet( &pkt );
|
||||
+ pkt.data = buff.MPG;
|
||||
+ pkt.size = MPGbufsize;
|
||||
+
|
||||
+ int got_packet = 0;
|
||||
+ int ret = avcodec_encode_video2( context, &pkt, YUVpicture,
|
||||
+ &got_packet );
|
||||
+ bytes = ret ? ret : pkt.size;
|
||||
count_frames++;
|
||||
print_info( count_frames, context, bytes );
|
||||
fwrite( buff.MPG, 1, bytes, MPGfile );
|
||||
@@ -2442,8 +2449,15 @@ namespace netgen
|
||||
|
||||
// Get the delayed frames, if any:
|
||||
//--------------------------------
|
||||
+ AVPacket pkt;
|
||||
+ av_init_packet( &pkt );
|
||||
+ pkt.data = buff.MPG;
|
||||
+ pkt.size = MPGbufsize;
|
||||
+
|
||||
+ int got_packet = 0;
|
||||
for( ; bytes; ) {
|
||||
- bytes = avcodec_encode_video( context, buff.MPG, MPGbufsize, NULL );
|
||||
+ int ret = avcodec_encode_video2( context, &pkt, NULL, &got_packet );
|
||||
+ bytes = ret ? ret : pkt.size;
|
||||
count_frames++;
|
||||
print_info( count_frames, context, bytes );
|
||||
fwrite( buff.MPG, 1, bytes, MPGfile );
|
||||
@@ -2451,7 +2465,7 @@ namespace netgen
|
||||
|
||||
// Add sequence end code:
|
||||
//-----------------------
|
||||
- if( codec_id == CODEC_ID_MPEG1VIDEO ) {
|
||||
+ if( codec_id == AV_CODEC_ID_MPEG1VIDEO ) {
|
||||
buff.MPG[0] = 0x00;
|
||||
buff.MPG[1] = 0x00;
|
||||
buff.MPG[2] = 0x01;
|
Loading…
Reference in New Issue
Block a user