Your message dated Fri, 11 Mar 2016 22:39:04 +0000
with message-id <[email protected]>
and subject line Bug#803849: fixed in openscenegraph 3.2.2+dfsg1-1
has caused the Debian Bug report #803849,
regarding openscenegraph: FTBFS with FFmpeg 2.9
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
803849: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=803849
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: openscenegraph
Version: 3.2.1-8
Severity: important
Tags: patch
User: [email protected]
Usertags: ffmpeg2.9

Dear Maintainer,

your package fails to build with the upcoming ffmpeg 2.9.
This bug will become release-critical at some point when the
ffmpeg2.9 transition gets closer.

Attached is a patch replacing the deprecated functionality.
It also works with ffmpeg 2.8.
Please apply this patch and forward it upstream, if necessary.

These changes are non-trivial and should be runtime-tested.

Best regards,
Andreas

diff --git a/debian/patches/ffmpeg_2.9.patch b/debian/patches/ffmpeg_2.9.patch
new file mode 100644
index 0000000..9114802
--- /dev/null
+++ b/debian/patches/ffmpeg_2.9.patch
@@ -0,0 +1,145 @@
+Description: Replace deprecated FFmpeg API
+Author: Andreas Cadhalpun <[email protected]>
+Last-Update: <2015-11-02>
+
+--- openscenegraph-3.2.1.orig/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp
++++ openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.cpp
+@@ -71,7 +71,7 @@ void FFmpegDecoderVideo::open(AVStream *
+     findAspectRatio();
+ 
+     // Find out whether we support Alpha channel
+-    m_alpha_channel = (m_context->pix_fmt == PIX_FMT_YUVA420P);
++    m_alpha_channel = (m_context->pix_fmt == AV_PIX_FMT_YUVA420P);
+ 
+     // Find out the framerate
+     m_frame_rate = av_q2d(stream->avg_frame_rate);
+@@ -91,20 +91,19 @@ void FFmpegDecoderVideo::open(AVStream *
+         throw std::runtime_error("avcodec_open() failed");
+ 
+     // Allocate video frame
+-    m_frame.reset(avcodec_alloc_frame());
++    m_frame.reset(av_frame_alloc());
+ 
+     // Allocate converted RGB frame
+-    m_frame_rgba.reset(avcodec_alloc_frame());
+-    m_buffer_rgba[0].resize(avpicture_get_size(PIX_FMT_RGB24, width(), height()));
++    m_frame_rgba.reset(av_frame_alloc());
++    m_buffer_rgba[0].resize(avpicture_get_size(AV_PIX_FMT_RGB24, width(), height()));
+     m_buffer_rgba[1].resize(m_buffer_rgba[0].size());
+ 
+     // Assign appropriate parts of the buffer to image planes in m_frame_rgba
+-    avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[0])[0], PIX_FMT_RGB24, width(), height());
++    avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[0])[0], AV_PIX_FMT_RGB24, width(), height());
+ 
+     // Override get_buffer()/release_buffer() from codec context in order to retrieve the PTS of each frame.
+     m_context->opaque = this;
+-    m_context->get_buffer = getBuffer;
+-    m_context->release_buffer = releaseBuffer;
++    m_context->get_buffer2 = getBuffer;
+ }
+ 
+ 
+@@ -263,8 +262,8 @@ int FFmpegDecoderVideo::convert(AVPictur
+ #ifdef USE_SWSCALE
+     if (m_swscale_ctx==0)
+     {
+-        m_swscale_ctx = sws_getContext(src_width, src_height, (PixelFormat) src_pix_fmt,
+-                                      src_width, src_height, (PixelFormat) dst_pix_fmt,
++        m_swscale_ctx = sws_getContext(src_width, src_height, (AVPixelFormat) src_pix_fmt,
++                                      src_width, src_height, (AVPixelFormat) dst_pix_fmt,
+                                       /*SWS_BILINEAR*/ SWS_BICUBIC, NULL, NULL, NULL);
+     }
+ 
+@@ -311,14 +310,14 @@ void FFmpegDecoderVideo::publishFrame(co
+     AVPicture * const dst = (AVPicture *) m_frame_rgba.get();
+ 
+     // Assign appropriate parts of the buffer to image planes in m_frame_rgba
+-    avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[m_writeBuffer])[0], PIX_FMT_RGB24, width(), height());
++    avpicture_fill((AVPicture *) (m_frame_rgba).get(), &(m_buffer_rgba[m_writeBuffer])[0], AV_PIX_FMT_RGB24, width(), height());
+ 
+     // Convert YUVA420p (i.e. YUV420p plus alpha channel) using our own routine
+ 
+-    if (m_context->pix_fmt == PIX_FMT_YUVA420P)
++    if (m_context->pix_fmt == AV_PIX_FMT_YUVA420P)
+         yuva420pToRgba(dst, src, width(), height());
+     else
+-        convert(dst, PIX_FMT_RGB24, src, m_context->pix_fmt, width(), height());
++        convert(dst, AV_PIX_FMT_RGB24, src, m_context->pix_fmt, width(), height());
+ 
+     // Wait 'delay' seconds before publishing the picture.
+     int i_delay = static_cast<int>(delay * 1000000 + 0.5);
+@@ -345,7 +344,7 @@ void FFmpegDecoderVideo::publishFrame(co
+ 
+ void FFmpegDecoderVideo::yuva420pToRgba(AVPicture * const dst, AVPicture * const src, int width, int height)
+ {
+-    convert(dst, PIX_FMT_RGB24, src, m_context->pix_fmt, width, height);
++    convert(dst, AV_PIX_FMT_RGB24, src, m_context->pix_fmt, width, height);
+ 
+     const size_t bpp = 4;
+ 
+@@ -363,31 +362,28 @@ void FFmpegDecoderVideo::yuva420pToRgba(
+     }
+ }
+ 
+-
+-
+-int FFmpegDecoderVideo::getBuffer(AVCodecContext * const context, AVFrame * const picture)
++int FFmpegDecoderVideo::getBuffer(AVCodecContext * const context, AVFrame * const picture, int flags)
+ {
++    AVBufferRef *ref;
+     const FFmpegDecoderVideo * const this_ = reinterpret_cast<const FFmpegDecoderVideo*>(context->opaque);
+ 
+-    const int result = avcodec_default_get_buffer(context, picture);
++    const int result = avcodec_default_get_buffer2(context, picture, flags);
+     int64_t * p_pts = reinterpret_cast<int64_t*>( av_malloc(sizeof(int64_t)) );
+ 
+     *p_pts = this_->m_packet_pts;
+     picture->opaque = p_pts;
+ 
++    ref = av_buffer_create((uint8_t *)picture->opaque, sizeof(int64_t), FFmpegDecoderVideo::freeBuffer, picture->buf[0], flags);
++    picture->buf[0] = ref;
++
+     return result;
+ }
+ 
+-
+-
+-void FFmpegDecoderVideo::releaseBuffer(AVCodecContext * const context, AVFrame * const picture)
++void FFmpegDecoderVideo::freeBuffer(void *opaque, uint8_t *data)
+ {
+-    if (picture != 0)
+-        av_freep(&picture->opaque);
+-
+-    avcodec_default_release_buffer(context, picture);
++    AVBufferRef *ref = (AVBufferRef *)opaque;
++    av_buffer_unref(&ref);
++    av_free(data);
+ }
+ 
+-
+-
+ } // namespace osgFFmpeg
+--- openscenegraph-3.2.1.orig/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp
++++ openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegDecoderVideo.hpp
+@@ -94,8 +94,8 @@ private:
+                 int src_pix_fmt, int src_width, int src_height);
+ 
+ 
+-    static int getBuffer(AVCodecContext * context, AVFrame * picture);
+-    static void releaseBuffer(AVCodecContext * context, AVFrame * picture);
++    static int getBuffer(AVCodecContext * context, AVFrame * picture, int flags);
++    static void freeBuffer(void * opaque, uint8_t *data);
+ 
+     PacketQueue &           m_packets;
+     FFmpegClocks &          m_clocks;
+--- openscenegraph-3.2.1.orig/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegParameters.cpp
++++ openscenegraph-3.2.1/OpenSceneGraph/src/osgPlugins/ffmpeg/FFmpegParameters.cpp
+@@ -19,7 +19,7 @@ extern "C"
+     #include <libavutil/pixdesc.h>
+ }
+ 
+-inline PixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); }
++inline AVPixelFormat osg_av_get_pix_fmt(const char *name) { return av_get_pix_fmt(name); }
+ 
+ 
+ namespace osgFFmpeg {
diff --git a/debian/patches/series b/debian/patches/series
index f0c725b..92584c8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -5,3 +5,4 @@ bug763818_fix_preprocessor_double_substitution
 bug765855_removecallback_use_after_free
 gdal-2.0.patch
 no-xine-malloc-aligned.diff
+ffmpeg_2.9.patch

--- End Message ---
--- Begin Message ---
Source: openscenegraph
Source-Version: 3.2.2+dfsg1-1

We believe that the bug you reported is fixed in the latest version of
openscenegraph, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Alberto Luaces Fernández <[email protected]> (supplier of updated openscenegraph 
package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Fri, 11 Mar 2016 21:12:21 +0000
Source: openscenegraph
Binary: libopenthreads-dev libopenthreads20 libopenscenegraph-dev 
libopenscenegraph100v5 openscenegraph-doc openscenegraph openscenegraph-examples
Architecture: source
Version: 3.2.2+dfsg1-1
Distribution: unstable
Urgency: medium
Maintainer: Loic Dachary (OuoU) <[email protected]>
Changed-By: Alberto Luaces Fernández <[email protected]>
Description:
 libopenscenegraph-dev - 3D scene graph, development files
 libopenscenegraph100v5 - 3D scene graph, shared libs
 libopenthreads-dev - Object-Oriented (OO) thread interface for C++, 
development files
 libopenthreads20 - Object-Oriented (OO) thread interface for C++, shared libs
 openscenegraph - 3D scene graph, utilities and examples (binaries)
 openscenegraph-doc - 3D scene graph, documentation
 openscenegraph-examples - 3D scene graph, examples (sources)
Closes: 775368 803849 814555
Changes:
 openscenegraph (3.2.2+dfsg1-1) unstable; urgency=medium
 .
   * Updated to new stable release (Closes: #814555).
   * Debug packages are now generated automatically (Closes: #775368).
   * Fixed my name in uploaders so lintian no longer triggers a warning
     about NMUs.
   * Fix doxygen configuration when reading header files.
   * De-embed copies of jquery.js found on doxygen configuration.
   * Update Vcs-Browser URL in debian/control.
   * Update debian/copyright file.
   * Fix FTBFS with ffmpeg 2.9 (Closes: #803849).  Thanks to Andreas
     Cadhalpun.
Checksums-Sha1:
 2817d5eea7253975d178aa97c9ca76703f261a3f 2904 openscenegraph_3.2.2+dfsg1-1.dsc
 dcb8fd923fc335254f724955b11651c0a44e4c9d 5148308 
openscenegraph_3.2.2+dfsg1.orig.tar.gz
 8cc925f25babe6b88aeedfdc88926cb6218890c7 24424 
openscenegraph_3.2.2+dfsg1-1.debian.tar.xz
Checksums-Sha256:
 e510fa923d3728c221fc22887c7b5810b5f2c4157930b732b00324df5df9aef2 2904 
openscenegraph_3.2.2+dfsg1-1.dsc
 fed8382d435e1ec27321b8cddea060be5e7911f64849e48e5a0cdd1e7069c348 5148308 
openscenegraph_3.2.2+dfsg1.orig.tar.gz
 873a83d1c213fd762a9fae3e587580fe2eb4d6e5627386efde044b6bb793d875 24424 
openscenegraph_3.2.2+dfsg1-1.debian.tar.xz
Files:
 d400ec3cadd01e952a4c5db7c56809e0 2904 devel optional 
openscenegraph_3.2.2+dfsg1-1.dsc
 893a335da28449c90351a8b03ca94e16 5148308 devel optional 
openscenegraph_3.2.2+dfsg1.orig.tar.gz
 fcd1521bc79579c07ffa3a8629bf3093 24424 devel optional 
openscenegraph_3.2.2+dfsg1-1.debian.tar.xz

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJW40TCAAoJEH92BqRF3KgOFfgP/isW4wO7GIW//8f2VYs4xoYZ
xy+EJXecw+7tBez9nkDUxPp1gFwfgsbFtClMpdBtS8LTpOzo5pppKWJz0x3W+lTG
rxhvYE/vkJh4EuZr/Uvti+CtrRT/UTGtzmRm13E6afcfPJqGf1EtgkH3xHONx3O6
RUB9d6dJ/B4SXjIjXposL7i4dDVMWxQ24uvfl213JFWHF9Zt6a72EvdCM5mzv7c7
VgZnedkCdU9jYO9bAZvMBEQxcKUxFay6CFON3hVAdTtIKjsEL6qNrhVy7OJ1On1M
2EV+eVdsHHEwkbyUD0CJ/dPA2aHx2KlwX/TsmooSVI2I/Zm/Invakkrw/lkZgiR1
4Lm1y4QeWKkbDTQ1VyHLx8VZpk5qSn3K11pi8d7D1w/KLeZHkfk0AfjGm0arTuvF
s5SaFL89AxCIAPpkFl0k+Ck6XkaJEZ1rzBvY9iSRteWgetfr3Jv5xY515uemi0/D
B9hz4Jwzez0juXHdybV6krTkYppjpJxL0T68SBeI7pOHagkIDRv5B5wVZ36mbIot
0FHrDjQGJA/Db0Ex8Mp6nV8OvYxQEMMjGgDpTVCCHXzRGqju8WTpZ4vLeZegd+lD
phFAX4t0ion4YdqWBig6h/y44RR+XJvJqSg/+lirloHyBHE61ShUWN2G+y+vRXPC
nnsMqgdi+2q2O4mtrfY9
=k7Lr
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to