Gentoo Archives: gentoo-commits

From: Alexis Ballier <aballier@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: media-libs/mediastreamer/files/, media-libs/mediastreamer/
Date: Mon, 05 Sep 2016 08:30:10
Message-Id: 1473064158.a90dcab374205a544499e3fc16dc79a6b1ecd208.aballier@gentoo
1 commit: a90dcab374205a544499e3fc16dc79a6b1ecd208
2 Author: Alexis Ballier <aballier <AT> gentoo <DOT> org>
3 AuthorDate: Mon Sep 5 08:29:09 2016 +0000
4 Commit: Alexis Ballier <aballier <AT> gentoo <DOT> org>
5 CommitDate: Mon Sep 5 08:29:18 2016 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a90dcab3
7
8 media-libs/mediastreamer: fix build with ffmpeg-3, part of bug #539872
9
10 Package-Manager: portage-2.3.0
11
12 .../files/mediastreamer-2.9.0-ffmpeg3.patch | 482 +++++++++++++++++++++
13 .../mediastreamer/mediastreamer-2.9.0-r1.ebuild | 5 +-
14 2 files changed, 485 insertions(+), 2 deletions(-)
15
16 diff --git a/media-libs/mediastreamer/files/mediastreamer-2.9.0-ffmpeg3.patch b/media-libs/mediastreamer/files/mediastreamer-2.9.0-ffmpeg3.patch
17 new file mode 100644
18 index 00000000..a536270
19 --- /dev/null
20 +++ b/media-libs/mediastreamer/files/mediastreamer-2.9.0-ffmpeg3.patch
21 @@ -0,0 +1,482 @@
22 +Index: mediastreamer-2.9.0/src/utils/ffmpeg-priv.h
23 +===================================================================
24 +--- mediastreamer-2.9.0.orig/src/utils/ffmpeg-priv.h
25 ++++ mediastreamer-2.9.0/src/utils/ffmpeg-priv.h
26 +@@ -69,9 +69,6 @@ static inline int avcodec_decode_video2(
27 + return avcodec_decode_video(avctx,picture, got_picture_ptr,avpkt->data,avpkt->size);
28 + }
29 + #endif
30 +-#if (LIBAVCODEC_VERSION_MAJOR >= 56)
31 +-#include <libavcodec/old_codec_ids.h>
32 +-#endif
33 + #if LIBAVCODEC_VERSION_INT >= AV_VERSION_INT(54,25,0)
34 + #define CodecID AVCodecID
35 + #endif
36 +Index: mediastreamer-2.9.0/src/videofilters/h264dec.c
37 +===================================================================
38 +--- mediastreamer-2.9.0.orig/src/videofilters/h264dec.c
39 ++++ mediastreamer-2.9.0/src/videofilters/h264dec.c
40 +@@ -56,7 +56,7 @@ static void ffmpeg_init(){
41 + static void dec_open(DecData *d){
42 + AVCodec *codec;
43 + int error;
44 +- codec=avcodec_find_decoder(CODEC_ID_H264);
45 ++ codec=avcodec_find_decoder(AV_CODEC_ID_H264);
46 + if (codec==NULL) ms_fatal("Could not find H264 decoder in ffmpeg.");
47 + avcodec_get_context_defaults3(&d->av_context, NULL);
48 + error=avcodec_open2(&d->av_context,codec, NULL);
49 +@@ -119,7 +119,7 @@ static mblk_t *get_as_yuvmsg(MSFilter *f
50 + s->outbuf.w=ctx->width;
51 + s->outbuf.h=ctx->height;
52 + s->sws_ctx=sws_getContext(ctx->width,ctx->height,ctx->pix_fmt,
53 +- ctx->width,ctx->height,PIX_FMT_YUV420P,SWS_FAST_BILINEAR,
54 ++ ctx->width,ctx->height,AV_PIX_FMT_YUV420P,SWS_FAST_BILINEAR,
55 + NULL, NULL, NULL);
56 + }
57 + #if LIBSWSCALE_VERSION_INT >= AV_VERSION_INT(0,9,0)
58 +@@ -272,7 +272,7 @@ static void dec_process(MSFilter *f){
59 + int len;
60 + int got_picture=0;
61 + AVPacket pkt;
62 +- avcodec_get_frame_defaults(&orig);
63 ++ av_frame_unref(&orig);
64 + av_init_packet(&pkt);
65 + pkt.data = p;
66 + pkt.size = end-p;
67 +Index: mediastreamer-2.9.0/src/videofilters/jpegwriter.c
68 +===================================================================
69 +--- mediastreamer-2.9.0.orig/src/videofilters/jpegwriter.c
70 ++++ mediastreamer-2.9.0/src/videofilters/jpegwriter.c
71 +@@ -36,9 +36,9 @@ typedef struct {
72 +
73 + static void jpg_init(MSFilter *f){
74 + JpegWriter *s=ms_new0(JpegWriter,1);
75 +- s->codec=avcodec_find_encoder(CODEC_ID_MJPEG);
76 ++ s->codec=avcodec_find_encoder(AV_CODEC_ID_MJPEG);
77 + if (s->codec==NULL){
78 +- ms_error("Could not find CODEC_ID_MJPEG !");
79 ++ ms_error("Could not find AV_CODEC_ID_MJPEG !");
80 + }
81 + f->data=s;
82 + }
83 +@@ -96,7 +96,7 @@ static void jpg_process(MSFilter *f){
84 + avctx->height=yuvbuf.h;
85 + avctx->time_base.num = 1;
86 + avctx->time_base.den =1;
87 +- avctx->pix_fmt=PIX_FMT_YUVJ420P;
88 ++ avctx->pix_fmt=AV_PIX_FMT_YUVJ420P;
89 +
90 + error=avcodec_open2(avctx,s->codec,NULL);
91 + if (error!=0) {
92 +@@ -105,7 +105,7 @@ static void jpg_process(MSFilter *f){
93 + av_free(avctx);
94 + return;
95 + }
96 +- sws_ctx=sws_getContext(avctx->width,avctx->height,PIX_FMT_YUV420P,
97 ++ sws_ctx=sws_getContext(avctx->width,avctx->height,AV_PIX_FMT_YUV420P,
98 + avctx->width,avctx->height,avctx->pix_fmt,SWS_FAST_BILINEAR,NULL, NULL, NULL);
99 + if (sws_ctx==NULL) {
100 + ms_error(" sws_getContext() failed.");
101 +@@ -126,13 +126,18 @@ static void jpg_process(MSFilter *f){
102 + }
103 + sws_freeContext(sws_ctx);
104 +
105 +- avcodec_get_frame_defaults(&pict);
106 ++ av_frame_unref(&pict);
107 + avpicture_fill((AVPicture*)&pict,(uint8_t*)jpegm->b_rptr,avctx->pix_fmt,avctx->width,avctx->height);
108 +- error=avcodec_encode_video(avctx, (uint8_t*)comp_buf,comp_buf_sz, &pict);
109 ++ AVPacket pkt;
110 ++ av_init_packet(&pkt);
111 ++ pkt.buf = (uint8_t*)comp_buf;
112 ++ pkt.size = comp_buf_sz;
113 ++ int got_packet;
114 ++ error=avcodec_encode_video2(avctx, &pkt, &pict, &got_packet);
115 + if (error<0){
116 + ms_error("Could not encode jpeg picture.");
117 +- }else{
118 +- if (fwrite(comp_buf,error,1,s->file)>0){
119 ++ }else if(got_packet){
120 ++ if (fwrite(comp_buf,pkt.size,1,s->file)>0){
121 + ms_message("Snapshot done");
122 + }else{
123 + ms_error("Error writing snapshot.");
124 +Index: mediastreamer-2.9.0/src/videofilters/nowebcam.c
125 +===================================================================
126 +--- mediastreamer-2.9.0.orig/src/videofilters/nowebcam.c
127 ++++ mediastreamer-2.9.0/src/videofilters/nowebcam.c
128 +@@ -61,7 +61,7 @@ static mblk_t *jpeg2yuv(uint8_t *jpgbuf,
129 + struct SwsContext *sws_ctx;
130 + AVPacket pkt;
131 + MSPicture dest;
132 +- AVCodec *codec=avcodec_find_decoder(CODEC_ID_MJPEG);
133 ++ AVCodec *codec=avcodec_find_decoder(AV_CODEC_ID_MJPEG);
134 +
135 + if (codec==NULL){
136 + ms_error("Could not find MJPEG decoder in ffmpeg.");
137 +@@ -84,9 +84,9 @@ static mblk_t *jpeg2yuv(uint8_t *jpgbuf,
138 + }
139 + ret=ms_yuv_buf_alloc(&dest, reqsize->width,reqsize->height);
140 + /* not using SWS_FAST_BILINEAR because it doesn't play well with
141 +- * av_context.pix_fmt set to PIX_FMT_YUVJ420P by jpeg decoder */
142 ++ * av_context.pix_fmt set to AV_PIX_FMT_YUVJ420P by jpeg decoder */
143 + sws_ctx=sws_getContext(av_context.width,av_context.height,av_context.pix_fmt,
144 +- reqsize->width,reqsize->height,PIX_FMT_YUV420P,SWS_BILINEAR,
145 ++ reqsize->width,reqsize->height,AV_PIX_FMT_YUV420P,SWS_BILINEAR,
146 + NULL, NULL, NULL);
147 + if (sws_ctx==NULL) {
148 + ms_error("jpeg2yuv: ms_sws_getContext() failed.");
149 +Index: mediastreamer-2.9.0/src/videofilters/videodec.c
150 +===================================================================
151 +--- mediastreamer-2.9.0.orig/src/videofilters/videodec.c
152 ++++ mediastreamer-2.9.0/src/videofilters/videodec.c
153 +@@ -40,7 +40,7 @@ typedef struct DecState{
154 + YuvBuf outbuf;
155 + mblk_t *yuv_msg;
156 + struct SwsContext *sws_ctx;
157 +- enum PixelFormat output_pix_fmt;
158 ++ enum AVPixelFormat output_pix_fmt;
159 + uint8_t dci[512];
160 + int dci_size;
161 + uint64_t last_error_reported_time;
162 +@@ -58,7 +58,7 @@ static void dec_init(MSFilter *f, enum C
163 + s->codec=cid;
164 + s->input=NULL;
165 + s->yuv_msg=NULL;
166 +- s->output_pix_fmt=PIX_FMT_YUV420P;
167 ++ s->output_pix_fmt=AV_PIX_FMT_YUV420P;
168 + s->snow_initialized=FALSE;
169 + s->outbuf.w=0;
170 + s->outbuf.h=0;
171 +@@ -77,19 +77,19 @@ static void dec_init(MSFilter *f, enum C
172 + }
173 +
174 + static void dec_h263_init(MSFilter *f){
175 +- dec_init(f,CODEC_ID_H263);
176 ++ dec_init(f,AV_CODEC_ID_H263);
177 + }
178 +
179 + static void dec_mpeg4_init(MSFilter *f){
180 +- dec_init(f,CODEC_ID_MPEG4);
181 ++ dec_init(f,AV_CODEC_ID_MPEG4);
182 + }
183 +
184 + static void dec_mjpeg_init(MSFilter *f){
185 +- dec_init(f,CODEC_ID_MJPEG);
186 ++ dec_init(f,AV_CODEC_ID_MJPEG);
187 + }
188 +
189 + static void dec_snow_init(MSFilter *f){
190 +- dec_init(f,CODEC_ID_SNOW);
191 ++ dec_init(f,AV_CODEC_ID_SNOW);
192 + }
193 +
194 + static void dec_uninit(MSFilter *f){
195 +@@ -134,10 +134,10 @@ static void dec_preprocess(MSFilter *f){
196 + s->first_image_decoded = FALSE;
197 + if (s->av_context.codec==NULL){
198 + /* we must know picture size before initializing snow decoder*/
199 +- if (s->codec!=CODEC_ID_SNOW){
200 ++ if (s->codec!=AV_CODEC_ID_SNOW){
201 + error=avcodec_open2(&s->av_context, s->av_codec,NULL);
202 + if (error!=0) ms_error("avcodec_open2() failed: %i",error);
203 +- if (s->codec==CODEC_ID_MPEG4 && s->dci_size>0){
204 ++ if (s->codec==AV_CODEC_ID_MPEG4 && s->dci_size>0){
205 + s->av_context.extradata=s->dci;
206 + s->av_context.extradata_size=s->dci_size;
207 + }
208 +@@ -643,8 +643,8 @@ static void dec_process_frame(MSFilter *
209 +
210 + if (f->desc->id==MS_H263_DEC_ID) inm=skip_rfc2429_header(inm);
211 + else if (f->desc->id==MS_H263_OLD_DEC_ID) inm=skip_rfc2190_header(inm);
212 +- else if (s->codec==CODEC_ID_SNOW && s->input==NULL) inm=parse_snow_header(s,inm);
213 +- else if (s->codec==CODEC_ID_MJPEG && f->desc->id==MS_JPEG_DEC_ID) inm=read_rfc2435_header(s,inm);
214 ++ else if (s->codec==AV_CODEC_ID_SNOW && s->input==NULL) inm=parse_snow_header(s,inm);
215 ++ else if (s->codec==AV_CODEC_ID_MJPEG && f->desc->id==MS_JPEG_DEC_ID) inm=read_rfc2435_header(s,inm);
216 +
217 + if (inm){
218 + /* accumulate the video packet until we have the rtp markbit*/
219 +Index: mediastreamer-2.9.0/src/videofilters/videoenc.c
220 +===================================================================
221 +--- mediastreamer-2.9.0.orig/src/videofilters/videoenc.c
222 ++++ mediastreamer-2.9.0/src/videofilters/videoenc.c
223 +@@ -223,19 +223,19 @@ static void enc_init(MSFilter *f, enum C
224 + }
225 +
226 + static void enc_h263_init(MSFilter *f){
227 +- enc_init(f,CODEC_ID_H263P);
228 ++ enc_init(f,AV_CODEC_ID_H263P);
229 + }
230 +
231 + static void enc_mpeg4_init(MSFilter *f){
232 +- enc_init(f,CODEC_ID_MPEG4);
233 ++ enc_init(f,AV_CODEC_ID_MPEG4);
234 + }
235 +
236 + static void enc_snow_init(MSFilter *f){
237 +- enc_init(f,CODEC_ID_SNOW);
238 ++ enc_init(f,AV_CODEC_ID_SNOW);
239 + }
240 +
241 + static void enc_mjpeg_init(MSFilter *f){
242 +- enc_init(f,CODEC_ID_MJPEG);
243 ++ enc_init(f,AV_CODEC_ID_MJPEG);
244 + }
245 +
246 + static void prepare(EncState *s){
247 +@@ -243,7 +243,7 @@ static void prepare(EncState *s){
248 + const int max_br_vbv=128000;
249 +
250 + avcodec_get_context_defaults3(c, NULL);
251 +- if (s->codec==CODEC_ID_MJPEG)
252 ++ if (s->codec==AV_CODEC_ID_MJPEG)
253 + {
254 + ms_message("Codec bitrate set to %i",c->bit_rate);
255 + c->width = s->vsize.width;
256 +@@ -251,7 +251,7 @@ static void prepare(EncState *s){
257 + c->time_base.num = 1;
258 + c->time_base.den = (int)s->fps;
259 + c->gop_size=(int)s->fps*5; /*emit I frame every 5 seconds*/
260 +- c->pix_fmt=PIX_FMT_YUVJ420P;
261 ++ c->pix_fmt=AV_PIX_FMT_YUVJ420P;
262 + s->comp_buf=allocb(c->bit_rate*2,0);
263 + return;
264 + }
265 +@@ -269,7 +269,7 @@ static void prepare(EncState *s){
266 +
267 + /* ffmpeg vbv rate control consumes too much cpu above a certain target bitrate.
268 + We don't use it above max_br_vbv */
269 +- if (s->codec!=CODEC_ID_SNOW && s->maxbr<max_br_vbv){
270 ++ if (s->codec!=AV_CODEC_ID_SNOW && s->maxbr<max_br_vbv){
271 + /*snow does not like 1st pass rate control*/
272 + c->rc_max_rate=c->bit_rate;
273 + c->rc_min_rate=0;
274 +@@ -285,9 +285,9 @@ static void prepare(EncState *s){
275 + c->time_base.num = 1;
276 + c->time_base.den = (int)s->fps;
277 + c->gop_size=(int)s->fps*10; /*emit I frame every 10 seconds*/
278 +- c->pix_fmt=PIX_FMT_YUV420P;
279 ++ c->pix_fmt=AV_PIX_FMT_YUV420P;
280 + s->comp_buf=allocb(c->bit_rate*2,0);
281 +- if (s->codec==CODEC_ID_SNOW){
282 ++ if (s->codec==AV_CODEC_ID_SNOW){
283 + c->strict_std_compliance=-2;
284 + }
285 +
286 +@@ -304,7 +304,7 @@ static void prepare_h263(EncState *s){
287 + #endif
288 + c->rtp_payload_size = s->mtu/2;
289 + if (s->profile==0){
290 +- s->codec=CODEC_ID_H263;
291 ++ s->codec=AV_CODEC_ID_H263;
292 + }else{
293 + /*
294 + c->flags|=CODEC_FLAG_H263P_UMV;
295 +@@ -313,7 +313,7 @@ static void prepare_h263(EncState *s){
296 + c->flags|=CODEC_FLAG_OBMC;
297 + c->flags|=CODEC_FLAG_AC_PRED;
298 + */
299 +- s->codec=CODEC_ID_H263P;
300 ++ s->codec=AV_CODEC_ID_H263P;
301 + }
302 + }
303 +
304 +@@ -331,13 +331,13 @@ static void enc_preprocess(MSFilter *f){
305 + EncState *s=(EncState*)f->data;
306 + int error;
307 + prepare(s);
308 +- if (s->codec==CODEC_ID_H263P || s->codec==CODEC_ID_H263)
309 ++ if (s->codec==AV_CODEC_ID_H263P || s->codec==AV_CODEC_ID_H263)
310 + prepare_h263(s);
311 +- else if (s->codec==CODEC_ID_MPEG4)
312 ++ else if (s->codec==AV_CODEC_ID_MPEG4)
313 + prepare_mpeg4(s);
314 +- else if (s->codec==CODEC_ID_SNOW){
315 ++ else if (s->codec==AV_CODEC_ID_SNOW){
316 + /**/
317 +- }else if (s->codec==CODEC_ID_MJPEG){
318 ++ }else if (s->codec==AV_CODEC_ID_MJPEG){
319 + /**/
320 + }else {
321 + ms_error("Unsupported codec id %i",s->codec);
322 +@@ -724,12 +724,12 @@ static void split_and_send(MSFilter *f,
323 + uint8_t *psc;
324 + uint32_t timestamp=f->ticker->time*90LL;
325 +
326 +- if (s->codec==CODEC_ID_MPEG4 || s->codec==CODEC_ID_SNOW)
327 ++ if (s->codec==AV_CODEC_ID_MPEG4 || s->codec==AV_CODEC_ID_SNOW)
328 + {
329 + mpeg4_fragment_and_send(f,s,frame,timestamp);
330 + return;
331 + }
332 +- else if (s->codec==CODEC_ID_MJPEG)
333 ++ else if (s->codec==AV_CODEC_ID_MJPEG)
334 + {
335 + mblk_t *lqt=NULL;
336 + mblk_t *cqt=NULL;
337 +@@ -765,7 +765,7 @@ static void split_and_send(MSFilter *f,
338 +
339 + static void process_frame(MSFilter *f, mblk_t *inm){
340 + EncState *s=(EncState*)f->data;
341 +- AVFrame pict;
342 ++ AVFrame pict = {};
343 + AVCodecContext *c=&s->av_context;
344 + int error;
345 + mblk_t *comp_buf=s->comp_buf;
346 +@@ -774,7 +774,7 @@ static void process_frame(MSFilter *f, m
347 +
348 + ms_yuv_buf_init_from_mblk(&yuv, inm);
349 + /* convert image if necessary */
350 +- avcodec_get_frame_defaults(&pict);
351 ++ av_frame_unref(&pict);
352 + avpicture_fill((AVPicture*)&pict,yuv.planes[0],c->pix_fmt,c->width,c->height);
353 +
354 + /* timestamp used by ffmpeg, unset here */
355 +@@ -789,7 +789,7 @@ static void process_frame(MSFilter *f, m
356 + s->req_vfu=FALSE;
357 + }
358 + comp_buf->b_rptr=comp_buf->b_wptr=comp_buf->b_datap->db_base;
359 +- if (s->codec==CODEC_ID_SNOW){
360 ++ if (s->codec==AV_CODEC_ID_SNOW){
361 + //prepend picture size
362 + uint32_t header=((s->vsize.width&0xffff)<<16) | (s->vsize.height&0xffff);
363 + *(uint32_t*)comp_buf->b_wptr=htonl(header);
364 +@@ -797,10 +797,15 @@ static void process_frame(MSFilter *f, m
365 + comp_buf_sz-=4;
366 + }
367 +
368 +- error=avcodec_encode_video(c, (uint8_t*)comp_buf->b_wptr,comp_buf_sz, &pict);
369 ++ AVPacket pkt;
370 ++ av_init_packet(&pkt);
371 ++ pkt.data = (uint8_t*)comp_buf->b_wptr;
372 ++ pkt.size = comp_buf_sz;
373 ++ int got_packet;
374 ++ error=avcodec_encode_video2(c, &pkt, &pict, &got_packet);
375 +
376 + if (error<=0) ms_warning("ms_AVencoder_process: error %i.",error);
377 +- else{
378 ++ else if(got_packet){
379 + s->framenum++;
380 + if (s->framenum==1){
381 + video_starter_first_frame (&s->starter,f->ticker->time);
382 +@@ -808,7 +813,7 @@ static void process_frame(MSFilter *f, m
383 + if (c->coded_frame->pict_type==FF_I_TYPE){
384 + ms_message("Emitting I-frame");
385 + }
386 +- comp_buf->b_wptr+=error;
387 ++ comp_buf->b_wptr+=pkt.size;
388 + split_and_send(f,s,comp_buf);
389 + }
390 + freemsg(inm);
391 +@@ -837,7 +842,7 @@ static int enc_get_br(MSFilter *f, void
392 +
393 + static int enc_set_br(MSFilter *f, void *arg){
394 + EncState *s=(EncState*)f->data;
395 +- bool_t snow=s->codec==CODEC_ID_SNOW;
396 ++ bool_t snow=s->codec==AV_CODEC_ID_SNOW;
397 + s->maxbr=*(int*)arg;
398 + if (s->av_context.codec!=NULL){
399 + /*when we are processing, apply new settings immediately*/
400 +@@ -847,11 +852,11 @@ static int enc_set_br(MSFilter *f, void
401 + ms_filter_unlock(f);
402 + return 0;
403 + }
404 +- if (s->maxbr>=1024000 && s->codec!=CODEC_ID_H263P){
405 ++ if (s->maxbr>=1024000 && s->codec!=AV_CODEC_ID_H263P){
406 + s->vsize.width = MS_VIDEO_SIZE_SVGA_W;
407 + s->vsize.height = MS_VIDEO_SIZE_SVGA_H;
408 + s->fps=25;
409 +- }else if (s->maxbr>=800000 && s->codec!=CODEC_ID_H263P){
410 ++ }else if (s->maxbr>=800000 && s->codec!=AV_CODEC_ID_H263P){
411 + s->vsize.width = MS_VIDEO_SIZE_VGA_W;
412 + s->vsize.height = MS_VIDEO_SIZE_VGA_H;
413 + s->fps=25;
414 +@@ -864,7 +869,7 @@ static int enc_set_br(MSFilter *f, void
415 + s->vsize.height=MS_VIDEO_SIZE_CIF_H;
416 + s->fps=17;
417 + s->qmin=3;
418 +- }else if (s->maxbr>=170000 && s->codec!=CODEC_ID_H263P && s->codec!=CODEC_ID_H263){
419 ++ }else if (s->maxbr>=170000 && s->codec!=AV_CODEC_ID_H263P && s->codec!=AV_CODEC_ID_H263){
420 + s->vsize.width=MS_VIDEO_SIZE_QVGA_W;
421 + s->vsize.height=MS_VIDEO_SIZE_QVGA_H;
422 + s->fps=15;
423 +@@ -1075,15 +1080,15 @@ MSFilterDesc ms_mjpeg_enc_desc={
424 +
425 + void __register_ffmpeg_encoders_if_possible(void){
426 + ms_ffmpeg_check_init();
427 +- if (avcodec_find_encoder(CODEC_ID_MPEG4))
428 ++ if (avcodec_find_encoder(AV_CODEC_ID_MPEG4))
429 + ms_filter_register(&ms_mpeg4_enc_desc);
430 +- if (avcodec_find_encoder(CODEC_ID_H263)){
431 ++ if (avcodec_find_encoder(AV_CODEC_ID_H263)){
432 + ms_filter_register(&ms_h263_enc_desc);
433 + ms_filter_register(&ms_h263_old_enc_desc);
434 + }
435 +- if (avcodec_find_encoder(CODEC_ID_SNOW))
436 ++ if (avcodec_find_encoder(AV_CODEC_ID_SNOW))
437 + ms_filter_register(&ms_snow_enc_desc);
438 +- if (avcodec_find_encoder(CODEC_ID_MJPEG))
439 ++ if (avcodec_find_encoder(AV_CODEC_ID_MJPEG))
440 + {
441 + ms_filter_register(&ms_mjpeg_enc_desc);
442 + }
443 +Index: mediastreamer-2.9.0/src/voip/msvideo.c
444 +===================================================================
445 +--- mediastreamer-2.9.0.orig/src/voip/msvideo.c
446 ++++ mediastreamer-2.9.0/src/voip/msvideo.c
447 +@@ -351,21 +351,21 @@ void ms_rgb_to_yuv(const uint8_t rgb[3],
448 + int ms_pix_fmt_to_ffmpeg(MSPixFmt fmt){
449 + switch(fmt){
450 + case MS_RGBA32:
451 +- return PIX_FMT_RGBA;
452 ++ return AV_PIX_FMT_RGBA;
453 + case MS_RGB24:
454 +- return PIX_FMT_RGB24;
455 ++ return AV_PIX_FMT_RGB24;
456 + case MS_RGB24_REV:
457 +- return PIX_FMT_BGR24;
458 ++ return AV_PIX_FMT_BGR24;
459 + case MS_YUV420P:
460 +- return PIX_FMT_YUV420P;
461 ++ return AV_PIX_FMT_YUV420P;
462 + case MS_YUYV:
463 +- return PIX_FMT_YUYV422;
464 ++ return AV_PIX_FMT_YUYV422;
465 + case MS_UYVY:
466 +- return PIX_FMT_UYVY422;
467 ++ return AV_PIX_FMT_UYVY422;
468 + case MS_YUY2:
469 +- return PIX_FMT_YUYV422; /* <- same as MS_YUYV */
470 ++ return AV_PIX_FMT_YUYV422; /* <- same as MS_YUYV */
471 + case MS_RGB565:
472 +- return PIX_FMT_RGB565;
473 ++ return AV_PIX_FMT_RGB565;
474 + default:
475 + ms_fatal("format not supported.");
476 + return -1;
477 +@@ -375,19 +375,19 @@ int ms_pix_fmt_to_ffmpeg(MSPixFmt fmt){
478 +
479 + MSPixFmt ffmpeg_pix_fmt_to_ms(int fmt){
480 + switch(fmt){
481 +- case PIX_FMT_RGB24:
482 ++ case AV_PIX_FMT_RGB24:
483 + return MS_RGB24;
484 +- case PIX_FMT_BGR24:
485 ++ case AV_PIX_FMT_BGR24:
486 + return MS_RGB24_REV;
487 +- case PIX_FMT_YUV420P:
488 ++ case AV_PIX_FMT_YUV420P:
489 + return MS_YUV420P;
490 +- case PIX_FMT_YUYV422:
491 ++ case AV_PIX_FMT_YUYV422:
492 + return MS_YUYV; /* same as MS_YUY2 */
493 +- case PIX_FMT_UYVY422:
494 ++ case AV_PIX_FMT_UYVY422:
495 + return MS_UYVY;
496 +- case PIX_FMT_RGBA:
497 ++ case AV_PIX_FMT_RGBA:
498 + return MS_RGBA32;
499 +- case PIX_FMT_RGB565:
500 ++ case AV_PIX_FMT_RGB565:
501 + return MS_RGB565;
502 + default:
503 + ms_fatal("format not supported.");
504
505 diff --git a/media-libs/mediastreamer/mediastreamer-2.9.0-r1.ebuild b/media-libs/mediastreamer/mediastreamer-2.9.0-r1.ebuild
506 index 71a94d1..1b1abb8 100644
507 --- a/media-libs/mediastreamer/mediastreamer-2.9.0-r1.ebuild
508 +++ b/media-libs/mediastreamer/mediastreamer-2.9.0-r1.ebuild
509 @@ -1,4 +1,4 @@
510 -# Copyright 1999-2015 Gentoo Foundation
511 +# Copyright 1999-2016 Gentoo Foundation
512 # Distributed under the terms of the GNU General Public License v2
513 # $Id$
514
515 @@ -100,7 +100,8 @@ src_prepare() {
516 "${FILESDIR}/${P}-libav9.patch" \
517 "${FILESDIR}/${P}-underlinking.patch" \
518 "${FILESDIR}/${P}-tests.patch" \
519 - "${FILESDIR}/${P}-xxd.patch"
520 + "${FILESDIR}/${P}-xxd.patch" \
521 + "${FILESDIR}/${P}-ffmpeg3.patch"
522
523 eautoreconf
524 }