diff options
author | jbeich <jbeich@FreeBSD.org> | 2016-11-06 16:14:03 +0800 |
---|---|---|
committer | jbeich <jbeich@FreeBSD.org> | 2016-11-06 16:14:03 +0800 |
commit | 9e66bf0b9608018b166014493a46b1d6c977bb1a (patch) | |
tree | 204a069fda3e504f5ee749490b59c9b82ec953a5 /multimedia | |
parent | d1241071d2098d752e91839bee731f8d7c41333a (diff) | |
download | freebsd-ports-gnome-9e66bf0b9608018b166014493a46b1d6c977bb1a.tar.gz freebsd-ports-gnome-9e66bf0b9608018b166014493a46b1d6c977bb1a.tar.zst freebsd-ports-gnome-9e66bf0b9608018b166014493a46b1d6c977bb1a.zip |
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)
Diffstat (limited to 'multimedia')
-rw-r--r-- | multimedia/py-ffmpeg/Makefile | 2 | ||||
-rw-r--r-- | multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pxi | 29 | ||||
-rw-r--r-- | multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pyx | 63 |
3 files changed, 93 insertions, 1 deletions
diff --git a/multimedia/py-ffmpeg/Makefile b/multimedia/py-ffmpeg/Makefile index a7fcfc61ebcc..a20486e74d85 100644 --- a/multimedia/py-ffmpeg/Makefile +++ b/multimedia/py-ffmpeg/Makefile @@ -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} diff --git a/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pxi b/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pxi new file mode 100644 index 000000000000..197a63c7e2ef --- /dev/null +++ b/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pxi @@ -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: diff --git a/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pyx b/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pyx new file mode 100644 index 000000000000..199d605de161 --- /dev/null +++ b/multimedia/py-ffmpeg/files/patch-ffmpeg___ffmpeg.pyx @@ -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 |