Hi,

The following diff works around a preprocessor issue in ffmpeg
that only happens on mips.

Without this, latest ffmpeg versions would fail with the following error:

In file included from libavcodec/mips/hevcdsp_init_mips.c:21:
./libavcodec/mips/hevcdsp_mips.h:35:1: error: pasting 
"ff_hevc_put_hevc_pel_pixels" and "##" does not give a valid preprocessing 
token

It also adds --disable-mipsfpu, otherwise you get "illegal instructions"
whenever using ffmpeg or its libraries.

Tested on loongson.

Index: Makefile
===================================================================
RCS file: /cvs/ports/graphics/ffmpeg/Makefile,v
retrieving revision 1.121
diff -u -p -r1.121 Makefile
--- Makefile    26 Jul 2015 07:22:15 -0000      1.121
+++ Makefile    29 Jul 2015 16:07:50 -0000
@@ -5,6 +5,7 @@ COMMENT=        audio/video converter and strea
 V=             20150723
 DISTNAME=      ffmpeg-git-${V}
 PKGNAME=       ffmpeg-${V}
+REVISION=      0
 CATEGORIES=    graphics multimedia
 MASTER_SITES=  http://comstyle.com/source/
 EXTRACT_SUFX=  .tar.xz
@@ -104,6 +105,7 @@ CONFIGURE_ARGS+= ${CONFIGURE_SHARED} \
                --disable-mips64r6 \
                --disable-mipsdspr1 \
                --disable-mipsdspr2 \
+               --disable-mipsfpu \
                --disable-msa \
                --disable-neon \
                --disable-outdev=oss \
Index: patches/patch-libavcodec_mips_hevcdsp_mips_h
===================================================================
RCS file: patches/patch-libavcodec_mips_hevcdsp_mips_h
diff -N patches/patch-libavcodec_mips_hevcdsp_mips_h
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-libavcodec_mips_hevcdsp_mips_h        29 Jul 2015 16:07:50 
-0000
@@ -0,0 +1,54 @@
+$OpenBSD$
+
+Work around
+error: pasting "ff_hevc_put_hevc_pel_pixels" and "##" does not give a valid 
preprocessing token
+
+--- libavcodec/mips/hevcdsp_mips.h.orig        Wed Jul 29 14:59:46 2015
++++ libavcodec/mips/hevcdsp_mips.h     Wed Jul 29 15:01:47 2015
+@@ -23,8 +23,9 @@
+ 
+ #include "libavcodec/hevcdsp.h"
+ 
++#define EMPTY
+ #define MC(PEL, DIR, WIDTH)                                                 \
+-void ff_hevc_put_hevc_##PEL##_##DIR####WIDTH##_8_msa(int16_t *dst,          \
++void ff_hevc_put_hevc_##PEL##_##DIR##EMPTY##WIDTH##_8_msa(int16_t *dst,     \
+                                                      uint8_t *src,          \
+                                                      ptrdiff_t src_stride,  \
+                                                      int height,            \
+@@ -102,7 +103,7 @@ MC(epel, hv, 64);
+ #undef MC
+ 
+ #define UNI_MC(PEL, DIR, WIDTH)                                               
 \
+-void ff_hevc_put_hevc_uni_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst,        
 \
++void ff_hevc_put_hevc_uni_##PEL##_##DIR##EMPTY##WIDTH##_8_msa(uint8_t *dst,   
 \
+                                                          ptrdiff_t 
dst_stride, \
+                                                          uint8_t *src,        
 \
+                                                          ptrdiff_t 
src_stride, \
+@@ -181,7 +182,7 @@ UNI_MC(epel, hv, 64);
+ #undef UNI_MC
+ 
+ #define UNI_W_MC(PEL, DIR, WIDTH)                                         \
+-void ff_hevc_put_hevc_uni_w_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst,  \
++void ff_hevc_put_hevc_uni_w_##PEL##_##DIR##EMPTY##WIDTH##_8_msa(uint8_t *dst, 
 \
+                                                            ptrdiff_t      \
+                                                            dst_stride,    \
+                                                            uint8_t *src,  \
+@@ -265,7 +266,7 @@ UNI_W_MC(epel, hv, 64);
+ #undef UNI_W_MC
+ 
+ #define BI_MC(PEL, DIR, WIDTH)                                                
 \
+-void ff_hevc_put_hevc_bi_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst,         
 \
++void ff_hevc_put_hevc_bi_##PEL##_##DIR##EMPTY##WIDTH##_8_msa(uint8_t *dst,    
 \
+                                                         ptrdiff_t dst_stride, 
 \
+                                                         uint8_t *src,         
 \
+                                                         ptrdiff_t src_stride, 
 \
+@@ -345,7 +346,7 @@ BI_MC(epel, hv, 64);
+ #undef BI_MC
+ 
+ #define BI_W_MC(PEL, DIR, WIDTH)                                              
 \
+-void ff_hevc_put_hevc_bi_w_##PEL##_##DIR####WIDTH##_8_msa(uint8_t *dst,       
 \
++void ff_hevc_put_hevc_bi_w_##PEL##_##DIR##EMPTY##WIDTH##_8_msa(uint8_t *dst,  
 \
+                                                           ptrdiff_t           
 \
+                                                           dst_stride,         
 \
+                                                           uint8_t *src,       
 \

Reply via email to