tags 739457 + pending
thanks

Dear maintainer,

I've prepared an NMU for vxl (versioned as 1.17.0-8.1) and uploaded it
to DELAYED/5 and linked it against libav 10 in experimental. Please feel
free to tell me if I should delay it longer.

Regards.
diff -Nru vxl-1.17.0/debian/changelog vxl-1.17.0/debian/changelog
--- vxl-1.17.0/debian/changelog	2013-11-29 02:44:11.000000000 -0500
+++ vxl-1.17.0/debian/changelog	2014-03-30 22:39:20.000000000 -0400
@@ -1,3 +1,11 @@
+vxl (1.17.0-8.1) experimental; urgency=low
+
+  * Non-maintainer upload.
+  * Compile against libav10, patch provided by an...@khirnov.net
+    (Closes: #739457)
+
+ -- Reinhard Tartler <siret...@tauware.de>  Sun, 30 Mar 2014 22:39:17 -0400
+
 vxl (1.17.0-8) unstable; urgency=high
 
   * Remove B-D: libtiff5-dev, as it makes vxl FTBFS. Closes: #721493
diff -Nru vxl-1.17.0/debian/control vxl-1.17.0/debian/control
--- vxl-1.17.0/debian/control	2013-11-29 02:44:11.000000000 -0500
+++ vxl-1.17.0/debian/control	2014-03-30 22:39:40.000000000 -0400
@@ -8,8 +8,8 @@
 Build-Depends: cmake (>= 2.4.5),
                debhelper (>= 9),
                freeglut3-dev,
-               libavcodec-dev,
-               libavformat-dev,
+               libavcodec-dev (>= 6:10~),
+               libavformat-dev (>= 6:10~),
                libavifile-0.7-dev,
                libbz2-dev,
                libcoin80-dev,
@@ -24,7 +24,7 @@
                libqt4-dev,
                libqt4-opengl-dev,
                libshp-dev,
-               libswscale-dev,
+               libswscale-dev (>= 6:10~),
                libxerces-c-dev,
                ocl-icd-opencl-dev,
                opencl-headers,
diff -Nru vxl-1.17.0/debian/patches/libav10.patch vxl-1.17.0/debian/patches/libav10.patch
--- vxl-1.17.0/debian/patches/libav10.patch	1969-12-31 19:00:00.000000000 -0500
+++ vxl-1.17.0/debian/patches/libav10.patch	2014-03-30 22:38:21.000000000 -0400
@@ -0,0 +1,234 @@
+From: an...@khirnov.net
+To: 739...@bugs.debian.org
+Subject: Re: FTBFS with libav10
+Date: Tue, 25 Feb 2014 16:49:25 +0100
+
+--- a/core/vidl/vidl_ffmpeg_istream_v3.txx
++++ b/core/vidl/vidl_ffmpeg_istream_v3.txx
+@@ -182,7 +182,7 @@ open(const vcl_string& filename)
+   // The MPEG 2 codec has a latency of 1 frame when encoded in an AVI
+   // stream, so the dts of the last packet (stored in last_dts) is
+   // actually the next frame's dts.
+-  if ( is_->vid_str_->codec->codec_id == CODEC_ID_MPEG2VIDEO &&
++  if ( is_->vid_str_->codec->codec_id == AV_CODEC_ID_MPEG2VIDEO &&
+        vcl_string("avi") == is_->fmt_cxt_->iformat->name ) {
+     is_->frame_number_offset_ = 1;
+   }
+@@ -216,7 +216,7 @@ close()
+     is_->vid_str_ = 0;
+   }
+   if ( is_->fmt_cxt_ ) {
+-    av_close_input_file( is_->fmt_cxt_ );
++    avformat_close_input( &is_->fmt_cxt_ );
+     is_->fmt_cxt_ = 0;
+   }
+ }
+@@ -286,7 +286,7 @@ frame_number() const
+   }
+ 
+   return (unsigned int)( ((is_->last_dts - is_->start_time)
+-                          * is_->vid_str_->r_frame_rate.num / is_->vid_str_->r_frame_rate.den
++                          * is_->vid_str_->avg_frame_rate.num / is_->vid_str_->avg_frame_rate.den
+                           * is_->vid_str_->time_base.num + is_->vid_str_->time_base.den/2)
+                            / is_->vid_str_->time_base.den
+                            - int(is_->frame_number_offset_) );
+@@ -349,7 +349,7 @@ vidl_ffmpeg_istream
+     return 0.0;
+   }
+ 
+-  return static_cast<double>(is_->vid_str_->r_frame_rate.num) / is_->vid_str_->r_frame_rate.den;
++  return static_cast<double>(is_->vid_str_->avg_frame_rate.num) / is_->vid_str_->avg_frame_rate.den;
+ }
+ 
+ 
+@@ -422,8 +422,8 @@ advance()
+     if ( avcodec_decode_video2( codec,
+                                 is_->frame_, &got_picture,
+                                 &is_->packet_ ) >= 0 ) {
+-      is_->last_dts += int64_t(is_->vid_str_->time_base.den) * is_->vid_str_->r_frame_rate.den
+-        / is_->vid_str_->time_base.num / is_->vid_str_->r_frame_rate.num;
++      is_->last_dts += int64_t(is_->vid_str_->time_base.den) * is_->vid_str_->avg_frame_rate.den
++        / is_->vid_str_->time_base.num / is_->vid_str_->avg_frame_rate.num;
+     }
+   }
+ 
+@@ -555,9 +555,9 @@ seek_frame(unsigned int frame)
+   int64_t req_timestamp =
+     int64_t(frame + is_->frame_number_offset_)
+     * is_->vid_str_->time_base.den
+-    * is_->vid_str_->r_frame_rate.den
++    * is_->vid_str_->avg_frame_rate.den
+     / is_->vid_str_->time_base.num
+-    / is_->vid_str_->r_frame_rate.num
++    / is_->vid_str_->avg_frame_rate.num
+     + is_->start_time;
+ 
+   // Seek to a keyframe before the timestamp that we want.
+--- a/core/vidl/vidl_ffmpeg_ostream_v4.txx
++++ b/core/vidl/vidl_ffmpeg_ostream_v4.txx
+@@ -25,7 +25,9 @@
+ extern "C" {
+ #if FFMPEG_IN_SEVERAL_DIRECTORIES
+ #include <libavformat/avformat.h>
++#include <libavutil/mathematics.h>
+ #include <libavutil/mem.h>
++#include <libavutil/opt.h>
+ #else
+ #include <ffmpeg/avformat.h>
+ #endif
+@@ -56,7 +58,6 @@ struct vidl_ffmpeg_ostream::pimpl
+   AVFormatContext* fmt_cxt_;
+   bool file_opened_;
+   bool codec_opened_;
+-  vil_memory_chunk_sptr bit_buf_;
+   unsigned int cur_frame_;
+   char* video_rc_eq_;
+ };
+@@ -102,10 +103,6 @@ open()
+   // Close any open files
+   close();
+ 
+-  // a raw video packet is the same size as the input image. Others
+-  // are smaller.
+-  os_->bit_buf_ = new vil_memory_chunk( params_.ni_ * params_.nj_ * 3, VIL_PIXEL_FORMAT_BYTE );
+-
+   os_->fmt_cxt_ = avformat_alloc_context();
+ 
+   AVOutputFormat* file_oformat = 0;
+@@ -151,25 +148,25 @@ open()
+     video_enc->codec_id = file_oformat->video_codec;
+     break;
+    case vidl_ffmpeg_ostream_params::MPEG4:
+-    video_enc->codec_id = CODEC_ID_MPEG4;
++    video_enc->codec_id = AV_CODEC_ID_MPEG4;
+     break;
+    case vidl_ffmpeg_ostream_params::MPEG2VIDEO:
+-    video_enc->codec_id = CODEC_ID_MPEG2VIDEO;
++    video_enc->codec_id = AV_CODEC_ID_MPEG2VIDEO;
+     break;
+    case vidl_ffmpeg_ostream_params::MSMPEG4V2:
+-    video_enc->codec_id = CODEC_ID_MSMPEG4V2;
++    video_enc->codec_id = AV_CODEC_ID_MSMPEG4V2;
+     break;
+    case vidl_ffmpeg_ostream_params::RAWVIDEO:
+-    video_enc->codec_id = CODEC_ID_RAWVIDEO;
++    video_enc->codec_id = AV_CODEC_ID_RAWVIDEO;
+     break;
+    case vidl_ffmpeg_ostream_params::LJPEG:
+-    video_enc->codec_id = CODEC_ID_LJPEG;
++    video_enc->codec_id = AV_CODEC_ID_LJPEG;
+     break;
+    case vidl_ffmpeg_ostream_params::HUFFYUV:
+-    video_enc->codec_id = CODEC_ID_HUFFYUV;
++    video_enc->codec_id = AV_CODEC_ID_HUFFYUV;
+     break;
+    case vidl_ffmpeg_ostream_params::DVVIDEO:
+-    video_enc->codec_id = CODEC_ID_DVVIDEO;
++    video_enc->codec_id = AV_CODEC_ID_DVVIDEO;
+     break;
+    default:
+     vcl_cout << "ffmpeg: Unknown encoder type\n";
+@@ -225,8 +222,8 @@ open()
+     if ( *p == -1 )
+       video_enc->pix_fmt = codec->pix_fmts[0];
+   }
+-  else if ( codec && ( codec->id == CODEC_ID_RAWVIDEO ||
+-                      codec->id == CODEC_ID_HUFFYUV ) )
++  else if ( codec && ( codec->id == AV_CODEC_ID_RAWVIDEO ||
++                      codec->id == AV_CODEC_ID_HUFFYUV ) )
+   {
+     // these formats only support the YUV input image formats
+     video_enc->pix_fmt = PIX_FMT_YUV420P;
+@@ -256,7 +253,7 @@ open()
+   video_enc->spatial_cplx_masking = params_.scplx_mask_;
+   video_enc->temporal_cplx_masking = params_.tcplx_mask_;
+   video_enc->p_masking = params_.p_mask_;
+-  video_enc->quantizer_noise_shaping= params_.qns_;
++  av_opt_set_int(video_enc, "quantizer_noise_shaping", params_.qns_, AV_OPT_SEARCH_CHILDREN);
+ 
+   if (params_.use_umv_)
+   {
+@@ -305,11 +302,11 @@ open()
+   }
+   if (params_.use_qprd_)
+   {
+-    video_enc->flags |= CODEC_FLAG_QP_RD;
++    av_opt_set(video_enc, "mpv_flags", "+qp_rd", AV_OPT_SEARCH_CHILDREN);
+   }
+   if (params_.use_cbprd_)
+   {
+-    video_enc->flags |= CODEC_FLAG_CBP_RD;
++    av_opt_set(video_enc, "mpv_flags", "+cbp_rd", AV_OPT_SEARCH_CHILDREN);
+   }
+   if (params_.b_frames_)
+   {
+@@ -325,6 +322,8 @@ open()
+   {
+     video_enc->flags |= CODEC_FLAG_INTERLACED_ME;
+   }
++
++
+   video_enc->qmin = params_.video_qmin_;
+   video_enc->qmax = params_.video_qmax_;
+   video_enc->lmin = params_.video_lmin_;
+@@ -490,13 +489,14 @@ write_frame(const vidl_frame_sptr& frame
+   vidl_pixel_format target_fmt = vidl_pixel_format_from_ffmpeg(codec->pix_fmt);
+   static vidl_frame_sptr temp_frame = new vidl_shared_frame(NULL,frame->ni(),frame->nj(),target_fmt);
+ 
+-  AVFrame out_frame;
+-  avcodec_get_frame_defaults( &out_frame );
++  AVFrame *out_frame = av_frame_alloc();
++  if (!out_frame)
++    return false;
+ 
+   // The frame is in the correct format to encode directly
+   if ( codec->pix_fmt == fmt )
+   {
+-    avpicture_fill((AVPicture*)&out_frame, (uint8_t*) frame->data(),
++    avpicture_fill((AVPicture*)out_frame, (uint8_t*) frame->data(),
+                    fmt, frame->ni(), frame->nj());
+   }
+   else
+@@ -516,30 +516,26 @@ write_frame(const vidl_frame_sptr& frame
+         return false;
+       }
+     }
+-    avpicture_fill((AVPicture*)&out_frame, (uint8_t*) temp_frame->data(),
++    avpicture_fill((AVPicture*)out_frame, (uint8_t*) temp_frame->data(),
+                    codec->pix_fmt, frame->ni(), frame->nj());
+   }
+ 
+-  AVPacket pkt;
+-  av_init_packet( &pkt );
+-  pkt.stream_index = 0;
++  AVPacket pkt = { 0 };
+ 
+-  out_frame.pts = os_->cur_frame_;
++  out_frame->pts = os_->cur_frame_;
+ 
+-  int ret = avcodec_encode_video( codec, (uint8_t*)os_->bit_buf_->data(), os_->bit_buf_->size(), &out_frame );
++  int got_packet;
++  int ret = avcodec_encode_video2( codec, &pkt, out_frame, &got_packet );
++  av_frame_free(&out_frame);
+ 
+-  if ( ret ) {
+-    pkt.data = (uint8_t*)os_->bit_buf_->data();
+-    pkt.size = ret;
+-    if ( codec->coded_frame ) {
+-      pkt.pts = codec->coded_frame->pts;
+-    }
+-    if ( codec->coded_frame && codec->coded_frame->key_frame ) {
+-      pkt.flags |= AV_PKT_FLAG_KEY;
+-    }
++  pkt.stream_index = 0;
++  if ( ret >= 0 && got_packet) {
++    AVStream *st = os_->fmt_cxt_->streams[0];
++    pkt.pts = av_rescale_q(pkt.pts, codec->time_base, st->time_base);
++    pkt.dts = av_rescale_q(pkt.dts, codec->time_base, st->time_base);
+     av_interleaved_write_frame( os_->fmt_cxt_, &pkt );
+   }
+-  else {
++  else if (ret < 0) {
+     return false;
+   }
+ 
diff -Nru vxl-1.17.0/debian/patches/series vxl-1.17.0/debian/patches/series
--- vxl-1.17.0/debian/patches/series	2013-11-28 07:58:33.000000000 -0500
+++ vxl-1.17.0/debian/patches/series	2014-03-30 22:37:58.000000000 -0400
@@ -17,3 +17,4 @@
 opencl_kfreebsd.patch
 shared-lib-without-dependency-information.patch
 #compflags.patch
+libav10.patch

Reply via email to