[145941] trunk/dports/multimedia/transcode

devans at macports.org devans at macports.org
Sun Feb 21 21:59:19 PST 2016


Revision: 145941
          https://trac.macports.org/changeset/145941
Author:   devans at macports.org
Date:     2016-02-21 21:59:19 -0800 (Sun, 21 Feb 2016)
Log Message:
-----------
transcode: patch for ffmpeg 3.0 compatibility, no need to increment revision.

Modified Paths:
--------------
    trunk/dports/multimedia/transcode/Portfile

Added Paths:
-----------
    trunk/dports/multimedia/transcode/files/patch-ffmpeg-3.0.diff

Modified: trunk/dports/multimedia/transcode/Portfile
===================================================================
--- trunk/dports/multimedia/transcode/Portfile	2016-02-22 01:28:34 UTC (rev 145940)
+++ trunk/dports/multimedia/transcode/Portfile	2016-02-22 05:59:19 UTC (rev 145941)
@@ -53,7 +53,8 @@
                 patch-encode-Makefile.in.diff \
                 patch-ffmpeg-2.0.diff \
                 patch-ffmpeg-2.4.diff \
-                patch-freetype-2.5.1.diff
+                patch-freetype-2.5.1.diff \
+                patch-ffmpeg-3.0.diff
 
 configure.args  --disable-mmx \
                 --enable-libmpeg2 \

Added: trunk/dports/multimedia/transcode/files/patch-ffmpeg-3.0.diff
===================================================================
--- trunk/dports/multimedia/transcode/files/patch-ffmpeg-3.0.diff	                        (rev 0)
+++ trunk/dports/multimedia/transcode/files/patch-ffmpeg-3.0.diff	2016-02-22 05:59:19 UTC (rev 145941)
@@ -0,0 +1,371 @@
+diff -ur export.orig/aud_aux.c export/aud_aux.c
+--- export.orig/aud_aux.c	2016-02-21 21:08:41.000000000 -0800
++++ export/aud_aux.c	2016-02-21 21:10:16.000000000 -0800
+@@ -326,10 +326,10 @@
+ 
+     switch (o_codec) {
+       case   0x50:
+-        codeid = CODEC_ID_MP2;
++        codeid = AV_CODEC_ID_MP2;
+         break;
+       case 0x2000:
+-        codeid = CODEC_ID_AC3;
++        codeid = AV_CODEC_ID_AC3;
+         break;
+       default:
+         tc_warn("cannot init ffmpeg with %x", o_codec);
+@@ -363,7 +363,7 @@
+     TC_UNLOCK_LIBAVCODEC;
+     if (ret < 0) {
+         tc_warn("tc_audio_init_ffmpeg: could not open %s codec !",
+-                (codeid == CODEC_ID_MP2) ?"mpa" :"ac3");
++                (codeid == AV_CODEC_ID_MP2) ?"mpa" :"ac3");
+         return(TC_EXPORT_ERROR);
+     }
+ 
+diff -ur export.orig/export_ffmpeg.c export/export_ffmpeg.c
+--- export.orig/export_ffmpeg.c	2016-02-21 21:08:41.000000000 -0800
++++ export/export_ffmpeg.c	2016-02-21 21:12:19.000000000 -0800
+@@ -490,7 +490,7 @@
+     lavc_venc_frame   = avcodec_alloc_frame();
+ 
+     lavc_convert_frame= avcodec_alloc_frame();
+-    size = avpicture_get_size(PIX_FMT_RGB24, vob->ex_v_width, vob->ex_v_height);
++    size = avpicture_get_size(AV_PIX_FMT_RGB24, vob->ex_v_width, vob->ex_v_height);
+     enc_buffer = tc_malloc(size);
+ 
+     if (lavc_venc_context == NULL || !enc_buffer || !lavc_convert_frame) {
+@@ -1102,7 +1102,7 @@
+     lavc_venc_context->prediction_method = lavc_param_prediction_method;
+ 
+     if(is_huffyuv)
+-        lavc_venc_context->pix_fmt = PIX_FMT_YUV422P;
++        lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV422P;
+     else
+     {
+         switch(pix_fmt)
+@@ -1111,18 +1111,18 @@
+             case CODEC_RGB:
+             {
+                 if(is_mjpeg)
+-                    lavc_venc_context->pix_fmt = PIX_FMT_YUVJ420P;
++                    lavc_venc_context->pix_fmt = AV_PIX_FMT_YUVJ420P;
+                 else
+-                    lavc_venc_context->pix_fmt = PIX_FMT_YUV420P;
++                    lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV420P;
+                 break;
+             }
+ 
+             case CODEC_YUV422:
+             {
+                 if(is_mjpeg)
+-                    lavc_venc_context->pix_fmt = PIX_FMT_YUVJ422P;
++                    lavc_venc_context->pix_fmt = AV_PIX_FMT_YUVJ422P;
+                 else
+-                    lavc_venc_context->pix_fmt = PIX_FMT_YUV422P;
++                    lavc_venc_context->pix_fmt = AV_PIX_FMT_YUV422P;
+                 break;
+             }
+ 
+@@ -1606,7 +1606,7 @@
+ 	        	YUV_INIT_PLANES(src, param->buffer, IMG_YUV_DEFAULT,
+ 			                	lavc_venc_context->width, lavc_venc_context->height);
+                 avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
+-                               PIX_FMT_YUV422P, lavc_venc_context->width,
++                               AV_PIX_FMT_YUV422P, lavc_venc_context->width,
+                                lavc_venc_context->height);
+         		/* FIXME: can't use tcv_convert (see decode_lavc.c) */
+                 ac_imgconvert(src, IMG_YUV_DEFAULT,
+@@ -1636,7 +1636,7 @@
+ 		                		lavc_venc_context->width,
+                                 lavc_venc_context->height);
+                 avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
+-                               PIX_FMT_YUV420P, lavc_venc_context->width,
++                               AV_PIX_FMT_YUV420P, lavc_venc_context->width,
+                                lavc_venc_context->height);
+                 ac_imgconvert(src, IMG_YUV422P,
+                               lavc_venc_frame->data, IMG_YUV420P,
+@@ -1647,7 +1647,7 @@
+ 
+         case CODEC_RGB:
+             avpicture_fill((AVPicture *)lavc_venc_frame, img_buffer,
+-                           PIX_FMT_YUV420P, lavc_venc_context->width,
++                           AV_PIX_FMT_YUV420P, lavc_venc_context->width,
+                            lavc_venc_context->height);
+     	    ac_imgconvert(&param->buffer, IMG_RGB_DEFAULT,
+                               lavc_venc_frame->data, IMG_YUV420P,
+diff -ur import.orig/import_ffmpeg.c import/import_ffmpeg.c
+--- import.orig/import_ffmpeg.c	2016-02-21 21:25:39.000000000 -0800
++++ import/import_ffmpeg.c	2016-02-21 21:28:47.000000000 -0800
+@@ -59,51 +59,51 @@
+ 
+ // fourCC to ID mapping taken from MPlayer's codecs.conf
+ static struct ffmpeg_codec ffmpeg_codecs[] = {
+-  {CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41",
++  {AV_CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41",
+     {"MP41", "DIV1", ""}},
+-  {CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42",
++  {AV_CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42",
+     {"MP42", "DIV2", ""}},
+-  {CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4",
++  {AV_CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4",
+     {"DIV3", "DIV5", "AP41", "MPG3", "MP43", ""}},
+-  {CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4",
++  {AV_CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4",
+     {"DIVX", "XVID", "MP4S", "M4S2", "MP4V", "UMP4", "DX50", ""}},
+-  {CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg",
++  {AV_CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg",
+     {"MJPG", "AVRN", "AVDJ", "JPEG", "MJPA", "JFIF", ""}},
+-  {CODEC_ID_MPEG1VIDEO, TC_CODEC_MPG1, "mpeg1video",
++  {AV_CODEC_ID_MPEG1VIDEO, TC_CODEC_MPG1, "mpeg1video",
+     {"MPG1", ""}},
+-  {CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo",
++  {AV_CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo",
+     {"DVSD", ""}},
+-  {CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1",
++  {AV_CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1",
+     {"WMV1", ""}},
+-  {CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2",
++  {AV_CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2",
+     {"WMV2", ""}},
+-  {CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu",
++  {AV_CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu",
+     {"HFYU", ""}},
+-  {CODEC_ID_H263I, TC_CODEC_H263I, "h263i",
++  {AV_CODEC_ID_H263I, TC_CODEC_H263I, "h263i",
+     {"I263", ""}},
+-  {CODEC_ID_H263P, TC_CODEC_H263P, "h263p",
++  {AV_CODEC_ID_H263P, TC_CODEC_H263P, "h263p",
+     {"H263", "U263", "VIV1", ""}},
+-  {CODEC_ID_H264, TC_CODEC_H264, "h264",
++  {AV_CODEC_ID_H264, TC_CODEC_H264, "h264",
+     {"H264", "h264", "X264", "x264", "avc1", ""}},
+-  {CODEC_ID_RV10, TC_CODEC_RV10, "rv10",
++  {AV_CODEC_ID_RV10, TC_CODEC_RV10, "rv10",
+     {"RV10", "RV13", ""}},
+-  {CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1",
++  {AV_CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1",
+     {"SVQ1", ""}},
+-  {CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3",
++  {AV_CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3",
+     {"SVQ3", ""}},
+-  {CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video",
++  {AV_CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video",
+     {"MPG2", ""}},
+-  {CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG, "mpeg2video",
++  {AV_CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG, "mpeg2video",
+     {"MPG2", ""}},
+-  {CODEC_ID_ASV1, TC_CODEC_ASV1, "asv1",
++  {AV_CODEC_ID_ASV1, TC_CODEC_ASV1, "asv1",
+     {"ASV1", ""}},
+-  {CODEC_ID_ASV2, TC_CODEC_ASV2, "asv2",
++  {AV_CODEC_ID_ASV2, TC_CODEC_ASV2, "asv2",
+     {"ASV2", ""}},
+-  {CODEC_ID_FFV1, TC_CODEC_FFV1, "ffv1",
++  {AV_CODEC_ID_FFV1, TC_CODEC_FFV1, "ffv1",
+     {"FFV1", ""}},
+-  {CODEC_ID_RAWVIDEO, TC_CODEC_YUV420P, "raw",
++  {AV_CODEC_ID_RAWVIDEO, TC_CODEC_YUV420P, "raw",
+     {"I420", "IYUV", ""}},
+-  {CODEC_ID_RAWVIDEO, TC_CODEC_YUV422P, "raw",
++  {AV_CODEC_ID_RAWVIDEO, TC_CODEC_YUV422P, "raw",
+     {"Y42B", ""}},
+   {0, TC_CODEC_UNKNOWN, NULL, {""}}};
+ 
+@@ -324,13 +324,13 @@
+     // XXX: some codecs need extra data
+     switch (codec->id)
+     {
+-      case CODEC_ID_MJPEG: extra_data_size  = 28; break;
+-      case CODEC_ID_LJPEG: extra_data_size  = 28; break;
+-      case CODEC_ID_HUFFYUV: extra_data_size = 1000; break;
+-      case CODEC_ID_ASV1: extra_data_size = 8; break;
+-      case CODEC_ID_ASV2: extra_data_size = 8; break;
+-      case CODEC_ID_WMV1: extra_data_size = 4; break;
+-      case CODEC_ID_WMV2: extra_data_size = 4; break;
++      case AV_CODEC_ID_MJPEG: extra_data_size  = 28; break;
++      case AV_CODEC_ID_LJPEG: extra_data_size  = 28; break;
++      case AV_CODEC_ID_HUFFYUV: extra_data_size = 1000; break;
++      case AV_CODEC_ID_ASV1: extra_data_size = 8; break;
++      case AV_CODEC_ID_ASV2: extra_data_size = 8; break;
++      case AV_CODEC_ID_WMV1: extra_data_size = 4; break;
++      case AV_CODEC_ID_WMV2: extra_data_size = 4; break;
+       default: extra_data_size = 0; break;
+     }
+ 
+@@ -360,7 +360,7 @@
+         frame_size = x_dim*y_dim + 2*UV_PLANE_SIZE(IMG_YUV_DEFAULT,x_dim,y_dim);
+ 
+ 	// we adapt the color space
+-        if(codec->id == CODEC_ID_MJPEG) {
++        if(codec->id == AV_CODEC_ID_MJPEG) {
+ 	  enable_levels_filter();
+         }
+         break;
+@@ -434,7 +434,7 @@
+       }
+ 
+       // we adapt the color space
+-      if(codec->id == CODEC_ID_MJPEG) {
++      if(codec->id == AV_CODEC_ID_MJPEG) {
+         enable_levels_filter();
+       }
+ 
+@@ -504,13 +504,13 @@
+       int bkey = 0;
+ 
+       // check for keyframes
+-      if (codec->id == CODEC_ID_MSMPEG4V3) {
++      if (codec->id == AV_CODEC_ID_MSMPEG4V3) {
+ 	if (divx3_is_key(buffer)) bkey = 1;
+       }
+-      else if (codec->id == CODEC_ID_MPEG4) {
++      else if (codec->id == AV_CODEC_ID_MPEG4) {
+ 	if (mpeg4_is_key(buffer, bytes_read)) bkey = 1;
+       }
+-      else if (codec->id == CODEC_ID_MJPEG) {
++      else if (codec->id == AV_CODEC_ID_MJPEG) {
+ 	bkey = 1;
+       }
+ 
+@@ -580,8 +580,8 @@
+ 
+     // Convert avcodec image to our internal YUV or RGB format
+     switch (lavc_dec_context->pix_fmt) {
+-      case PIX_FMT_YUVJ420P:
+-      case PIX_FMT_YUV420P:
++      case AV_PIX_FMT_YUVJ420P:
++      case AV_PIX_FMT_YUV420P:
+         src_fmt = IMG_YUV420P;
+         YUV_INIT_PLANES(src_planes, frame, src_fmt,
+                         lavc_dec_context->width, lavc_dec_context->height);
+@@ -612,7 +612,7 @@
+ 	}
+         break;
+ 
+-      case PIX_FMT_YUV411P:
++      case AV_PIX_FMT_YUV411P:
+         src_fmt = IMG_YUV411P;
+         YUV_INIT_PLANES(src_planes, frame, src_fmt,
+                         lavc_dec_context->width, lavc_dec_context->height);
+@@ -640,8 +640,8 @@
+         }
+         break;
+ 
+-      case PIX_FMT_YUVJ422P:
+-      case PIX_FMT_YUV422P:
++      case AV_PIX_FMT_YUVJ422P:
++      case AV_PIX_FMT_YUV422P:
+         src_fmt = IMG_YUV422P;
+         YUV_INIT_PLANES(src_planes, frame, src_fmt,
+                         lavc_dec_context->width, lavc_dec_context->height);
+@@ -669,8 +669,8 @@
+         }
+ 	break;
+ 
+-      case PIX_FMT_YUVJ444P:
+-      case PIX_FMT_YUV444P:
++      case AV_PIX_FMT_YUVJ444P:
++      case AV_PIX_FMT_YUV444P:
+         src_fmt = IMG_YUV444P;
+         YUV_INIT_PLANES(src_planes, frame, src_fmt,
+                         lavc_dec_context->width, lavc_dec_context->height);
+diff -ur import.orig/decode_lavc.c import/decode_lavc.c
+--- import.orig/decode_lavc.c	2016-02-21 21:38:42.000000000 -0800
++++ import/decode_lavc.c	2016-02-21 21:40:38.000000000 -0800
+@@ -58,37 +58,37 @@
+ 
+ // fourCC to ID mapping taken from MPlayer's codecs.conf
+ static struct ffmpeg_codec ffmpeg_codecs[] = {
+-  {CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41",
++  {AV_CODEC_ID_MSMPEG4V1, TC_CODEC_ERROR, "mp41",
+     {"MP41", "DIV1", ""}},
+-  {CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42",
++  {AV_CODEC_ID_MSMPEG4V2, TC_CODEC_MP42, "mp42",
+     {"MP42", "DIV2", ""}},
+-  {CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4",
++  {AV_CODEC_ID_MSMPEG4V3, TC_CODEC_DIVX3, "msmpeg4",
+     {"DIV3", "DIV5", "AP41", "MPG3", "MP43", ""}},
+-  {CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4",
++  {AV_CODEC_ID_MPEG4, TC_CODEC_DIVX4, "mpeg4",
+     {"DIVX", "XVID", "MP4S", "M4S2", "MP4V", "UMP4", "DX50", ""}},
+-  {CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg",
++  {AV_CODEC_ID_MJPEG, TC_CODEC_MJPEG, "mjpeg",
+     {"MJPG", "AVRN", "AVDJ", "JPEG", "MJPA", "JFIF", ""}},
+-  {CODEC_ID_MPEG1VIDEO, TC_CODEC_MPEG1VIDEO, "mpeg1video",
++  {AV_CODEC_ID_MPEG1VIDEO, TC_CODEC_MPEG1VIDEO, "mpeg1video",
+     {"MPG1", ""}},
+-  {CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo",
++  {AV_CODEC_ID_DVVIDEO, TC_CODEC_DV, "dvvideo",
+     {"DVSD", ""}},
+-  {CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1",
++  {AV_CODEC_ID_WMV1, TC_CODEC_WMV1, "wmv1",
+     {"WMV1", ""}},
+-  {CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2",
++  {AV_CODEC_ID_WMV2, TC_CODEC_WMV2, "wmv2",
+     {"WMV2", ""}},
+-  {CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu",
++  {AV_CODEC_ID_HUFFYUV, TC_CODEC_HUFFYUV, "hfyu",
+     {"HFYU", ""}},
+-  {CODEC_ID_H263I, TC_CODEC_H263I, "h263i",
++  {AV_CODEC_ID_H263I, TC_CODEC_H263I, "h263i",
+     {"I263", ""}},
+-  {CODEC_ID_H263P, TC_CODEC_H263P, "h263p",
++  {AV_CODEC_ID_H263P, TC_CODEC_H263P, "h263p",
+     {"H263", "U263", "VIV1", ""}},
+-  {CODEC_ID_RV10, TC_CODEC_RV10, "rv10",
++  {AV_CODEC_ID_RV10, TC_CODEC_RV10, "rv10",
+     {"RV10", "RV13", ""}},
+-  {CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1",
++  {AV_CODEC_ID_SVQ1, TC_CODEC_SVQ1, "svq1",
+     {"SVQ1", ""}},
+-  {CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3",
++  {AV_CODEC_ID_SVQ3, TC_CODEC_SVQ3, "svq3",
+     {"SVQ3", ""}},
+-  {CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video",
++  {AV_CODEC_ID_MPEG2VIDEO, TC_CODEC_MPEG2, "mpeg2video",
+     {"MPG2", ""}},
+   {0, TC_CODEC_UNKNOWN, NULL, {""}}};
+ 
+@@ -290,8 +290,8 @@
+ 
+       // Convert avcodec image to the requested YUV or RGB format
+       switch (lavc_dec_context->pix_fmt) {
+-	case PIX_FMT_YUVJ420P:
+-	case PIX_FMT_YUV420P:
++	case AV_PIX_FMT_YUVJ420P:
++	case AV_PIX_FMT_YUV420P:
+ 	    // Remove "dead space" at right edge of planes, if any
+ 	    if (picture.linesize[0] != lavc_dec_context->width) {
+ 		int y;
+@@ -315,7 +315,7 @@
+ 			  pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT,
+ 			  lavc_dec_context->width, lavc_dec_context->height);
+ 	    break;
+-	case PIX_FMT_YUV411P:
++	case AV_PIX_FMT_YUV411P:
+ 	    if (picture.linesize[0] != lavc_dec_context->width) {
+ 		int y;
+ 		for (y = 0; y < lavc_dec_context->height; y++) {
+@@ -334,8 +334,8 @@
+ 			  pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT,
+ 			  lavc_dec_context->width, lavc_dec_context->height);
+ 	    break;
+-	case PIX_FMT_YUVJ422P:
+-	case PIX_FMT_YUV422P:
++	case AV_PIX_FMT_YUVJ422P:
++	case AV_PIX_FMT_YUV422P:
+ 	    if (picture.linesize[0] != lavc_dec_context->width) {
+ 		int y;
+ 		for (y = 0; y < lavc_dec_context->height; y++) {
+@@ -354,8 +354,8 @@
+ 			  pix_fmt==TC_CODEC_YUV420P ? IMG_YUV420P : IMG_RGB_DEFAULT,
+ 			  lavc_dec_context->width, lavc_dec_context->height);
+ 	    break;
+-	case PIX_FMT_YUVJ444P:
+-	case PIX_FMT_YUV444P:
++	case AV_PIX_FMT_YUVJ444P:
++	case AV_PIX_FMT_YUV444P:
+ 	    if (picture.linesize[0] != lavc_dec_context->width) {
+ 		int y;
+ 		for (y = 0; y < lavc_dec_context->height; y++) {
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20160221/0d9480f8/attachment-0001.html>


More information about the macports-changes mailing list