diff options
author | Benjamin Chrétien | 2016-03-07 16:13:42 +0900 |
---|---|---|
committer | Benjamin Chrétien | 2016-03-07 17:42:34 +0900 |
commit | 4ab9b893bd8dbb341313c7996158286e1c09e5a1 (patch) | |
tree | 29e83f25728901a2be51cb217c0107e433937b67 | |
parent | 0eb7953d5a970665b6465e2b1d8b0cd93f42c597 (diff) | |
download | aur-4ab9b893bd8dbb341313c7996158286e1c09e5a1.tar.gz |
Update for ffmpeg dependency
-rw-r--r-- | .SRCINFO | 8 | ||||
-rw-r--r-- | PKGBUILD | 14 | ||||
-rw-r--r-- | ffmpeg.patch | 155 |
3 files changed, 170 insertions, 7 deletions
@@ -1,9 +1,9 @@ # Generated by mksrcinfo v8 -# Sun Feb 28 11:32:53 UTC 2016 +# Mon Mar 7 08:42:26 UTC 2016 pkgbase = gazebo pkgdesc = A multi-robot simulator for outdoor environments pkgver = 7.0.0 - pkgrel = 1 + pkgrel = 2 url = http://gazebosim.org/ install = gazebo.install arch = i686 @@ -32,7 +32,7 @@ pkgbase = gazebo depends = tinyxml2 optdepends = bullet>=2.82: Bullet support optdepends = cegui>=0.8.3: Design custom graphical interfaces - optdepends = ffmpeg>=0.8.3: Playback movies on textured surfaces + optdepends = ffmpeg: Playback movies on textured surfaces optdepends = gdal: Digital elevation terrains support optdepends = libdart>=3.0: DART support optdepends = libspnav: space navigator joystick support @@ -41,7 +41,9 @@ pkgbase = gazebo optdepends = simbody>=3.3: Simbody support optdepends = urdfdom: Load URDF files source = http://osrf-distributions.s3.amazonaws.com/gazebo/releases/gazebo-7.0.0.tar.bz2 + source = ffmpeg.patch sha256sums = 74413e18d812abb3398af3124dc24e009af27e1f81c26d9698aaee39d213f888 + sha256sums = 28511deeb68f20ef4616e1ad6ae9876e318b3958b7e9c4c9042dc0fad0183d4f pkgname = gazebo @@ -4,7 +4,7 @@ pkgname=gazebo pkgver=7.0.0 -pkgrel=1 +pkgrel=2 pkgdesc="A multi-robot simulator for outdoor environments" arch=('i686' 'x86_64') url="http://gazebosim.org/" @@ -16,7 +16,7 @@ depends=('boost>=1.40.0' 'curl>=4.0' 'freeglut' 'freeimage>=3.0' 'tinyxml>=2.6.2' 'tinyxml2') optdepends=('bullet>=2.82: Bullet support' 'cegui>=0.8.3: Design custom graphical interfaces' - 'ffmpeg>=0.8.3: Playback movies on textured surfaces' + 'ffmpeg: Playback movies on textured surfaces' 'gdal: Digital elevation terrains support' 'libdart>=3.0: DART support' 'libspnav: space navigator joystick support' @@ -26,11 +26,17 @@ optdepends=('bullet>=2.82: Bullet support' 'urdfdom: Load URDF files') makedepends=('cmake' 'doxygen' 'pkg-config>=0.26') install="${pkgname}.install" -source=("http://osrf-distributions.s3.amazonaws.com/gazebo/releases/${pkgname}-${pkgver}.tar.bz2") -sha256sums=('74413e18d812abb3398af3124dc24e009af27e1f81c26d9698aaee39d213f888') +source=("http://osrf-distributions.s3.amazonaws.com/gazebo/releases/${pkgname}-${pkgver}.tar.bz2" + "ffmpeg.patch") +sha256sums=('74413e18d812abb3398af3124dc24e009af27e1f81c26d9698aaee39d213f888' + '28511deeb68f20ef4616e1ad6ae9876e318b3958b7e9c4c9042dc0fad0183d4f') prepare() { cd "${srcdir}/${pkgname}-${pkgver}" + + # See: https://bitbucket.org/osrf/gazebo/commits/df5f96a6695f8dbe8d05bb885aed2913a09170b9 + patch -p1 -i ${srcdir}/ffmpeg.patch + mkdir -p build && cd build # Note: we skip unit tests (else set to TRUE) diff --git a/ffmpeg.patch b/ffmpeg.patch new file mode 100644 index 000000000000..82a6ef80c0cd --- /dev/null +++ b/ffmpeg.patch @@ -0,0 +1,155 @@ +diff --git a/gazebo/common/Video.cc b/gazebo/common/Video.cc +--- a/gazebo/common/Video.cc ++++ b/gazebo/common/Video.cc +@@ -15,14 +15,18 @@ + * + */ + +-#include <gazebo/common/Console.hh> +-#include <gazebo/common/Video.hh> +-#include <gazebo/gazebo_config.h> +-#include <gazebo/common/ffmpeg_inc.h> ++#include "gazebo/gazebo_config.h" ++#include "gazebo/common/Console.hh" ++#include "gazebo/common/Video.hh" ++#include "gazebo/common/ffmpeg_inc.h" + + using namespace gazebo; + using namespace common; + ++/// \brief Destination audio video frame ++/// TODO Do not merge forward. Declared here for gazebo7 ABI compatibility ++AVFrame *avFrameDst; ++ + ///////////////////////////////////////////////// + // #ifdef HAVE_FFMPEG + // static void pgm_save(unsigned char *buf, int wrap, int xsize, int ysize, +@@ -44,25 +48,17 @@ + { + this->formatCtx = NULL; + this->codecCtx = NULL; +- this->avFrame = NULL; + this->swsCtx = NULL; + this->avFrame = NULL; +- this->pic = NULL; + this->videoStream = -1; + +-#ifdef HAVE_FFMPEG +- this->pic = new AVPicture; +-#endif ++ avFrameDst = NULL; + } + + ///////////////////////////////////////////////// + Video::~Video() + { + this->Cleanup(); +- +-#ifdef HAVE_FFMPEG +- delete this->pic; +-#endif + } + + ///////////////////////////////////////////////// +@@ -78,7 +74,7 @@ + // Close the codec + avcodec_close(this->codecCtx); + +- avpicture_free(this->pic); ++ av_free(avFrameDst); + #endif + } + +@@ -147,16 +143,13 @@ + return false; + } + +- avpicture_alloc(this->pic, PIX_FMT_RGB24, this->codecCtx->width, +- this->codecCtx->height); +- + this->swsCtx = sws_getContext( + this->codecCtx->width, + this->codecCtx->height, + this->codecCtx->pix_fmt, + this->codecCtx->width, + this->codecCtx->height, +- PIX_FMT_RGB24, ++ AV_PIX_FMT_RGB24, + SWS_BICUBIC, NULL, NULL, NULL); + + if (this->swsCtx == NULL) +@@ -165,20 +158,13 @@ + return false; + } + +- // DEBUG: Will save all the frames +- /*Image img; +- char buf[1024]; +- int frame = 0; +- +- // the decoding loop, running until EOF +- while (this->GetNextFrame(img)) +- { +- printf("WH[%d %d]\n",this->codecCtx->width, this->codecCtx->height); +- snprintf(buf, sizeof(buf), "/tmp/test_%3d.png", frame++); +- img.SavePNG(buf); +- } +- printf("Done\n"); +- */ ++ avFrameDst = common::AVFrameAlloc(); ++ avFrameDst->format = this->codecCtx->pix_fmt; ++ avFrameDst->width = this->codecCtx->width; ++ avFrameDst->height = this->codecCtx->height; ++ av_image_alloc(avFrameDst->data, avFrameDst->linesize, ++ this->codecCtx->width, this->codecCtx->height, this->codecCtx->pix_fmt, ++ 1); + + return true; + } +@@ -226,9 +212,10 @@ + if (frameAvailable) + { + sws_scale(swsCtx, this->avFrame->data, this->avFrame->linesize, 0, +- this->codecCtx->height, this->pic->data, this->pic->linesize); ++ this->codecCtx->height, avFrameDst->data, ++ avFrameDst->linesize); + +- memcpy(*_buffer, this->pic->data[0], ++ memcpy(*_buffer, avFrameDst->data[0], + this->codecCtx->height * (this->codecCtx->width*3)); + + // Debug: +diff --git a/gazebo/common/Video.hh b/gazebo/common/Video.hh +--- a/gazebo/common/Video.hh ++++ b/gazebo/common/Video.hh +@@ -14,8 +14,8 @@ + * limitations under the License. + * + */ +-#ifndef _VIDEO_HH_ +-#define _VIDEO_HH_ ++#ifndef _GAZEBO_COMMON_VIDEO_HH_ ++#define _GAZEBO_COMMON_VIDEO_HH_ + + #include <string> + #include "gazebo/util/system.hh" +@@ -74,7 +74,7 @@ + /// \brief audio video frame + private: AVFrame *avFrame; + +- /// \brief audi video picture ++ /// \brief audio video picture + private: AVPicture *pic; + + /// \brief software scaling context +diff --git a/gazebo/common/ffmpeg_inc.h b/gazebo/common/ffmpeg_inc.h +--- a/gazebo/common/ffmpeg_inc.h ++++ b/gazebo/common/ffmpeg_inc.h +@@ -31,6 +31,7 @@ + extern "C" { + #include <libavcodec/avcodec.h> + #include <libavformat/avformat.h> ++#include <libavutil/imgutils.h> + #include <libavutil/opt.h> + #include <libswscale/swscale.h> + } |