Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 Nov 2016 08:14:04 +0000 (UTC)
From:      Jan Beich <jbeich@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r425471 - in head/multimedia/py-ffmpeg: . files
Message-ID:  <201611060814.uA68E4Cl044060@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jbeich
Date: Sun Nov  6 08:14:03 2016
New Revision: 425471
URL: https://svnweb.freebsd.org/changeset/ports/425471

Log:
  multimedia/py-ffmpeg: unbreak build with ffmpeg 3.x
  
  ffmpeg/_ffmpeg.c:8559:23: error: no member named 'get_buffer' in 'struct AVCodecContext'; did you mean 'get_buffer2'?
      __pyx_v_codecCtx->get_buffer = __pyx_f_6ffmpeg_7_ffmpeg_our_get_buffer;
                        ^~~~~~~~~~
                        get_buffer2
  /usr/local/include/libavcodec/avcodec.h:2565:11: note: 'get_buffer2' declared here
      int (*get_buffer2)(struct AVCodecContext *s, AVFrame *frame, int flags);
            ^
  ffmpeg/_ffmpeg.c:8568:23: error: no member named 'release_buffer' in 'struct AVCodecContext'
      __pyx_v_codecCtx->release_buffer = __pyx_f_6ffmpeg_7_ffmpeg_our_release_buffer;
      ~~~~~~~~~~~~~~~~  ^
  
  PR:		214247
  Approved by:	dbn (maintainer)

Added:
  head/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pxi   (contents, props changed)
  head/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pyx   (contents, props changed)
Modified:
  head/multimedia/py-ffmpeg/Makefile   (contents, props changed)

Modified: head/multimedia/py-ffmpeg/Makefile
==============================================================================
--- head/multimedia/py-ffmpeg/Makefile	Sun Nov  6 08:13:47 2016	(r425470)
+++ head/multimedia/py-ffmpeg/Makefile	Sun Nov  6 08:14:03 2016	(r425471)
@@ -3,7 +3,7 @@
 
 PORTNAME=	ffmpeg
 PORTVERSION=	1.2.4
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	multimedia python
 MASTER_SITES=	GH LOCAL/dbn/${PORTNAME}
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}

Added: head/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pxi
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pxi	Sun Nov  6 08:14:03 2016	(r425471)
@@ -0,0 +1,29 @@
+--- ffmpeg/_ffmpeg.pxi.orig	2013-10-28 16:04:02 UTC
++++ ffmpeg/_ffmpeg.pxi
+@@ -53,8 +53,6 @@ cdef extern from "libavcodec/avcodec.h" 
+         int channels
+         AVCodec *codec
+         AVMediaType codec_type
+-        int (*get_buffer)(AVCodecContext *c, AVFrame *pic)
+-        void (*release_buffer)(AVCodecContext *c, AVFrame *pic)
+         AVRational time_base
+         AVSampleFormat sample_fmt
+     struct AVPicture:
+@@ -83,7 +81,7 @@ cdef extern from "libavcodec/avcodec.h" 
+     ctypedef int (*lockmgr_t)(void **mutex, AVLockOp op)
+     int av_lockmgr_register(lockmgr_t cb)
+ 
+-    AVFrame *avcodec_alloc_frame() 
++    AVFrame *av_frame_alloc() 
+     int avcodec_decode_video2(AVCodecContext *avctx, AVFrame *picture,
+                          int *got_picture_ptr, AVPacket *avpkt)
+     int avcodec_decode_audio4(AVCodecContext *avctx, AVFrame *frame, int
+@@ -100,7 +98,7 @@ cdef extern from "libavcodec/avcodec.h" 
+     int avcodec_default_get_buffer(AVCodecContext *s, AVFrame *pic)
+     void avcodec_default_release_buffer(AVCodecContext *s, AVFrame *pic)
+ 
+-    void avcodec_get_frame_defaults(AVFrame *)
++    void av_frame_unref(AVFrame *)
+ 
+ cdef extern from "libavresample/avresample.h" nogil:
+     struct ResampleContext:

Added: head/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pyx
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pyx	Sun Nov  6 08:14:03 2016	(r425471)
@@ -0,0 +1,63 @@
+--- ffmpeg/_ffmpeg.pyx.orig	2013-10-28 16:04:02 UTC
++++ ffmpeg/_ffmpeg.pyx
+@@ -518,11 +518,11 @@ cdef int audio_decode_frame(VideoState *
+             got_frame = 0
+ 
+             if frame == NULL:
+-                frame = avcodec_alloc_frame()
++                frame = av_frame_alloc()
+                 if frame == NULL:
+                     return -1
+             else:
+-                avcodec_get_frame_defaults(frame)
++                av_frame_unref(frame)
+ 
+             len1 = avcodec_decode_audio4(vs.audio_st.codec,
+                     frame, &got_frame, pkt)
+@@ -784,7 +784,7 @@ cdef void alloc_picture(void *userdata) 
+ 
+     vp.ff_data_size = avpicture_get_size(PF_RGB24, vp.width, vp.height)
+     vp.ff_data = <unsigned char *>av_malloc(vp.ff_data_size * sizeof(unsigned char))
+-    vp.bmp = avcodec_alloc_frame()
++    vp.bmp = av_frame_alloc()
+     avpicture_fill(<AVPicture *>vp.bmp, vp.ff_data, PF_RGB24,
+             vp.width, vp.height)
+ 
+@@ -886,19 +886,6 @@ cdef double synchronize_video(VideoState
+     return pts
+ 
+ 
+-cdef int our_get_buffer(AVCodecContext *c, AVFrame *pic) nogil:
+-    cdef int ret = avcodec_default_get_buffer(c, pic)
+-    cdef uint64_t *pts = <uint64_t*>av_malloc(sizeof(uint64_t))
+-    memcpy(pts, &global_video_pkt_pts, sizeof(uint64_t))
+-    pic.opaque = pts
+-    return ret
+-
+-
+-cdef void our_release_buffer(AVCodecContext *c, AVFrame *pic) nogil:
+-    if pic != NULL: av_freep(&pic.opaque)
+-    avcodec_default_release_buffer(c, pic)
+-
+-
+ cdef int video_thread(void *arg) nogil:
+     cdef VideoState *vs = <VideoState *>arg
+     cdef AVPacket pkt1, *packet = &pkt1
+@@ -906,7 +893,7 @@ cdef int video_thread(void *arg) nogil:
+     cdef AVFrame *pFrame
+     cdef double pts, ptst = 0
+ 
+-    pFrame = avcodec_alloc_frame()
++    pFrame = av_frame_alloc()
+ 
+     while True:
+         if packet_queue_get(&vs.videoq, packet, 1) < 0:
+@@ -1038,8 +1025,6 @@ cdef int stream_component_open(VideoStat
+ 
+         packet_queue_init(&vs.videoq)
+         vs.video_tid = SDL_CreateThread(video_thread, vs)
+-        codecCtx.get_buffer = our_get_buffer
+-        codecCtx.release_buffer = our_release_buffer
+ 
+     else:
+         pass



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201611060814.uA68E4Cl044060>