FreeBSD Bugzilla – Attachment 177899 Details for
Bug 215240
graphics/amide: switch to modern ffmpeg
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
v0 + commit message
amide.ffmpeg2.diff (text/plain), 5.66 KB, created by
Jan Beich
on 2016-12-12 02:12:08 UTC
(
hide
)
Description:
v0 + commit message
Filename:
MIME Type:
Creator:
Jan Beich
Created:
2016-12-12 02:12:08 UTC
Size:
5.66 KB
patch
obsolete
>From ad8c75aff7f630215c83f45d3f65396153b15f90 Mon Sep 17 00:00:00 2001 >From: Jan Beich <jbeich@FreeBSD.org> >Date: Mon, 12 Dec 2016 01:57:37 +0000 >Subject: graphics/amide: switch to non-obsolete ffmpeg > >mpeg_encode.c:237:18: error: use of undeclared identifier 'CODEC_ID_MPEG4'; did you mean > 'AV_CODEC_ID_MPEG4'? > codec_type = CODEC_ID_MPEG4; > ^~~~~~~~~~~~~~ > AV_CODEC_ID_MPEG4 >/usr/local/include/libavcodec/avcodec.h:209:5: note: 'AV_CODEC_ID_MPEG4' declared here > AV_CODEC_ID_MPEG4, > ^ >mpeg_encode.c:241:16: error: use of undeclared identifier 'CODEC_ID_MPEG1VIDEO'; did you mean > 'AV_CODEC_ID_MPEG1VIDEO'? > codec_type=CODEC_ID_MPEG1VIDEO; > ^~~~~~~~~~~~~~~~~~~ > AV_CODEC_ID_MPEG1VIDEO >/usr/local/include/libavcodec/avcodec.h:195:5: note: 'AV_CODEC_ID_MPEG1VIDEO' declared here > AV_CODEC_ID_MPEG1VIDEO, > ^ >mpeg_encode.c:271:20: error: implicit declaration of function 'avcodec_alloc_frame' > [-Werror,-Wimplicit-function-declaration] > encode->picture= avcodec_alloc_frame(); > ^ >mpeg_encode.c:271:20: note: did you mean 'avcodec_send_frame'? >/usr/local/include/libavcodec/avcodec.h:4950:5: note: 'avcodec_send_frame' declared here >int avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame); > ^ >mpeg_encode.c:296:30: error: use of undeclared identifier 'PIX_FMT_YUV420P'; did you mean > 'AV_PIX_FMT_YUV420P'? > encode->context->pix_fmt = PIX_FMT_YUV420P; > ^~~~~~~~~~~~~~~ > AV_PIX_FMT_YUV420P >/usr/local/include/libavutil/pixfmt.h:62:5: note: 'AV_PIX_FMT_YUV420P' declared here > AV_PIX_FMT_YUV420P, ///< planar YUV 4:2:0, 12bpp, (1 Cr & Cb sample per 2x2 Y samples) > ^ >mpeg_encode.c:369:14: error: implicit declaration of function 'avcodec_encode_video' > [-Werror,-Wimplicit-function-declaration] > out_size = avcodec_encode_video(encode->context, encode->output_buffer, encode->output_buff... > ^ >mpeg_encode.c:369:14: note: did you mean 'avcodec_encode_video2'? >/usr/local/include/libavcodec/avcodec.h:5323:5: note: 'avcodec_encode_video2' declared here >int avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt, > ^ > >PR: ? >Approved by: madpilot (maintainer) >--- > graphics/amide/Makefile | 6 +-- > graphics/amide/files/patch-src_mpeg__encode.c | 61 +++++++++++++++++++++++++++ > 2 files changed, 63 insertions(+), 4 deletions(-) > create mode 100644 graphics/amide/files/patch-src_mpeg__encode.c > >diff --git a/graphics/amide/Makefile b/graphics/amide/Makefile >index c7c349ef8c03..6c22d3e77159 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 > >@@ -39,7 +39,7 @@ 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 +53,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-src_mpeg__encode.c b/graphics/amide/files/patch-src_mpeg__encode.c >new file mode 100644 >index 000000000000..8f463d98a412 >--- /dev/null >+++ b/graphics/amide/files/patch-src_mpeg__encode.c >@@ -0,0 +1,61 @@ >+--- src/mpeg_encode.c.orig 2014-01-23 20:13:52 UTC >++++ src/mpeg_encode.c >+@@ -234,11 +234,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 +268,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 +293,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 */ >+@@ -362,14 +362,23 @@ gpointer mpeg_encode_setup(gchar * outpu >+ gboolean mpeg_encode_frame(gpointer data, GdkPixbuf * pixbuf) { >+ encode_t * encode = data; >+ gint out_size; >++ AVPacket packet; >++ 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; >+ >+- return TRUE; >++ fwrite(encode->output_buffer, 1, packet.size, encode->output_file); >++ >++ return !!got_output; >+ }; >+ >+ /* close everything up */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
jbeich
:
maintainer-approval?
(
madpilot
)
Actions:
View
|
Diff
Attachments on
bug 215240
: 177899 |
178246