packages: motion/motion.spec, motion/motion-ffmpeg.patch - fixed build with...

lisu lisu at pld-linux.org
Mon Jul 11 16:02:55 CEST 2011


Author: lisu                         Date: Mon Jul 11 14:02:55 2011 GMT
Module: packages                      Tag: HEAD
---- Log message:
- fixed build with newer ffmpeg

---- Files affected:
packages/motion:
   motion.spec (1.69 -> 1.70) , motion-ffmpeg.patch (1.3 -> 1.4) 

---- Diffs:

================================================================
Index: packages/motion/motion.spec
diff -u packages/motion/motion.spec:1.69 packages/motion/motion.spec:1.70
--- packages/motion/motion.spec:1.69	Mon May 16 15:30:41 2011
+++ packages/motion/motion.spec	Mon Jul 11 16:02:50 2011
@@ -12,15 +12,16 @@
 Release:	4
 License:	GPL
 Group:		Applications/Graphics
-Source0:	http://dl.sourceforge.net/motion/%{name}-%{version}.tar.gz
+Source0:	http://downloads.sourceforge.net/motion/%{name}-%{version}.tar.gz
 # Source0-md5:	1ba0065ed50509aaffb171594c689f46
 Source1:	%{name}.init
 Source2:	%{name}.sysconfig
 Patch0:		%{name}-config.patch
+Patch1:		%{name}-ffmpeg.patch
 URL:		http://www.lavrsen.dk/twiki/bin/view/Motion/WebHome
 BuildRequires:	autoconf
 BuildRequires:	automake
-BuildRequires:	ffmpeg-devel >= 0.4.9-3.20060817
+BuildRequires:	ffmpeg-devel >= 0.7.1
 BuildRequires:	libjpeg-devel
 %{?with_mysql:BuildRequires:    mysql-devel}
 %{?with_pgsql:BuildRequires:	postgresql-devel}
@@ -64,6 +65,7 @@
 %prep
 %setup -q
 %patch0 -p1
+%patch1 -p1
 %{__sed} -i -e 's/jpeg_mem_dest/my_jpeg_mem_dest/g' picture.c
 
 %build
@@ -146,6 +148,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.70  2011/07/11 14:02:50  lisu
+- fixed build with newer ffmpeg
+
 Revision 1.69  2011/05/16 13:30:41  arekm
 - release 4
 

================================================================
Index: packages/motion/motion-ffmpeg.patch
diff -u /dev/null packages/motion/motion-ffmpeg.patch:1.4
--- /dev/null	Mon Jul 11 16:02:55 2011
+++ packages/motion/motion-ffmpeg.patch	Mon Jul 11 16:02:50 2011
@@ -0,0 +1,95 @@
+--- motion-3.2.12/ffmpeg.c.bak	2011-07-11 15:44:35.159836231 +0200
++++ motion-3.2.12/ffmpeg.c	2011-07-11 15:45:33.103336223 +0200
+@@ -229,7 +229,7 @@
+ 
+     /* Register the append file protocol. */
+ #if LIBAVFORMAT_BUILD >= (52<<16 | 31<<8)
+-    av_register_protocol(&mpeg1_file_protocol);
++    av_register_protocol2(&mpeg1_file_protocol, sizeof(mpeg1_file_protocol));
+ #else
+     register_protocol(&mpeg1_file_protocol);
+ #endif
+@@ -244,7 +244,7 @@
+     const char *ext;
+     AVOutputFormat *of = NULL;
+ 
+-    /* Here, we use guess_format to automatically setup the codec information.
++    /* Here, we use av_guess_format to automatically setup the codec information.
+      * If we are using msmpeg4, manually set that codec here.
+      * We also dynamically add the file extension to the filename here. This was
+      * done to support both mpeg1 and mpeg4 codecs since they have different extensions.
+@@ -258,7 +258,7 @@
+         /* We use "mpeg1video" for raw mpeg1 format. Using "mpeg" would
+          * result in a muxed output file, which isn't appropriate here.
+          */
+-        of = guess_format("mpeg1video", NULL, NULL);
++        of = av_guess_format("mpeg1video", NULL, NULL);
+         if (of) {
+             /* But we want the trailer to be correctly written. */
+             of->write_trailer = mpeg1_write_trailer;
+@@ -270,24 +270,24 @@
+ #endif
+     } else if (strcmp(codec, "mpeg4") == 0) {
+         ext = ".avi";
+-        of = guess_format("avi", NULL, NULL);
++        of = av_guess_format("avi", NULL, NULL);
+     } else if (strcmp(codec, "msmpeg4") == 0) {
+         ext = ".avi";
+-        of = guess_format("avi", NULL, NULL);
++        of = av_guess_format("avi", NULL, NULL);
+         if (of) {
+             /* Manually override the codec id. */
+             of->video_codec = CODEC_ID_MSMPEG4V2;
+         }
+     } else if (strcmp(codec, "swf") == 0) {
+         ext = ".swf";
+-        of = guess_format("swf", NULL, NULL);
++        of = av_guess_format("swf", NULL, NULL);
+     } else if (strcmp(codec, "flv") == 0) {
+         ext = ".flv";
+-        of = guess_format("flv", NULL, NULL);
++        of = av_guess_format("flv", NULL, NULL);
+         of->video_codec = CODEC_ID_FLV1;
+     } else if (strcmp(codec, "ffv1") == 0) {
+         ext = ".avi";
+-        of = guess_format("avi", NULL, NULL);
++        of = av_guess_format("avi", NULL, NULL);
+         if (of) {
+             /* Use the FFMPEG Lossless Video codec (experimental!).
+                Requires strict_std_compliance to be <= -2 */
+@@ -295,7 +295,7 @@
+         }
+     } else if (strcmp(codec, "mov") == 0) {
+         ext = ".mov";
+-        of = guess_format("mov", NULL, NULL);        
++        of = av_guess_format("mov", NULL, NULL);        
+     } else {
+         motion_log(LOG_ERR, 0, "ffmpeg_video_codec option value %s is not supported", codec);
+         return NULL;
+@@ -377,7 +377,7 @@
+ 
+     ffmpeg->c     = c = AVSTREAM_CODEC_PTR(ffmpeg->video_st);
+     c->codec_id   = ffmpeg->oc->oformat->video_codec;
+-    c->codec_type = CODEC_TYPE_VIDEO;
++    c->codec_type = AVMEDIA_TYPE_VIDEO;
+     is_mpeg1      = c->codec_id == CODEC_ID_MPEG1VIDEO;
+ 
+     if (strcmp(ffmpeg_video_codec, "ffv1") == 0)
+@@ -646,7 +646,7 @@
+     if (ffmpeg->oc->oformat->flags & AVFMT_RAWPICTURE) {
+         /* raw video case. The API will change slightly in the near future for that */
+ #ifdef FFMPEG_AVWRITEFRAME_NEWAPI
+-        pkt.flags |= PKT_FLAG_KEY;
++        pkt.flags |= AV_PKT_FLAG_KEY;
+         pkt.data = (uint8_t *)pic;
+         pkt.size = sizeof(AVPicture);
+         ret = av_write_frame(ffmpeg->oc, &pkt);
+@@ -667,7 +667,7 @@
+ #ifdef FFMPEG_AVWRITEFRAME_NEWAPI
+             pkt.pts = AVSTREAM_CODEC_PTR(ffmpeg->video_st)->coded_frame->pts;
+             if (AVSTREAM_CODEC_PTR(ffmpeg->video_st)->coded_frame->key_frame) {
+-                pkt.flags |= PKT_FLAG_KEY;
++                pkt.flags |= AV_PKT_FLAG_KEY;
+             }
+             pkt.data = ffmpeg->video_outbuf;
+             pkt.size = out_size;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/motion/motion.spec?r1=1.69&r2=1.70&f=u
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/motion/motion-ffmpeg.patch?r1=1.3&r2=1.4&f=u



More information about the pld-cvs-commit mailing list