openbsd-ports/telephony/iaxclient/patches/patch-lib_codec_ffmpeg_c
sebastia 680af8810d Make iaxclient work wiht newer ffmpeg API
tested on i386 and macppc by myself with net/coccinella.
From Brad.

OK ajacoutot@
2012-04-30 09:48:21 +00:00

63 lines
1.6 KiB
Plaintext

$OpenBSD: patch-lib_codec_ffmpeg_c,v 1.2 2012/04/30 09:48:21 sebastia Exp $
Update for newer FFmpeg API.
--- lib/codec_ffmpeg.c.orig Mon Apr 7 12:05:42 2008
+++ lib/codec_ffmpeg.c Sat Apr 28 23:31:52 2012
@@ -23,11 +23,7 @@
#include "codec_ffmpeg.h"
#include "iaxclient_lib.h"
-#ifdef WIN32
#include "libavcodec/avcodec.h"
-#else
-#include <ffmpeg/avcodec.h>
-#endif
struct slice_header_t
{
@@ -165,10 +161,14 @@ static int pass_frame_to_decoder(AVCodecContext * avct
{
int bytes_decoded;
int got_picture;
+ AVPacket pkt;
- bytes_decoded = avcodec_decode_video(avctx, picture, &got_picture,
- in, inlen);
+ pkt.data = in;
+ pkt.size = inlen;
+ bytes_decoded = avcodec_decode_video2(avctx, picture, &got_picture,
+ &pkt);
+
if ( bytes_decoded != inlen )
{
fprintf(stderr,
@@ -309,10 +309,14 @@ static int decode_rtp_slice(struct iaxc_video_codec *
{
int bytes_decoded;
int got_picture;
+ AVPacket pkt;
- bytes_decoded = avcodec_decode_video(d->avctx, d->picture,
- &got_picture, (unsigned char *)in, inlen);
+ pkt.data = (unsigned char *)in;
+ pkt.size = inlen;
+ bytes_decoded = avcodec_decode_video2(d->avctx, d->picture,
+ &got_picture, &pkt);
+
if ( bytes_decoded < 0 )
{
fprintf(stderr,
@@ -523,9 +527,6 @@ struct iaxc_video_codec *codec_video_ffmpeg_new(int fo
e->avctx->gop_size = framerate * 3;
e->avctx->pix_fmt = PIX_FMT_YUV420P;
e->avctx->has_b_frames = 0;
-
- e->avctx->mb_qmin = e->avctx->qmin = 10;
- e->avctx->mb_qmax = e->avctx->qmax = 10;
e->avctx->lmin = 2 * FF_QP2LAMBDA;
e->avctx->lmax = 10 * FF_QP2LAMBDA;