Package: motion
Severity: normal
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu oneiric ubuntu-patch



*** /tmp/tmp2NHS3F
In Ubuntu, the attached patch was applied to achieve the following:

https://bugs.launchpad.net/ubuntu/+source/motion/+bug/756211

  * fix FTBFS linux/videodev.h using linux/videodev2.h and libv4l1-videodev.h 
instead (LP:756211)
  * Made some other changes to fix build failure.


Thanks for considering the patch.


-- System Information:
Debian Release: squeeze/sid
  APT prefers natty-updates
  APT policy: (500, 'natty-updates'), (500, 'natty-security'), (500, 'natty')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.38-8-generic (SMP w/2 CPU cores)
Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
=== modified file 'debian/changelog'

=== modified file 'debian/control'
--- debian/control	2010-08-08 17:20:01 +0000
+++ debian/control	2011-06-10 23:49:37 +0000
@@ -3,7 +3,7 @@
 Priority: optional
 Maintainer: Juan Angulo Moreno <j...@apuntale.com>
 HomePage: http://motion.sf.net
-Build-Depends: debhelper (>= 6), autotools-dev, libjpeg62-dev, zlib1g-dev, libavcodec-dev, libavformat-dev, libpq-dev, libmysqlclient-dev
+Build-Depends: debhelper (>= 6), autotools-dev, libjpeg62-dev, zlib1g-dev, libavcodec-dev, libavformat-dev, libpq-dev, libmysqlclient-dev, libv4l-dev
 Standards-Version: 3.9.1
 
 Package: motion

=== modified file 'ffmpeg.c'
--- ffmpeg.c	2010-06-26 01:25:17 +0000
+++ ffmpeg.c	2011-06-11 22:51:01 +0000
@@ -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
@@ -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;

=== modified file 'motion.h'
--- motion.h	2010-04-10 10:21:49 +0000
+++ motion.h	2011-06-11 22:51:01 +0000
@@ -40,7 +40,8 @@
 
 #define _LINUX_TIME_H 1
 #if !defined(WITHOUT_V4L) && !defined(BSD)
-#include <linux/videodev.h>
+#include <linux/videodev2.h>
+#include <libv4l1-videodev.h>
 #endif
 
 #include <pthread.h>

=== modified file 'video.h'
--- video.h	2010-04-10 10:21:49 +0000
+++ video.h	2011-06-11 22:51:01 +0000
@@ -12,7 +12,7 @@
 
 #define _LINUX_TIME_H 1
 #ifndef WITHOUT_V4L
-#include <linux/videodev.h>
+#include <libv4l1-videodev.h>
 #include <sys/mman.h>
 #include "pwc-ioctl.h"
 #endif

Reply via email to