View | Details | Raw Unified | Return to bug 184406 | Differences between
and this patch

Collapse All | Expand All

(-)multimedia/motion/Makefile (-3 / +2 lines)
Lines 3-9 Link Here
3
3
4
PORTNAME=	motion
4
PORTNAME=	motion
5
PORTVERSION=	3.2.12
5
PORTVERSION=	3.2.12
6
PORTREVISION=	1
6
PORTREVISION=	2
7
CATEGORIES=	multimedia
7
CATEGORIES=	multimedia
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}%20-%20${PORTVERSION:R}/${PORTVERSION}
8
MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}%20-%20${PORTVERSION:R}/${PORTVERSION}
9
9
Lines 39-45 Link Here
39
39
40
.if ${PORT_OPTIONS:MBKTR}
40
.if ${PORT_OPTIONS:MBKTR}
41
CONFIGURE_ARGS+=--with-bktr
41
CONFIGURE_ARGS+=--with-bktr
42
CFLAGS+=	-DWITHOUT_V4L
43
.else
42
.else
44
CONFIGURE_ARGS+=--without-bktr
43
CONFIGURE_ARGS+=--without-bktr
45
.endif
44
.endif
Lines 56-62 Link Here
56
CONFIGURE_ARGS+=--without-linuxthreads
55
CONFIGURE_ARGS+=--without-linuxthreads
57
56
58
.if ${PORT_OPTIONS:MFFMPEG}
57
.if ${PORT_OPTIONS:MFFMPEG}
59
LIB_DEPENDS+=	avformat:${PORTSDIR}/multimedia/ffmpeg
58
LIB_DEPENDS+=	avformat0:${PORTSDIR}/multimedia/ffmpeg0
60
CONFIGURE_ARGS+=--with-ffmpeg=${LOCALBASE}
59
CONFIGURE_ARGS+=--with-ffmpeg=${LOCALBASE}
61
.else
60
.else
62
CONFIGURE_ARGS+=--without-ffmpeg
61
CONFIGURE_ARGS+=--without-ffmpeg
(-)multimedia/motion/files/patch-configure.in (-30 / +39 lines)
Lines 1-5 Link Here
1
--- configure.in.orig	2010-06-01 15:48:23.000000000 +0900
1
--- configure.in.orig	2010-06-01 10:48:23.000000000 +0400
2
+++ configure.in	2012-06-08 23:21:55.000000000 +0900
2
+++ configure.in	2013-12-01 12:23:10.000000000 +0400
3
@@ -316,7 +316,7 @@
3
@@ -316,7 +316,7 @@
4
 #
4
 #
5
 else if test "${FFMPEG_DIR}" = "yes"; then
5
 else if test "${FFMPEG_DIR}" = "yes"; then
Lines 9-70 Link Here
9
 
9
 
10
 	if test -f /usr/lib64/libavcodec.a -o -f /usr/lib64/libavcodec.so && test -f /usr/lib64/libavformat.a -o -f /usr/lib64/libavformat.so ; then
10
 	if test -f /usr/lib64/libavcodec.a -o -f /usr/lib64/libavcodec.so && test -f /usr/lib64/libavformat.a -o -f /usr/lib64/libavformat.so ; then
11
 		AC_MSG_RESULT(found in /usr/lib64)
11
 		AC_MSG_RESULT(found in /usr/lib64)
12
@@ -347,7 +347,7 @@
12
@@ -347,11 +347,11 @@
13
 		echo ""		
13
 		echo ""		
14
 	fi 
14
 	fi 
15
 else
15
 else
16
-	AC_MSG_CHECKING(for ffmpeg in -> [${FFMPEG_DIR}] <-)
16
-	AC_MSG_CHECKING(for ffmpeg in -> [${FFMPEG_DIR}] <-)
17
-	if test -f ${FFMPEG_DIR}/lib/libavcodec.a -o -f ${FFMPEG_DIR}/lib/libavcodec.so && test -f ${FFMPEG_DIR}/lib/libavformat.a -o -f ${FFMPEG_DIR}/lib/libavformat.so ; then
17
+	AC_MSG_CHECKING(for ffmpeg libraries in -> [${FFMPEG_DIR}] <-)
18
+	AC_MSG_CHECKING(for ffmpeg libraries in -> [${FFMPEG_DIR}] <-)
18
 	if test -f ${FFMPEG_DIR}/lib/libavcodec.a -o -f ${FFMPEG_DIR}/lib/libavcodec.so && test -f ${FFMPEG_DIR}/lib/libavformat.a -o -f ${FFMPEG_DIR}/lib/libavformat.so ; then
19
+	if test -f ${FFMPEG_DIR}/lib/ffmpeg0/libavcodec0.a -o -f ${FFMPEG_DIR}/lib/ffmpeg0/libavcodec0.so && test -f ${FFMPEG_DIR}/lib/ffmpeg0/libavformat0.a -o -f ${FFMPEG_DIR}/lib/ffmpeg0/libavformat0.so ; then
19
 		AC_MSG_RESULT(found)
20
 		AC_MSG_RESULT(found)
20
 		FFMPEG_OK="found"
21
 		FFMPEG_OK="found"
21
@@ -392,9 +392,11 @@
22
-		FFMPEG_LIB="${FFMPEG_DIR}/lib"
23
+		FFMPEG_LIB="${FFMPEG_DIR}/lib/ffmpeg0"
24
 	elif test -f ${FFMPEG_DIR}/libavcodec.a -o -f ${FFMPEG_DIR}/libavcodec.so && test -f ${FFMPEG_DIR}/libavformat.a -o -f ${FFMPEG_DIR}/libavformat.so ; then
25
 		AC_MSG_RESULT(found)
26
 		FFMPEG_LIB="${FFMPEG_DIR}"
27
@@ -392,9 +392,10 @@
22
 	elif test -f ${FFMPEG_DIR}/include/libavformat/avformat.h; then
28
 	elif test -f ${FFMPEG_DIR}/include/libavformat/avformat.h; then
23
 		AC_MSG_RESULT(found ${FFMPEG_DIR}/include/libavformat/avformat.h)
29
 		AC_MSG_RESULT(found ${FFMPEG_DIR}/include/libavformat/avformat.h)
24
 		FFMPEG_CFLAGS="-I${FFMPEG_DIR}/include -DFFMPEG_NEW_INCLUDES"
30
 		FFMPEG_CFLAGS="-I${FFMPEG_DIR}/include -DFFMPEG_NEW_INCLUDES"
25
+		AVFORMAT="-I${FFMPEG_DIR}/include/libavformat"
31
-    elif test -f ${FFMPEG_DIR}/include/ffmpeg/libavformat/avformat.h; then
26
     elif test -f ${FFMPEG_DIR}/include/ffmpeg/libavformat/avformat.h; then
32
-        AC_MSG_RESULT(found ${FFMPEG_DIR}/include/ffmpeg/libavformat/avformat.h)
27
         AC_MSG_RESULT(found ${FFMPEG_DIR}/include/ffmpeg/libavformat/avformat.h)
33
-        FFMPEG_CFLAGS="-I${FFMPEG_DIR}/include/ffmpeg -DFFMPEG_NEW_INCLUDES" 
28
         FFMPEG_CFLAGS="-I${FFMPEG_DIR}/include/ffmpeg -DFFMPEG_NEW_INCLUDES" 
34
+    elif test -f ${FFMPEG_DIR}/include/ffmpeg0/libavformat/avformat.h; then
29
+	AVFORMAT="-I${FFMPEG_DIR}/include/ffmpeg/libavformat"
35
+        AC_MSG_RESULT(found ${FFMPEG_DIR}/include/ffmpeg0/libavformat/avformat.h)
36
+        FFMPEG_CFLAGS="-I${FFMPEG_DIR}/include/ffmpeg0 -DFFMPEG_NEW_INCLUDES" 
37
+	AVFORMAT="-I${FFMPEG_DIR}/include/ffmpeg0/libavformat"
30
 	else
38
 	else
31
 		AC_MSG_RESULT(not found)
39
 		AC_MSG_RESULT(not found)
32
 		FFMPEG_OK="no_found"
40
 		FFMPEG_OK="no_found"
33
@@ -423,9 +425,11 @@
41
@@ -413,7 +414,7 @@
42
 #
43
 
44
 	if  test "${FFMPEG_OK}" = "found"; then	
45
-		TEMP_LIBS="$TEMP_LIBS -L${FFMPEG_LIB} -lavformat -lavcodec -lavutil -lm -lz"
46
+		TEMP_LIBS="$TEMP_LIBS -L${FFMPEG_LIB} -lavformat0 -lavcodec0 -lavutil0 -lm -lz"
47
 		TEMP_LDFLAGS="${TEMP_LDFLAGS} -L${FFMPEG_LIB}"
48
 		TEMP_CFLAGS="${TEMP_CFLAGS} -DHAVE_FFMPEG ${FFMPEG_CFLAGS}"
49
 
50
@@ -423,7 +424,7 @@
34
 		AC_MSG_CHECKING([file_protocol is defined in ffmpeg ?])
51
 		AC_MSG_CHECKING([file_protocol is defined in ffmpeg ?])
35
 		saved_CFLAGS=$CFLAGS
52
 		saved_CFLAGS=$CFLAGS
36
 		saved_LIBS=$LIBS
53
 		saved_LIBS=$LIBS
37
-		CFLAGS="${FFMPEG_CFLAGS}"
54
-		CFLAGS="${FFMPEG_CFLAGS}"
38
+
39
+
40
+		CFLAGS="${FFMPEG_CFLAGS} ${AVFORMAT}"
55
+		CFLAGS="${FFMPEG_CFLAGS} ${AVFORMAT}"
41
 		LIBS="$TEMP_LIBS"
56
 		LIBS="$TEMP_LIBS"
42
-		
57
 		
43
+    	
44
 		AC_COMPILE_IFELSE(
58
 		AC_COMPILE_IFELSE(
45
 			[
59
@@ -751,7 +752,7 @@
46
 			#include <avformat.h>
60
 if test "${V4L}" = "no"; then
47
@@ -442,7 +446,8 @@
61
 	AC_MSG_CHECKING(for V42L support)
48
 			]
62
 	AC_MSG_RESULT(skipping)
49
 		)
63
-else
50
 		CFLAGS=$saved_CFLAGS
64
+elif test "${BKTR}" = "no"; then
51
-		LIBS=$saved_LIBS	
65
 	AC_CHECK_TYPE([struct v4l2_buffer], 
52
+		LIBS=$saved_LIBS
66
         	      [SUPPORTED_V4L2=true],
53
+       
67
              	 [SUPPORTED_V4L2=false],
54
 	fi
68
@@ -1067,6 +1068,11 @@
55
 fi	
56
 fi
57
@@ -1067,6 +1072,13 @@
58
 LIBS="${TEMP_LIBS}"
69
 LIBS="${TEMP_LIBS}"
59
 LDFLAGS="${TEMP_LDFLAGS}"
70
 LDFLAGS="${TEMP_LDFLAGS}"
60
 
71
 
61
+
62
+AC_CHECK_FUNC(avformat_alloc_context, AC_DEFINE([have_avformat_alloc_context],1,[Define to 1 if you have avformat_alloc_context support]))
72
+AC_CHECK_FUNC(avformat_alloc_context, AC_DEFINE([have_avformat_alloc_context],1,[Define to 1 if you have avformat_alloc_context support]))
63
+AC_CHECK_FUNC(av_avformat_alloc_context, AC_DEFINE([have_av_avformat_alloc_context],1,[Define to 1 if you have av_avformat_alloc_context support]))
73
+AC_CHECK_FUNC(av_avformat_alloc_context, AC_DEFINE([have_av_avformat_alloc_context],1,[Define to 1 if you have av_avformat_alloc_context support]))
64
+AC_CHECK_FUNC(av_register_protocol2, AC_DEFINE([have_av_register_protocol2],1,[Define to 1 if you have av_register_protocol2 support]))
74
+AC_CHECK_FUNC(av_register_protocol2, AC_DEFINE([have_av_register_protocol2],1,[Define to 1 if you have av_register_protocol2 support]))
65
+AC_CHECK_FUNC(av_register_protocol, AC_DEFINE([have_av_register_protocol],1,[Define to 1 if you have av_register_protocol support]))
75
+AC_CHECK_FUNC(av_register_protocol, AC_DEFINE([have_av_register_protocol],1,[Define to 1 if you have av_register_protocol support]))
66
+
76
+
67
+
68
 #
77
 #
69
 # Add the right exec path for rc scripts
78
 # Add the right exec path for rc scripts
70
 #
79
 #
(-)multimedia/motion/files/patch-ffmpeg.c (-157 lines)
Lines 1-157 Link Here
1
--- ffmpeg.c.orig	2010-06-01 15:48:23.000000000 +0900
2
+++ ffmpeg.c	2012-06-08 23:21:55.000000000 +0900
3
@@ -36,6 +36,11 @@
4
 #    endif /* __GNUC__ */
5
 #endif /* LIBAVCODEC_BUILD > 4680 */
6
 
7
+#if defined LIBAVFORMAT_VERSION_MAJOR && defined LIBAVFORMAT_VERSION_MINOR 
8
+#if LIBAVFORMAT_VERSION_MAJOR < 53 && LIBAVFORMAT_VERSION_MINOR < 45
9
+    #define GUESS_NO_DEPRECATED 
10
+#endif
11
+#endif
12
 
13
 #if LIBAVFORMAT_BUILD >= 4616
14
 /* The API for av_write_frame changed with FFmpeg version 0.4.9pre1.
15
@@ -227,11 +232,13 @@
16
     mpeg1_file_protocol.url_seek  = file_protocol.url_seek;
17
     mpeg1_file_protocol.url_close = file_protocol.url_close;
18
 
19
-    /* Register the append file protocol. */
20
-#if LIBAVFORMAT_BUILD >= (52<<16 | 31<<8)
21
+/* Register the append file protocol. */
22
+#ifdef have_av_register_protocol2
23
+    av_register_protocol2(&mpeg1_file_protocol, sizeof(mpeg1_file_protocol));
24
+#elif defined have_av_register_protocol        
25
     av_register_protocol(&mpeg1_file_protocol);
26
 #else
27
-    register_protocol(&mpeg1_file_protocol);
28
+#   warning av_register_protocolXXX missing
29
 #endif
30
 }
31
 
32
@@ -258,7 +265,11 @@
33
         /* We use "mpeg1video" for raw mpeg1 format. Using "mpeg" would
34
          * result in a muxed output file, which isn't appropriate here.
35
          */
36
-        of = guess_format("mpeg1video", NULL, NULL);
37
+#ifdef GUESS_NO_DEPRECATED
38
+        of = guess_format("mpeg1video", NULL, NULL);        
39
+#else
40
+        of = av_guess_format("mpeg1video", NULL, NULL);
41
+#endif 
42
         if (of) {
43
             /* But we want the trailer to be correctly written. */
44
             of->write_trailer = mpeg1_write_trailer;
45
@@ -270,24 +281,44 @@
46
 #endif
47
     } else if (strcmp(codec, "mpeg4") == 0) {
48
         ext = ".avi";
49
-        of = guess_format("avi", NULL, NULL);
50
+#ifdef GUESS_NO_DEPRECATED
51
+        of = guess_format("mpeg1video", NULL, NULL);
52
+#else        
53
+        of = av_guess_format("avi", NULL, NULL);
54
+#endif        
55
     } else if (strcmp(codec, "msmpeg4") == 0) {
56
         ext = ".avi";
57
-        of = guess_format("avi", NULL, NULL);
58
+#ifdef GUESS_NO_DEPRECATED
59
+        of = guess_format("mpeg1video", NULL, NULL);
60
+#else        
61
+        of = av_guess_format("avi", NULL, NULL);
62
+#endif
63
         if (of) {
64
             /* Manually override the codec id. */
65
             of->video_codec = CODEC_ID_MSMPEG4V2;
66
         }
67
     } else if (strcmp(codec, "swf") == 0) {
68
         ext = ".swf";
69
-        of = guess_format("swf", NULL, NULL);
70
+#ifdef GUESS_NO_DEPRECATED
71
+        of = guess_format("mpeg1video", NULL, NULL);
72
+#else        
73
+        of = av_guess_format("swf", NULL, NULL);
74
+#endif        
75
     } else if (strcmp(codec, "flv") == 0) {
76
         ext = ".flv";
77
-        of = guess_format("flv", NULL, NULL);
78
+#ifdef GUESS_NO_DEPRECATED
79
+        of = guess_format("mpeg1video", NULL, NULL);
80
+#else        
81
+        of = av_guess_format("flv", NULL, NULL);
82
+#endif        
83
         of->video_codec = CODEC_ID_FLV1;
84
     } else if (strcmp(codec, "ffv1") == 0) {
85
         ext = ".avi";
86
-        of = guess_format("avi", NULL, NULL);
87
+#ifdef GUESS_NO_DEPRECATED
88
+        of = guess_format("mpeg1video", NULL, NULL);
89
+#else
90
+        of = av_guess_format("avi", NULL, NULL);
91
+#endif
92
         if (of) {
93
             /* Use the FFMPEG Lossless Video codec (experimental!).
94
                Requires strict_std_compliance to be <= -2 */
95
@@ -295,7 +326,11 @@
96
         }
97
     } else if (strcmp(codec, "mov") == 0) {
98
         ext = ".mov";
99
-        of = guess_format("mov", NULL, NULL);        
100
+#ifdef GUESS_NO_DEPRECATED
101
+        of = guess_format("mpeg1video", NULL, NULL);
102
+#else        
103
+        of = av_guess_format("mov", NULL, NULL);
104
+#endif
105
     } else {
106
         motion_log(LOG_ERR, 0, "ffmpeg_video_codec option value %s is not supported", codec);
107
         return NULL;
108
@@ -340,7 +375,13 @@
109
     snprintf(ffmpeg->codec, sizeof(ffmpeg->codec), "%s", ffmpeg_video_codec);
110
 
111
     /* allocation the output media context */
112
+#ifdef have_avformat_alloc_context
113
+    ffmpeg->oc = avformat_alloc_context();
114
+#elif defined have_av_avformat_alloc_context
115
+    ffmpeg->oc = av_alloc_format_context();
116
+#else
117
     ffmpeg->oc = av_mallocz(sizeof(AVFormatContext));
118
+#endif
119
 
120
     if (!ffmpeg->oc) {
121
         motion_log(LOG_ERR, 1, "Memory error while allocating output media context");
122
@@ -377,7 +418,11 @@
123
 
124
     ffmpeg->c     = c = AVSTREAM_CODEC_PTR(ffmpeg->video_st);
125
     c->codec_id   = ffmpeg->oc->oformat->video_codec;
126
+#if LIBAVCODEC_VERSION_MAJOR < 53    
127
     c->codec_type = CODEC_TYPE_VIDEO;
128
+#else
129
+    c->codec_type = AVMEDIA_TYPE_VIDEO;
130
+#endif    
131
     is_mpeg1      = c->codec_id == CODEC_ID_MPEG1VIDEO;
132
 
133
     if (strcmp(ffmpeg_video_codec, "ffv1") == 0)
134
@@ -646,7 +691,11 @@
135
     if (ffmpeg->oc->oformat->flags & AVFMT_RAWPICTURE) {
136
         /* raw video case. The API will change slightly in the near future for that */
137
 #ifdef FFMPEG_AVWRITEFRAME_NEWAPI
138
+#if LIBAVCODEC_VERSION_MAJOR < 53        
139
         pkt.flags |= PKT_FLAG_KEY;
140
+#else
141
+        pkt.flags |= AV_PKT_FLAG_KEY;  
142
+#endif        
143
         pkt.data = (uint8_t *)pic;
144
         pkt.size = sizeof(AVPicture);
145
         ret = av_write_frame(ffmpeg->oc, &pkt);
146
@@ -667,7 +716,11 @@
147
 #ifdef FFMPEG_AVWRITEFRAME_NEWAPI
148
             pkt.pts = AVSTREAM_CODEC_PTR(ffmpeg->video_st)->coded_frame->pts;
149
             if (AVSTREAM_CODEC_PTR(ffmpeg->video_st)->coded_frame->key_frame) {
150
+#if LIBAVCODEC_VERSION_MAJOR < 53                
151
                 pkt.flags |= PKT_FLAG_KEY;
152
+#else
153
+                pkt.flags |= AV_PKT_FLAG_KEY;
154
+#endif                
155
             }
156
             pkt.data = ffmpeg->video_outbuf;
157
             pkt.size = out_size;

Return to bug 184406