summaryrefslogtreecommitdiff
path: root/pcr/zoneminder/zoneminder-1.25.0-ffmpeg.patch
blob: 99d41ee330f284defe5c6b879b77a7af44cb42bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
diff -Naur ZoneMinder-1.25.0-a/configure.ac ZoneMinder-1.25.0-b/configure.ac
--- ZoneMinder-1.25.0-a/configure.ac	2011-08-23 09:10:32.000000000 -0600
+++ ZoneMinder-1.25.0-b/configure.ac	2013-05-06 11:17:33.860608307 -0600
@@ -95,7 +95,7 @@
 
 LDFLAGS="${FFMPEG_LIBS} $LDFLAGS"
 CFLAGS="${FFMPEG_CFLAGS} $CFLAGS"
-CPPFLAGS="${FFMPEG_CFLAGS} $CPPFLAGS"
+CPPFLAGS="${FFMPEG_CFLAGS} $CPPFLAGS -D__STDC_CONSTANT_MACROS"
 
 EXTRA_LIBS=
 AC_ARG_WITH(extralibs,
@@ -275,8 +275,7 @@
 AC_CHECK_LIB(x264,x264_predict_16x16_init)
 AC_CHECK_LIB(avutil,av_malloc,,AC_MSG_WARN(libavutil.a may be required for MPEG streaming))
 # Don't bother to warn about this one
-AC_CHECK_LIB(avcore,av_image_copy,,)
-AC_CHECK_LIB(avcodec,avcodec_init,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming))
+AC_CHECK_LIB(avcodec,avcodec_register_all,,AC_MSG_WARN(libavcodec.a is required for MPEG streaming))
 AC_CHECK_LIB(avformat,av_new_stream,,AC_MSG_WARN(libavformat.a is required for MPEG streaming))
 AC_CHECK_LIB(avdevice,avdevice_register_all,,AC_MSG_WARN(libavdevice.a may be required for MPEG streaming))
 AC_CHECK_LIB(swscale,sws_scale,,,-lswscale)
diff -Naur ZoneMinder-1.25.0-a/src/zm_ffmpeg.h ZoneMinder-1.25.0-b/src/zm_ffmpeg.h
--- ZoneMinder-1.25.0-a/src/zm_ffmpeg.h	2011-06-24 10:05:07.000000000 -0600
+++ ZoneMinder-1.25.0-b/src/zm_ffmpeg.h	2013-05-06 18:11:49.327274977 -0600
@@ -43,6 +43,11 @@
 }
 #endif
 
+#include <libavutil/avutil.h>
+#include <libavcodec/avcodec.h>
+#include <libavformat/avformat.h>
+#include <libswscale/swscale.h>
+
 #if FFMPEG_VERSION_INT == 0x000408
 #define ZM_FFMPEG_048	1
 #elif FFMPEG_VERSION_INT == 0x000409
diff -Naur ZoneMinder-1.25.0-a/src/zm_ffmpeg_camera.cpp ZoneMinder-1.25.0-b/src/zm_ffmpeg_camera.cpp
--- ZoneMinder-1.25.0-a/src/zm_ffmpeg_camera.cpp	2011-06-21 01:40:13.000000000 -0600
+++ ZoneMinder-1.25.0-b/src/zm_ffmpeg_camera.cpp	2013-05-06 19:57:08.453941643 -0600
@@ -91,7 +91,7 @@
     Info( "Priming capture from %s", mPath.c_str() );
 
     // Open the input, not necessarily a file
-    if ( av_open_input_file( &mFormatContext, mPath.c_str(), NULL, 0, NULL ) !=0 )
+    if ( avformat_open_input( &mFormatContext, mPath.c_str(), NULL, NULL ) !=0 )
         Fatal( "Unable to open input %s due to: %s", mPath.c_str(), strerror(errno) );
 
     // Locate stream info from input
@@ -122,7 +122,7 @@
         Fatal( "Can't find codec for video stream from %s", mPath.c_str() );
 
     // Open the codec
-    if ( avcodec_open( mCodecContext, mCodec ) < 0 )
+    if ( avcodec_open2( mCodecContext, mCodec, NULL ) < 0 )
         Fatal( "Unable to open codec for video stream from %s", mPath.c_str() );
 
     // Allocate space for the native video frame
diff -Naur ZoneMinder-1.25.0-a/src/zm_mpeg.cpp ZoneMinder-1.25.0-b/src/zm_mpeg.cpp
--- ZoneMinder-1.25.0-a/src/zm_mpeg.cpp	2011-05-15 14:39:06.000000000 -0600
+++ ZoneMinder-1.25.0-b/src/zm_mpeg.cpp	2013-05-06 20:00:08.923941640 -0600
@@ -130,7 +130,7 @@
 {
 	/* set the output parameters (must be done even if no
 	   parameters). */
-	if ( av_set_parameters(ofc, NULL) < 0 )
+	if ( avformat_write_header(ofc, NULL) < 0 )
 	{
 		Panic( "Invalid output format parameters" );
 	}
@@ -176,7 +176,7 @@
 		}
 
 		/* open the codec */
-		if ( avcodec_open(c, codec) < 0 )
+		if ( avcodec_open2(c, codec, NULL) < 0 )
 		{
 			Panic( "Could not open codec" );
 		}
@@ -222,7 +222,7 @@
 	if ( !(of->flags & AVFMT_NOFILE) )
 	{
 #if LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(51,2,1)
-		if ( avio_open(&ofc->pb, filename, URL_WRONLY) < 0 )
+		if ( avio_open(&ofc->pb, filename, AVIO_FLAG_WRITE) < 0 )
 #else
 		if ( url_fopen(&ofc->pb, filename, URL_WRONLY) < 0 )
 #endif
@@ -241,7 +241,7 @@
 	}
 
 	/* write the stream header, if any */
-	av_write_header(ofc);
+	avformat_write_header(ofc, NULL);
 }
 
 VideoStream::VideoStream( const char *filename, const char *format, int bitrate, double frame_rate, int colours, int width, int height )
diff -Naur ZoneMinder-1.25.0-a/src/zm_remote_camera_rtsp.cpp ZoneMinder-1.25.0-b/src/zm_remote_camera_rtsp.cpp
--- ZoneMinder-1.25.0-a/src/zm_remote_camera_rtsp.cpp	2011-06-21 03:19:10.000000000 -0600
+++ ZoneMinder-1.25.0-b/src/zm_remote_camera_rtsp.cpp	2013-05-06 20:07:40.797274975 -0600
@@ -145,7 +145,7 @@
         Panic( "Unable to locate codec %d decoder", codecContext->codec_id );
 
     // Open codec
-    if ( avcodec_open( codecContext, codec ) < 0 )
+    if ( avcodec_open2( codecContext, codec, NULL ) < 0 )
         Panic( "Can't open codec" );
 
     picture = avcodec_alloc_frame();
diff -Naur ZoneMinder-1.25.0-a/src/zm_sdp.h ZoneMinder-1.25.0-b/src/zm_sdp.h
--- ZoneMinder-1.25.0-a/src/zm_sdp.h	2011-05-15 14:39:06.000000000 -0600
+++ ZoneMinder-1.25.0-b/src/zm_sdp.h	2013-05-06 20:23:28.237274974 -0600
@@ -41,7 +41,7 @@
         int payloadType;
         const char payloadName[6];
         enum AVMediaType codecType;
-        enum CodecID codecId;
+        enum AVCodecID codecId;
         int clockRate;
         int autoChannels;
     };
@@ -50,7 +50,7 @@
     {
         const char payloadName[32];
         enum AVMediaType codecType;
-        enum CodecID codecId;
+        enum AVCodecID codecId;
         //int clockRate;
         //int autoChannels;
     };