]> git.pld-linux.org Git - packages/opal.git/blob - ffmpeg.patch
- use libsrtp2 instead of srtp; partial ffmpeg update
[packages/opal.git] / ffmpeg.patch
1 Description: Backport changes for the libav 9 API
2  Also replace loading of libavcodec and libavutil via dlopen by linking against
3  it.
4 Author: Sebastian Ramacher <sramacher@debian.org>
5 Bug-Debian: http://bugs.debian.org/720824
6 Last-Update: 2013-09-12
7
8 --- a/plugins/video/H.263-1998/h263-1998.cxx
9 +++ b/plugins/video/H.263-1998/h263-1998.cxx
10 @@ -216,7 +216,7 @@
11      return false;
12    }
13  
14 -  m_context = FFMPEGLibraryInstance.AvcodecAllocContext();
15 +  m_context = FFMPEGLibraryInstance.AvcodecAllocContext(m_codec);
16    if (m_context == NULL) {
17      PTRACE(1, m_prefix, "Failed to allocate context for encoder");
18      return false;
19 @@ -312,6 +312,7 @@
20      return;
21    }
22  
23 +#ifdef CODEC_FLAG_H263P_UMV
24    if (STRCMPI(option, H263_ANNEX_D) == 0) {
25      // Annex D: Unrestructed Motion Vectors
26      // Level 2+ 
27 @@ -322,6 +323,7 @@
28        m_context->flags &= ~CODEC_FLAG_H263P_UMV; 
29      return;
30    }
31 +#endif
32  
33  #if 0 // DO NOT ENABLE THIS FLAG. FFMPEG IS NOT THREAD_SAFE WHEN THIS FLAG IS SET
34    if (STRCMPI(option, H263_ANNEX_F) == 0) {
35 @@ -356,6 +358,7 @@
36      return;
37    }
38  
39 +#ifdef CODEC_FLAG_H263P_SLICE_STRUCT
40    if (STRCMPI(option, H263_ANNEX_K) == 0) {
41      // Annex K: Slice Structure
42      // does not work with eyeBeam
43 @@ -365,7 +368,9 @@
44        m_context->flags &= ~CODEC_FLAG_H263P_SLICE_STRUCT; 
45      return;
46    }
47 +#endif
48  
49 +#ifdef CODEC_FLAG_H263P_AIV
50    if (STRCMPI(option, H263_ANNEX_S) == 0) {
51      // Annex S: Alternative INTER VLC mode
52      // does not work with eyeBeam
53 @@ -375,6 +380,7 @@
54        m_context->flags &= ~CODEC_FLAG_H263P_AIV; 
55      return;
56    }
57 +#endif
58  
59    if (STRCMPI(option, PLUGINCODEC_MEDIA_PACKETIZATION) == 0 ||
60        STRCMPI(option, PLUGINCODEC_MEDIA_PACKETIZATIONS) == 0) {
61 @@ -450,15 +456,6 @@
62    PTRACE(5, m_prefix, "qmax set to " << m_context->qmax);
63    PTRACE(5, m_prefix, "payload size set to " << m_context->rtp_payload_size);
64  
65 -  #define CODEC_TRACER_FLAG(tracer, flag) \
66 -    PTRACE(4, m_prefix, #flag " is " << ((m_context->flags & flag) ? "enabled" : "disabled"));
67 -  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_UMV);
68 -  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_OBMC);
69 -  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_AC_PRED);
70 -  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_SLICE_STRUCT)
71 -  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_LOOP_FILTER);
72 -  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_AIV);
73 -
74    return FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec) == 0;
75  }
76  
77 @@ -521,7 +518,7 @@
78  
79      // Need to copy to local buffer to guarantee 16 byte alignment
80      memcpy(m_inputFrame->data[0], OPAL_VIDEO_FRAME_DATA_PTR(header), header->width*header->height*3/2);
81 -    m_inputFrame->pict_type = (flags & PluginCodec_CoderForceIFrame) ? FF_I_TYPE : AV_PICTURE_TYPE_NONE;
82 +    m_inputFrame->pict_type = (flags & PluginCodec_CoderForceIFrame) ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_NONE;
83  
84      /*
85      m_inputFrame->pts = (int64_t)srcRTP.GetTimestamp()*m_context->time_base.den/m_context->time_base.num/VIDEO_CLOCKRATE;
86 @@ -603,13 +600,19 @@
87    m_context->rtp_callback = &H263_RFC2190_EncoderContext::RTPCallBack;
88    m_context->opaque = this; // used to separate out packets from different encode threads
89  
90 +#ifdef CODEC_FLAG_H263P_UMV
91    m_context->flags &= ~CODEC_FLAG_H263P_UMV;
92 +#endif
93    m_context->flags &= ~CODEC_FLAG_4MV;
94  #if LIBAVCODEC_RTP_MODE
95    m_context->flags &= ~CODEC_FLAG_H263P_AIC;
96  #endif
97 +#ifdef CODEC_FLAG_H263P_AIV
98    m_context->flags &= ~CODEC_FLAG_H263P_AIV;
99 +#endif
100 +#ifdef CODEC_FLAG_H263P_SLICE_STRUCT
101    m_context->flags &= ~CODEC_FLAG_H263P_SLICE_STRUCT;
102 +#endif
103  
104    return true;
105  }
106 @@ -658,7 +661,7 @@
107      return;
108    }
109  
110 -  m_context = FFMPEGLibraryInstance.AvcodecAllocContext();
111 +  m_context = FFMPEGLibraryInstance.AvcodecAllocContext(m_codec);
112    if (m_context == NULL) {
113      PTRACE(1, m_prefix, "Failed to allocate context for decoder");
114      return;
115 --- a/plugins/video/H.264/h264-x264.cxx
116 +++ b/plugins/video/H.264/h264-x264.cxx
117 @@ -48,6 +48,7 @@
118  #include "shared/h264frame.h"
119  #include "shared/x264wrap.h"
120  
121 +#include <cstdio>
122  
123  #define MY_CODEC      x264                                  // Name of codec (use C variable characters)
124  #define MY_CODEC_LOG "x264"
125 @@ -1067,18 +1068,17 @@
126        if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_H264)) == NULL)
127          return false;
128  
129 -      if ((m_context = FFMPEGLibraryInstance.AvcodecAllocContext()) == NULL)
130 +      if ((m_context = FFMPEGLibraryInstance.AvcodecAllocContext(m_codec)) == NULL)
131          return false;
132  
133        m_context->workaround_bugs = FF_BUG_AUTODETECT;
134 -      m_context->error_recognition = FF_ER_AGGRESSIVE;
135        m_context->idct_algo = FF_IDCT_H264;
136        m_context->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
137        m_context->flags = CODEC_FLAG_INPUT_PRESERVED | CODEC_FLAG_EMU_EDGE;
138 -      m_context->flags2 = CODEC_FLAG2_BRDO |
139 -                          CODEC_FLAG2_MEMC_ONLY |
140 +      m_context->flags2 = CODEC_FLAG2_SKIP_RD |
141 +#ifdef CODEC_FLAG2_DROP_FRAME_TIMECODE
142                            CODEC_FLAG2_DROP_FRAME_TIMECODE |
143 -                          CODEC_FLAG2_SKIP_RD |
144 +#endif
145                            CODEC_FLAG2_CHUNKS;
146  
147        if ((m_picture = FFMPEGLibraryInstance.AvcodecAllocFrame()) == NULL)
148 --- a/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
149 +++ b/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
150 @@ -589,17 +589,14 @@
151      m_avpicture->quality = m_videoQMin;
152  
153  #ifdef USE_ORIG
154 -    m_avcontext->flags |= CODEC_FLAG_PART;   // data partitioning
155      m_avcontext->flags |= CODEC_FLAG_4MV;    // 4 motion vectors
156  #else
157      m_avcontext->max_b_frames=0; /*don't use b frames*/
158      m_avcontext->flags|=CODEC_FLAG_AC_PRED;
159 -    m_avcontext->flags|=CODEC_FLAG_H263P_UMV;
160      /*c->flags|=CODEC_FLAG_QPEL;*/ /*don't enable this one: this forces profile_level to advanced simple profile */
161      m_avcontext->flags|=CODEC_FLAG_4MV;
162      m_avcontext->flags|=CODEC_FLAG_GMC;
163      m_avcontext->flags|=CODEC_FLAG_LOOP_FILTER;
164 -    m_avcontext->flags|=CODEC_FLAG_H263P_SLICE_STRUCT;
165  #endif
166      m_avcontext->opaque = this;              // for use in RTP callback
167  }
168 @@ -691,7 +688,12 @@
169  
170  bool MPEG4EncoderContext::OpenCodec()
171  {
172 -  m_avcontext = FFMPEGLibraryInstance.AvcodecAllocContext();
173 +  if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(CODEC_ID_MPEG4)) == NULL){
174 +    PTRACE(1, "MPEG4", "Encoder not found");
175 +    return false;
176 +  }
177 +
178 +  m_avcontext = FFMPEGLibraryInstance.AvcodecAllocContext(m_avcodec);
179    if (m_avcontext == NULL) {
180      PTRACE(1, "MPEG4", "Encoder failed to allocate context for encoder");
181      return false;
182 @@ -703,11 +705,6 @@
183      return false;
184    }
185  
186 -  if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(CODEC_ID_MPEG4)) == NULL){
187 -    PTRACE(1, "MPEG4", "Encoder not found");
188 -    return false;
189 -  }
190 -
191  #if PLUGINCODEC_TRACING
192    // debugging flags
193    if (PTRACE_CHECK(4)) {
194 @@ -804,7 +801,7 @@
195          // Should the next frame be an I-Frame?
196          if ((flags & PluginCodec_CoderForceIFrame) || (m_frameNum == 0))
197          {
198 -            m_avpicture->pict_type = FF_I_TYPE;
199 +            m_avpicture->pict_type = AV_PICTURE_TYPE_I;
200          }
201          else // No IFrame requested, let avcodec decide what to do
202          {
203 @@ -1325,7 +1322,6 @@
204  
205  void MPEG4DecoderContext::SetStaticDecodingParams() {
206      m_avcontext->flags |= CODEC_FLAG_4MV; 
207 -    m_avcontext->flags |= CODEC_FLAG_PART;
208      m_avcontext->workaround_bugs = 0; // no workaround for buggy implementations
209  }
210  
211 @@ -1399,7 +1395,7 @@
212          return false;
213      }
214          
215 -    m_avcontext = FFMPEGLibraryInstance.AvcodecAllocContext();
216 +    m_avcontext = FFMPEGLibraryInstance.AvcodecAllocContext(m_avcodec);
217      if (m_avcontext == NULL) {
218          PTRACE(1, "MPEG4", "Decoder failed to allocate context");
219          return false;
220 --- a/plugins/video/common/dyna.cxx
221 +++ b/plugins/video/common/dyna.cxx
222 @@ -38,6 +38,13 @@
223   *                 Matthias Schneider (ma30002000@yahoo.de)
224   */
225  #include "dyna.h"
226 +#include <cstdio>
227 +#include <cstdarg>
228 +
229 +extern "C" {
230 +#include <libavcodec/avcodec.h>
231 +#include <libavutil/mem.h>
232 +}
233  
234  bool DynaLink::Open(const char *name)
235  {
236 @@ -228,101 +235,15 @@
237    m_libAvutil.Close();
238  }
239  
240 -#define CHECK_AVUTIL(name, func) \
241 -      (seperateLibAvutil ? \
242 -        m_libAvutil.GetFunction(name,  (DynaLink::Function &)func) : \
243 -        m_libAvcodec.GetFunction(name, (DynaLink::Function &)func) \
244 -       ) \
245 -
246 -
247  bool FFMPEGLibrary::Load()
248  {
249    WaitAndSignal m(processLock);
250    if (IsLoaded())
251      return true;
252  
253 -  bool seperateLibAvutil = false;
254 -
255 -#ifdef LIBAVCODEC_LIB_NAME
256 -  if (m_libAvcodec.Open(LIBAVCODEC_LIB_NAME))
257 -    seperateLibAvutil = true;
258 -  else
259 -#endif
260 -  if (m_libAvcodec.Open("libavcodec"))
261 -    seperateLibAvutil = false;
262 -  else if (m_libAvcodec.Open("avcodec-" AV_STRINGIFY(LIBAVCODEC_VERSION_MAJOR)))
263 -    seperateLibAvutil = true;
264 -  else {
265 -    PTRACE(1, m_codecString, "Failed to load FFMPEG libavcodec library");
266 -    return false;
267 -  }
268 -
269 -  if (seperateLibAvutil &&
270 -        !(
271 -#ifdef LIBAVUTIL_LIB_NAME
272 -          m_libAvutil.Open(LIBAVUTIL_LIB_NAME) ||
273 -#endif
274 -          m_libAvutil.Open("libavutil") ||
275 -          m_libAvutil.Open("avutil-" AV_STRINGIFY(LIBAVUTIL_VERSION_MAJOR))
276 -        ) ) {
277 -    PTRACE(1, m_codecString, "Failed to load FFMPEG libavutil library");
278 -    return false;
279 -  }
280 -
281 -  strcpy(m_libAvcodec.m_codecString, m_codecString);
282 -  strcpy(m_libAvutil.m_codecString,  m_codecString);
283 -
284 -  if (!m_libAvcodec.GetFunction("avcodec_init", (DynaLink::Function &)Favcodec_init))
285 -    return false;
286 -
287 -  if (!m_libAvcodec.GetFunction("av_init_packet", (DynaLink::Function &)Fav_init_packet))
288 -    return false;
289 -
290 -  if (!m_libAvcodec.GetFunction("avcodec_register_all", (DynaLink::Function &)Favcodec_register_all))
291 -    return false;
292 -
293 -  if (!m_libAvcodec.GetFunction("avcodec_find_encoder", (DynaLink::Function &)Favcodec_find_encoder))
294 -    return false;
295 -
296 -  if (!m_libAvcodec.GetFunction("avcodec_find_decoder", (DynaLink::Function &)Favcodec_find_decoder))
297 -    return false;
298 -
299 -  if (!m_libAvcodec.GetFunction("avcodec_alloc_context", (DynaLink::Function &)Favcodec_alloc_context))
300 -    return false;
301 -
302 -  if (!m_libAvcodec.GetFunction("avcodec_alloc_frame", (DynaLink::Function &)Favcodec_alloc_frame))
303 -    return false;
304 -
305 -  if (!m_libAvcodec.GetFunction("avcodec_open", (DynaLink::Function &)Favcodec_open))
306 -    return false;
307 -
308 -  if (!m_libAvcodec.GetFunction("avcodec_close", (DynaLink::Function &)Favcodec_close))
309 -    return false;
310 -
311 -  if (!m_libAvcodec.GetFunction("avcodec_encode_video", (DynaLink::Function &)Favcodec_encode_video))
312 -    return false;
313 -
314 -  if (!m_libAvcodec.GetFunction("avcodec_decode_video2", (DynaLink::Function &)Favcodec_decode_video))
315 -    return false;
316 -
317 -  if (!m_libAvcodec.GetFunction("avcodec_set_dimensions", (DynaLink::Function &)Favcodec_set_dimensions))
318 -    return false;
319 -
320 -  if (!CHECK_AVUTIL("av_free", Favcodec_free))
321 -    return false;
322 -
323 -  if(!m_libAvcodec.GetFunction("avcodec_version", (DynaLink::Function &)Favcodec_version))
324 -    return false;
325 -
326 -  if (!CHECK_AVUTIL("av_log_set_level", FAv_log_set_level))
327 -    return false;
328 -
329 -  if (!CHECK_AVUTIL("av_log_set_callback", FAv_log_set_callback))
330 -    return false;
331 -
332    // must be called before using avcodec lib
333  
334 -  unsigned libVer = Favcodec_version();
335 +  unsigned libVer = avcodec_version();
336    if (libVer != LIBAVCODEC_VERSION_INT) {
337      PTRACE(2, m_codecString, "Warning: compiled against libavcodec headers from version "
338             << LIBAVCODEC_VERSION_MAJOR << '.' << LIBAVCODEC_VERSION_MINOR << '.' << LIBAVCODEC_VERSION_MICRO
339 @@ -334,8 +255,7 @@
340             << (libVer >> 16) << ((libVer>>8) & 0xff) << (libVer & 0xff));
341    }
342  
343 -  Favcodec_init();
344 -  Favcodec_register_all ();
345 +  avcodec_register_all();
346  
347  #if PLUGINCODEC_TRACING
348    AvLogSetLevel(AV_LOG_DEBUG);
349 @@ -350,49 +270,49 @@
350  
351  AVCodec *FFMPEGLibrary::AvcodecFindEncoder(enum CodecID id)
352  {
353 -  return Favcodec_find_encoder(id);
354 +  return avcodec_find_encoder(id);
355  }
356  
357  AVCodec *FFMPEGLibrary::AvcodecFindDecoder(enum CodecID id)
358  {
359    WaitAndSignal m(processLock);
360  
361 -  return Favcodec_find_decoder(id);
362 +  return avcodec_find_decoder(id);
363  }
364  
365 -AVCodecContext *FFMPEGLibrary::AvcodecAllocContext(void)
366 +AVCodecContext *FFMPEGLibrary::AvcodecAllocContext(AVCodec *codec)
367  {
368    WaitAndSignal m(processLock);
369  
370 -  return Favcodec_alloc_context();
371 +  return avcodec_alloc_context3(codec);
372  }
373  
374  AVFrame *FFMPEGLibrary::AvcodecAllocFrame(void)
375  {
376    WaitAndSignal m(processLock);
377  
378 -  return Favcodec_alloc_frame();
379 +  return avcodec_alloc_frame();
380  }
381  
382  int FFMPEGLibrary::AvcodecOpen(AVCodecContext *ctx, AVCodec *codec)
383  {
384    WaitAndSignal m(processLock);
385  
386 -  return Favcodec_open(ctx, codec);
387 +  return avcodec_open2(ctx, codec, NULL);
388  }
389  
390  int FFMPEGLibrary::AvcodecClose(AVCodecContext *ctx)
391  {
392    WaitAndSignal m(processLock);
393  
394 -  return Favcodec_close(ctx);
395 +  return avcodec_close(ctx);
396  }
397  
398  int FFMPEGLibrary::AvcodecEncodeVideo(AVCodecContext *ctx, BYTE *buf, int buf_size, const AVFrame *pict)
399  {
400    int res;
401  
402 -  res = Favcodec_encode_video(ctx, buf, buf_size, pict);
403 +  res = avcodec_encode_video(ctx, buf, buf_size, pict);
404  
405    PTRACE(6, m_codecString, "DYNA\tEncoded into " << res << " bytes, max " << buf_size);
406    return res;
407 @@ -401,35 +321,35 @@
408  int FFMPEGLibrary::AvcodecDecodeVideo(AVCodecContext *ctx, AVFrame *pict, int *got_picture_ptr, BYTE *buf, int buf_size)
409  {
410    AVPacket avpkt;
411 -  Fav_init_packet(&avpkt);
412 +  av_init_packet(&avpkt);
413    avpkt.data = buf;
414    avpkt.size = buf_size;
415  
416 -  return Favcodec_decode_video(ctx, pict, got_picture_ptr, &avpkt);
417 +  return avcodec_decode_video2(ctx, pict, got_picture_ptr, &avpkt);
418  }
419  
420  void FFMPEGLibrary::AvcodecFree(void * ptr)
421  {
422    WaitAndSignal m(processLock);
423  
424 -  Favcodec_free(ptr);
425 +  av_free(ptr);
426  }
427  
428  void FFMPEGLibrary::AvSetDimensions(AVCodecContext *s, int width, int height)
429  {
430    WaitAndSignal m(processLock);
431  
432 -  Favcodec_set_dimensions(s, width, height);
433 +  avcodec_set_dimensions(s, width, height);
434  }
435  
436  void FFMPEGLibrary::AvLogSetLevel(int level)
437  {
438 -  FAv_log_set_level(level);
439 +  av_log_set_level(level);
440  }
441  
442  void FFMPEGLibrary::AvLogSetCallback(void (*callback)(void*, int, const char*, va_list))
443  {
444 -  FAv_log_set_callback(callback);
445 +  av_log_set_callback(callback);
446  }
447  
448  bool FFMPEGLibrary::IsLoaded()
449 --- a/plugins/video/common/dyna.h
450 +++ b/plugins/video/common/dyna.h
451 @@ -95,7 +95,7 @@
452  
453      AVCodec *AvcodecFindEncoder(enum CodecID id);
454      AVCodec *AvcodecFindDecoder(enum CodecID id);
455 -    AVCodecContext *AvcodecAllocContext(void);
456 +    AVCodecContext *AvcodecAllocContext(AVCodec*);
457      AVFrame *AvcodecAllocFrame(void);
458      int AvcodecOpen(AVCodecContext *ctx, AVCodec *codec);
459      int AvcodecClose(AVCodecContext *ctx);
460 @@ -120,26 +120,6 @@
461      CodecID m_codec;
462      char m_codecString[32];
463  
464 -    void (*Favcodec_init)(void);
465 -    void (*Fav_init_packet)(AVPacket *pkt);
466 -
467 -    void (*Favcodec_register_all)(void);
468 -    AVCodec *(*Favcodec_find_encoder)(enum CodecID id);
469 -    AVCodec *(*Favcodec_find_decoder)(enum CodecID id);
470 -    AVCodecContext *(*Favcodec_alloc_context)(void);
471 -    AVFrame *(*Favcodec_alloc_frame)(void);
472 -    int (*Favcodec_open)(AVCodecContext *ctx, AVCodec *codec);
473 -    int (*Favcodec_close)(AVCodecContext *ctx);
474 -    int (*Favcodec_encode_video)(AVCodecContext *ctx, BYTE *buf, int buf_size, const AVFrame *pict);
475 -    int (*Favcodec_decode_video)(AVCodecContext *ctx, AVFrame *pict, int *got_picture_ptr, AVPacket *avpkt);
476 -    unsigned (*Favcodec_version)(void);
477 -    void (*Favcodec_set_dimensions)(AVCodecContext *ctx, int width, int height);
478 -
479 -    void (*Favcodec_free)(void *);
480 -
481 -    void (*FAv_log_set_level)(int level);
482 -    void (*FAv_log_set_callback)(void (*callback)(void*, int, const char*, va_list));
483 -
484      bool m_isLoadedOK;
485  };
486  
487 --- a/plugins/video/common/ffmpeg.h
488 +++ b/plugins/video/common/ffmpeg.h
489 @@ -45,11 +45,13 @@
490  
491  #include "platform.h"
492  
493 -#include "libavcodec/avcodec.h"
494 +extern "C" {
495 +#include <libavcodec/avcodec.h>
496  // AVPacket was declared in avformat.h before April 2009
497  #if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(52, 25, 0)
498 -#include "libavformat/avformat.h"
499 +#include <libavformat/avformat.h>
500  #endif
501 +}
502  
503  #ifndef LIBAVCODEC_VERSION_INT
504  #error Libavcodec include is not correct
505 --- a/plugins/video/H.263-1998/Makefile.in
506 +++ b/plugins/video/H.263-1998/Makefile.in
507 @@ -34,8 +34,8 @@
508               $(COMMONDIR)/mpi.cxx \
509               $(COMMONDIR)/dyna.cxx
510  
511 -CFLAGS += @LIBAVCODEC_CFLAGS@ -I$(COMMONDIR)
512 -LIBS   += @DL_LIBS@
513 +CFLAGS += @LIBAVCODEC_CFLAGS@ @LIBAVUTIL_CFLAGS@ -I$(COMMONDIR)
514 +LIBS   += @DL_LIBS@ @LIBAVCODEC_LIBS@ @LIBAVUTIL_LIBS@
515  
516  HAVE_LIBAVCODEC_RTP_MODE=@HAVE_LIBAVCODEC_RTP_MODE@
517  ifeq ($(HAVE_LIBAVCODEC_RTP_MODE),yes)
518 --- a/plugins/video/H.264/Makefile.in
519 +++ b/plugins/video/H.264/Makefile.in
520 @@ -34,8 +34,8 @@
521             $(SHAREDDIR)/x264wrap.cxx \
522             $(COMMONDIR)/dyna.cxx \
523  
524 -CFLAGS += @LIBAVCODEC_CFLAGS@ -I$(COMMONDIR) -DLIB_DIR='"$(libdir)"' -DVC_PLUGIN_DIR='"@VC_PLUGIN_DIR@"'
525 -LIBS   += @DL_LIBS@
526 +CFLAGS += @LIBAVCODEC_CFLAGS@ @LIBAVUTIL_CFLAGS@ -I$(COMMONDIR) -DLIB_DIR='"$(libdir)"' -DVC_PLUGIN_DIR='"@VC_PLUGIN_DIR@"'
527 +LIBS   += @DL_LIBS@ @LIBAVCODEC_LIBS@ @LIBAVUTIL_LIBS@
528  
529  IS_H264_LICENSED:=@IS_H264_LICENSED@
530  ifeq ($(IS_H264_LICENSED),yes)
531 --- a/plugins/video/MPEG4-ffmpeg/Makefile.in
532 +++ b/plugins/video/MPEG4-ffmpeg/Makefile.in
533 @@ -30,8 +30,8 @@
534  SRCDIR    := .
535  SRCS      := mpeg4.cxx $(COMMONDIR)/dyna.cxx
536  
537 -CFLAGS += @LIBAVCODEC_CFLAGS@ -I$(COMMONDIR)
538 -LIBS   += @DL_LIBS@
539 +CFLAGS += @LIBAVCODEC_CFLAGS@ @LIBAVUTIL_CFLAGS@ -I$(COMMONDIR)
540 +LIBS   += @DL_LIBS@ @LIBAVCODEC_LIBS@ @LIBAVUTIL_LIBS@
541  
542  # Add LIBAVCODEC_SOURCE_DIR to the include path so we can #include <libavcodec/...h>
543  # Also add libavutil, so ffmpeg headers can #include "log.h".
544 Description: Fix compilation against libav10 
545 Author: Reinhard Tartler <siretart@tauware.de>
546 Bug-Debian: http://bugs.debian.org/739439
547
548 --- a/plugins/video/H.263-1998/h263-1998.cxx
549 +++ b/plugins/video/H.263-1998/h263-1998.cxx
550 @@ -94,7 +94,7 @@ static struct StdSizes {
551    { CIF16_WIDTH, CIF16_HEIGHT, PLUGINCODEC_CIF16_MPI },
552  };
553  
554 -static FFMPEGLibrary FFMPEGLibraryInstance(CODEC_ID_H263P);
555 +static FFMPEGLibrary FFMPEGLibraryInstance(AV_CODEC_ID_H263P);
556  
557  
558  /////////////////////////////////////////////////////////////////////////////
559 @@ -203,7 +203,7 @@ H263_Base_EncoderContext::~H263_Base_Enc
560    PTRACE(4, m_prefix, "Encoder closed");
561  }
562  
563 -bool H263_Base_EncoderContext::Init(CodecID codecId)
564 +bool H263_Base_EncoderContext::Init(AVCodecID codecId)
565  {
566    PTRACE(5, m_prefix, "Opening encoder");
567  
568 @@ -589,7 +589,7 @@ void H263_RFC2190_EncoderContext::RTPCal
569  
570  bool H263_RFC2190_EncoderContext::Init()
571  {
572 -  if (!H263_Base_EncoderContext::Init(CODEC_ID_H263))
573 +  if (!H263_Base_EncoderContext::Init(AV_CODEC_ID_H263))
574      return false;
575  
576  #if LIBAVCODEC_RTP_MODE
577 @@ -632,7 +632,7 @@ H263_RFC2429_EncoderContext::~H263_RFC24
578  
579  bool H263_RFC2429_EncoderContext::Init()
580  {
581 -  return H263_Base_EncoderContext::Init(CODEC_ID_H263P);
582 +  return H263_Base_EncoderContext::Init(AV_CODEC_ID_H263P);
583  }
584  
585  
586 @@ -656,7 +656,7 @@ H263_Base_DecoderContext::H263_Base_Deco
587    if (!FFMPEGLibraryInstance.Load())
588      return;
589  
590 -  if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_H263)) == NULL) {
591 +  if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(AV_CODEC_ID_H263)) == NULL) {
592      PTRACE(1, m_prefix, "Codec not found for decoder");
593      return;
594    }
595 --- a/plugins/video/H.264/h264-x264.cxx
596 +++ b/plugins/video/H.264/h264-x264.cxx
597 @@ -105,7 +105,7 @@ static struct PluginCodec_information Li
598  
599  ///////////////////////////////////////////////////////////////////////////////
600  
601 -FFMPEGLibrary FFMPEGLibraryInstance(CODEC_ID_H264);
602 +FFMPEGLibrary FFMPEGLibraryInstance(AV_CODEC_ID_H264);
603  
604  PLUGINCODEC_CONTROL_LOG_FUNCTION_DEF
605  
606 @@ -1065,17 +1065,17 @@ class MyDecoder : public PluginCodec<MY_
607           allows you to fail the create operation (return false), which cannot
608           be done in the normal C++ constructor. */
609  
610 -      if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_H264)) == NULL)
611 +      if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(AV_CODEC_ID_H264)) == NULL)
612          return false;
613  
614        if ((m_context = FFMPEGLibraryInstance.AvcodecAllocContext(m_codec)) == NULL)
615          return false;
616  
617        m_context->workaround_bugs = FF_BUG_AUTODETECT;
618 -      m_context->idct_algo = FF_IDCT_H264;
619 +      m_context->idct_algo = FF_IDCT_AUTO;
620        m_context->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
621        m_context->flags = CODEC_FLAG_INPUT_PRESERVED | CODEC_FLAG_EMU_EDGE;
622 -      m_context->flags2 = CODEC_FLAG2_SKIP_RD |
623 +      m_context->flags2 = 
624  #ifdef CODEC_FLAG2_DROP_FRAME_TIMECODE
625                            CODEC_FLAG2_DROP_FRAME_TIMECODE |
626  #endif
627 --- a/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
628 +++ b/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
629 @@ -205,7 +205,7 @@ const static struct mpeg4_resolution {
630      { 0 }
631  };
632  
633 -FFMPEGLibrary FFMPEGLibraryInstance(CODEC_ID_MPEG4);
634 +FFMPEGLibrary FFMPEGLibraryInstance(AV_CODEC_ID_MPEG4);
635  
636  
637  static bool mpeg4IsIframe (BYTE * frameBuffer, unsigned int frameLen )
638 @@ -688,7 +688,7 @@ void MPEG4EncoderContext::ResizeEncoding
639  
640  bool MPEG4EncoderContext::OpenCodec()
641  {
642 -  if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(CODEC_ID_MPEG4)) == NULL){
643 +  if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(AV_CODEC_ID_MPEG4)) == NULL){
644      PTRACE(1, "MPEG4", "Encoder not found");
645      return false;
646    }
647 @@ -1390,7 +1390,7 @@ void MPEG4DecoderContext::ResizeDecoding
648  
649  bool MPEG4DecoderContext::OpenCodec()
650  {
651 -    if ((m_avcodec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_MPEG4)) == NULL) {
652 +    if ((m_avcodec = FFMPEGLibraryInstance.AvcodecFindDecoder(AV_CODEC_ID_MPEG4)) == NULL) {
653          PTRACE(1, "MPEG4", "Decoder not found for encoder");
654          return false;
655      }
656 --- a/plugins/video/H.263-1998/h263-1998.h
657 +++ b/plugins/video/H.263-1998/h263-1998.h
658 @@ -115,7 +115,7 @@ class H263_Base_EncoderContext
659      virtual ~H263_Base_EncoderContext();
660  
661      virtual bool Init() = 0;
662 -    virtual bool Init(CodecID codecId);
663 +    virtual bool Init(AVCodecID codecId);
664  
665      virtual bool SetOptions(const char * const * options);
666      virtual void SetOption(const char * option, const char * value);
667 --- a/plugins/video/common/dyna.cxx
668 +++ b/plugins/video/common/dyna.cxx
669 @@ -217,14 +217,14 @@ static void logCallbackFFMPEG(void * avc
670  #endif
671  
672  
673 -FFMPEGLibrary::FFMPEGLibrary(CodecID codec)
674 +FFMPEGLibrary::FFMPEGLibrary(AVCodecID codec)
675  {
676    m_codec = codec;
677 -  if (m_codec==CODEC_ID_H264)
678 +  if (m_codec==AV_CODEC_ID_H264)
679        snprintf( m_codecString, sizeof(m_codecString), "H264");
680 -  if (m_codec==CODEC_ID_H263P)
681 +  if (m_codec==AV_CODEC_ID_H263P)
682        snprintf( m_codecString, sizeof(m_codecString), "H263+");
683 -  if (m_codec==CODEC_ID_MPEG4)
684 +  if (m_codec==AV_CODEC_ID_MPEG4)
685        snprintf( m_codecString, sizeof(m_codecString), "MPEG4");
686    m_isLoadedOK = false;
687  }
688 @@ -268,12 +268,12 @@ bool FFMPEGLibrary::Load()
689    return true;
690  }
691  
692 -AVCodec *FFMPEGLibrary::AvcodecFindEncoder(enum CodecID id)
693 +AVCodec *FFMPEGLibrary::AvcodecFindEncoder(enum AVCodecID id)
694  {
695    return avcodec_find_encoder(id);
696  }
697  
698 -AVCodec *FFMPEGLibrary::AvcodecFindDecoder(enum CodecID id)
699 +AVCodec *FFMPEGLibrary::AvcodecFindDecoder(enum AVCodecID id)
700  {
701    WaitAndSignal m(processLock);
702  
703 @@ -308,13 +308,18 @@ int FFMPEGLibrary::AvcodecClose(AVCodecC
704    return avcodec_close(ctx);
705  }
706  
707 +#undef  FFMAX
708 +#define FFMAX(a,b) ((a) > (b) ? (a) : (b)) 
709  int FFMPEGLibrary::AvcodecEncodeVideo(AVCodecContext *ctx, BYTE *buf, int buf_size, const AVFrame *pict)
710  {
711 +  AVPacket pkt = { 0 };
712 +  int ret, got_output;
713    int res;
714  
715 -  res = avcodec_encode_video(ctx, buf, buf_size, pict);
716 +  ret = avcodec_encode_video2(ctx, &pkt, pict, &got_output);
717  
718 -  PTRACE(6, m_codecString, "DYNA\tEncoded into " << res << " bytes, max " << buf_size);
719 +  PTRACE(6, m_codecString, "DYNA\tEncoded into " << ret << " bytes, max " << buf_size);
720 +  memcpy(buf, pkt.data, FFMAX(pkt.size, buf_size));
721    return res;
722  }
723  
724 --- a/plugins/video/common/dyna.h
725 +++ b/plugins/video/common/dyna.h
726 @@ -88,13 +88,13 @@ class DynaLink
727  class FFMPEGLibrary 
728  {
729    public:
730 -    FFMPEGLibrary(CodecID codec);
731 +    FFMPEGLibrary(AVCodecID codec);
732      ~FFMPEGLibrary();
733  
734      bool Load();
735  
736 -    AVCodec *AvcodecFindEncoder(enum CodecID id);
737 -    AVCodec *AvcodecFindDecoder(enum CodecID id);
738 +    AVCodec *AvcodecFindEncoder(enum AVCodecID id);
739 +    AVCodec *AvcodecFindDecoder(enum AVCodecID id);
740      AVCodecContext *AvcodecAllocContext(AVCodec*);
741      AVFrame *AvcodecAllocFrame(void);
742      int AvcodecOpen(AVCodecContext *ctx, AVCodec *codec);
743 @@ -117,7 +117,7 @@ class FFMPEGLibrary
744      DynaLink m_libAvcodec;
745      DynaLink m_libAvutil;
746  
747 -    CodecID m_codec;
748 +    AVCodecID m_codec;
749      char m_codecString[32];
750  
751      bool m_isLoadedOK;
752 Description: Replace deprecated FFmpeg API
753 Author: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
754 Last-Update: <2015-11-02>
755
756 --- opal-3.10.10~dfsg2.orig/plugins/video/H.263-1998/h263-1998.cxx
757 +++ opal-3.10.10~dfsg2/plugins/video/H.263-1998/h263-1998.cxx
758 @@ -230,11 +230,10 @@ bool H263_Base_EncoderContext::Init(AVCo
759  
760    m_context->opaque = this;
761  
762 -  m_context->flags = CODEC_FLAG_EMU_EDGE   // don't draw edges
763 -                   | CODEC_FLAG_TRUNCATED  // Possible missing packets
764 +  m_context->flags = CODEC_FLAG_TRUNCATED  // Possible missing packets
765                     ;
766  
767 -  m_context->pix_fmt = PIX_FMT_YUV420P;
768 +  m_context->pix_fmt = AV_PIX_FMT_YUV420P;
769    m_context->gop_size = H263_KEY_FRAME_INTERVAL;
770  
771    // X-Lite does not like Custom Picture frequency clocks... stick to 29.97Hz
772 @@ -440,9 +439,6 @@ bool H263_Base_EncoderContext::OpenCodec
773    m_inputFrame->data[1] = m_inputFrame->data[0] + planeSize;
774    m_inputFrame->data[2] = m_inputFrame->data[1] + (planeSize / 4);
775  
776 -  if (m_context->width > 352)
777 -    m_context->flags &= ~CODEC_FLAG_EMU_EDGE; // Totally bizarre! FFMPEG crashes if on for CIF4
778 -
779    // Dump info
780    PTRACE(5, m_prefix, "Size is " << m_context->width << "x" << m_context->height);
781    PTRACE(5, m_prefix, "GOP is " << m_context->gop_size);
782 @@ -456,7 +452,7 @@ bool H263_Base_EncoderContext::OpenCodec
783    PTRACE(5, m_prefix, "qmax set to " << m_context->qmax);
784    PTRACE(5, m_prefix, "payload size set to " << m_context->rtp_payload_size);
785  
786 -  return FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec) == 0;
787 +  return FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec, NULL) == 0;
788  }
789  
790  void H263_Base_EncoderContext::CloseCodec()
791 @@ -707,7 +703,7 @@ bool H263_Base_DecoderContext::OpenCodec
792      return 0;
793    }
794  
795 -  if (FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec) < 0) {
796 +  if (FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec, NULL) < 0) {
797      PTRACE(1, m_prefix, "Failed to open H.263 decoder");
798      return false;
799    }
800 --- opal-3.10.10~dfsg2.orig/plugins/video/H.264/h264-x264.cxx
801 +++ opal-3.10.10~dfsg2/plugins/video/H.264/h264-x264.cxx
802 @@ -1074,7 +1074,6 @@ class MyDecoder : public PluginCodec<MY_
803        m_context->workaround_bugs = FF_BUG_AUTODETECT;
804        m_context->idct_algo = FF_IDCT_AUTO;
805        m_context->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
806 -      m_context->flags = CODEC_FLAG_INPUT_PRESERVED | CODEC_FLAG_EMU_EDGE;
807        m_context->flags2 = 
808  #ifdef CODEC_FLAG2_DROP_FRAME_TIMECODE
809                            CODEC_FLAG2_DROP_FRAME_TIMECODE |
810 @@ -1084,7 +1083,7 @@ class MyDecoder : public PluginCodec<MY_
811        if ((m_picture = FFMPEGLibraryInstance.AvcodecAllocFrame()) == NULL)
812          return false;
813  
814 -      if (FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec) < 0)
815 +      if (FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec, NULL) < 0)
816          return false;
817  
818        PTRACE(4, MY_CODEC_LOG, "Opened decoder (SVN $Revision: 28048 $)");
819 --- opal-3.10.10~dfsg2.orig/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
820 +++ opal-3.10.10~dfsg2/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
821 @@ -539,7 +539,7 @@ void MPEG4EncoderContext::ResetBitCounte
822  //
823  
824  void MPEG4EncoderContext::SetStaticEncodingParams(){
825 -    m_avcontext->pix_fmt = PIX_FMT_YUV420P;
826 +    m_avcontext->pix_fmt = AV_PIX_FMT_YUV420P;
827      m_avcontext->mb_decision = FF_MB_DECISION_SIMPLE;    // high quality off
828      m_avcontext->rtp_payload_size = 750;                 // ffh263 uses 750
829      m_avcontext->rtp_callback = &MPEG4EncoderContext::RtpCallback;
830 @@ -595,7 +595,6 @@ void MPEG4EncoderContext::SetStaticEncod
831      m_avcontext->flags|=CODEC_FLAG_AC_PRED;
832      /*c->flags|=CODEC_FLAG_QPEL;*/ /*don't enable this one: this forces profile_level to advanced simple profile */
833      m_avcontext->flags|=CODEC_FLAG_4MV;
834 -    m_avcontext->flags|=CODEC_FLAG_GMC;
835      m_avcontext->flags|=CODEC_FLAG_LOOP_FILTER;
836  #endif
837      m_avcontext->opaque = this;              // for use in RTP callback
838 @@ -710,13 +709,15 @@ bool MPEG4EncoderContext::OpenCodec()
839    if (PTRACE_CHECK(4)) {
840      m_avcontext->debug |= FF_DEBUG_RC;
841      m_avcontext->debug |= FF_DEBUG_PICT_INFO;
842 -    m_avcontext->debug |= FF_DEBUG_MV;
843 +//    m_avcontext->debug |= FF_DEBUG_MV;
844    }
845  #endif
846    
847    SetStaticEncodingParams();
848    SetDynamicEncodingParams(false);    // don't force a restart, it's not open
849 -  if (FFMPEGLibraryInstance.AvcodecOpen(m_avcontext, m_avcodec) < 0)
850 +  AVDictionary *opts = NULL;
851 +  av_dict_set_int(&opts, "gmc", 1, 0);
852 +  if (FFMPEGLibraryInstance.AvcodecOpen(m_avcontext, m_avcodec, &opts) < 0)
853    {
854      PTRACE(1, "MPEG4", "Encoder could not be opened");
855      return false;
856 @@ -1411,7 +1412,7 @@ bool MPEG4DecoderContext::OpenCodec()
857  
858      SetStaticDecodingParams();
859      SetDynamicDecodingParams(false);    // don't force a restart, it's not open
860 -    if (FFMPEGLibraryInstance.AvcodecOpen(m_avcontext, m_avcodec) < 0) {
861 +    if (FFMPEGLibraryInstance.AvcodecOpen(m_avcontext, m_avcodec, NULL) < 0) {
862          PTRACE(1, "MPEG4", "Decoder failed to open");
863          return false;
864      }
865 --- opal-3.10.10~dfsg2.orig/plugins/video/common/dyna.cxx
866 +++ opal-3.10.10~dfsg2/plugins/video/common/dyna.cxx
867 @@ -291,14 +291,14 @@ AVFrame *FFMPEGLibrary::AvcodecAllocFram
868  {
869    WaitAndSignal m(processLock);
870  
871 -  return avcodec_alloc_frame();
872 +  return av_frame_alloc();
873  }
874  
875 -int FFMPEGLibrary::AvcodecOpen(AVCodecContext *ctx, AVCodec *codec)
876 +int FFMPEGLibrary::AvcodecOpen(AVCodecContext *ctx, AVCodec *codec, AVDictionary **options)
877  {
878    WaitAndSignal m(processLock);
879  
880 -  return avcodec_open2(ctx, codec, NULL);
881 +  return avcodec_open2(ctx, codec, options);
882  }
883  
884  int FFMPEGLibrary::AvcodecClose(AVCodecContext *ctx)
885 @@ -344,7 +344,15 @@ void FFMPEGLibrary::AvSetDimensions(AVCo
886  {
887    WaitAndSignal m(processLock);
888  
889 -  avcodec_set_dimensions(s, width, height);
890 +  if (av_image_check_size(width, height, 0, s) < 0) {
891 +    av_log(s, AV_LOG_WARNING, "Failed to set dimensions %d %d\n", width, height);
892 +    width = height = 0;
893 +  }
894 +
895 +  s->coded_width  = width;
896 +  s->coded_height = height;
897 +  s->width        = (width + (1 << av_codec_get_lowres(s)) - 1) >> av_codec_get_lowres(s);
898 +  s->height       = (height + (1 << av_codec_get_lowres(s)) - 1) >> av_codec_get_lowres(s);
899  }
900  
901  void FFMPEGLibrary::AvLogSetLevel(int level)
902 --- opal-3.10.10~dfsg2.orig/plugins/video/common/dyna.h
903 +++ opal-3.10.10~dfsg2/plugins/video/common/dyna.h
904 @@ -97,7 +97,7 @@ class FFMPEGLibrary
905      AVCodec *AvcodecFindDecoder(enum AVCodecID id);
906      AVCodecContext *AvcodecAllocContext(AVCodec*);
907      AVFrame *AvcodecAllocFrame(void);
908 -    int AvcodecOpen(AVCodecContext *ctx, AVCodec *codec);
909 +    int AvcodecOpen(AVCodecContext *ctx, AVCodec *codec, AVDictionary **options);
910      int AvcodecClose(AVCodecContext *ctx);
911      int AvcodecEncodeVideo(AVCodecContext *ctx, BYTE *buf, int buf_size, const AVFrame *pict);
912      int AvcodecDecodeVideo(AVCodecContext *ctx, AVFrame *pict, int *got_picture_ptr, BYTE *buf, int buf_size);
913 --- opal-3.10.10~dfsg2.orig/plugins/video/common/ffmpeg.h
914 +++ opal-3.10.10~dfsg2/plugins/video/common/ffmpeg.h
915 @@ -47,6 +47,7 @@
916  
917  extern "C" {
918  #include <libavcodec/avcodec.h>
919 +#include <libavutil/imgutils.h>
920  // AVPacket was declared in avformat.h before April 2009
921  #if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(52, 25, 0)
922  #include <libavformat/avformat.h>
923 diff -ur opal-3.10.11.org/plugins/video/H.263-1998/h263-1998.cxx opal-3.10.11/plugins/video/H.263-1998/h263-1998.cxx
924 --- opal-3.10.11.org/plugins/video/H.263-1998/h263-1998.cxx     2018-09-27 12:41:23.304757504 +0200
925 +++ opal-3.10.11/plugins/video/H.263-1998/h263-1998.cxx 2018-09-27 12:59:25.737615925 +0200
926 @@ -230,7 +230,7 @@
927  
928    m_context->opaque = this;
929  
930 -  m_context->flags = CODEC_FLAG_TRUNCATED  // Possible missing packets
931 +  m_context->flags = AV_CODEC_FLAG_TRUNCATED  // Possible missing packets
932                     ;
933  
934    m_context->pix_fmt = AV_PIX_FMT_YUV420P;
935 @@ -341,9 +341,9 @@
936      // Level 3+
937      // works with eyeBeam
938      if (atoi(value) == 1)
939 -      m_context->flags |= CODEC_FLAG_AC_PRED; 
940 +      m_context->flags |= AV_CODEC_FLAG_AC_PRED; 
941      else
942 -      m_context->flags &= ~CODEC_FLAG_AC_PRED; 
943 +      m_context->flags &= ~AV_CODEC_FLAG_AC_PRED; 
944      return;
945    }
946  
947 @@ -351,9 +351,9 @@
948      // Annex J: Deblocking Filter
949      // works with eyeBeam
950      if (atoi(value) == 1)
951 -      m_context->flags |= CODEC_FLAG_LOOP_FILTER; 
952 +      m_context->flags |= AV_CODEC_FLAG_LOOP_FILTER; 
953      else
954 -      m_context->flags &= ~CODEC_FLAG_LOOP_FILTER; 
955 +      m_context->flags &= ~AV_CODEC_FLAG_LOOP_FILTER; 
956      return;
957    }
958  
959 @@ -599,7 +599,7 @@
960  #ifdef CODEC_FLAG_H263P_UMV
961    m_context->flags &= ~CODEC_FLAG_H263P_UMV;
962  #endif
963 -  m_context->flags &= ~CODEC_FLAG_4MV;
964 +  m_context->flags &= ~AV_CODEC_FLAG_4MV;
965  #if LIBAVCODEC_RTP_MODE
966    m_context->flags &= ~CODEC_FLAG_H263P_AIC;
967  #endif
968 diff -ur opal-3.10.11.org/plugins/video/H.263-1998/rfc2429.cxx opal-3.10.11/plugins/video/H.263-1998/rfc2429.cxx
969 --- opal-3.10.11.org/plugins/video/H.263-1998/rfc2429.cxx       2013-08-15 01:22:47.000000000 +0200
970 +++ opal-3.10.11/plugins/video/H.263-1998/rfc2429.cxx   2018-09-27 12:46:38.534350768 +0200
971 @@ -286,7 +286,7 @@
972  
973  unsigned char * RFC2429Frame::GetBuffer()
974  {
975 -  memset (m_encodedFrame.ptr + m_encodedFrame.pos,0 , FF_INPUT_BUFFER_PADDING_SIZE);
976 +  memset (m_encodedFrame.ptr + m_encodedFrame.pos,0 , AV_INPUT_BUFFER_PADDING_SIZE);
977    return (m_encodedFrame.ptr);
978  }
979  
980 @@ -340,10 +340,10 @@
981  
982    unsigned remBytes = packet.GetPayloadSize() - headerPLEN - (headerV ? 3 : 2);
983  
984 -  if ((m_encodedFrame.pos + (headerP ? 2 : 0) + remBytes) > (m_maxFrameSize - FF_INPUT_BUFFER_PADDING_SIZE)) {
985 +  if ((m_encodedFrame.pos + (headerP ? 2 : 0) + remBytes) > (m_maxFrameSize - AV_INPUT_BUFFER_PADDING_SIZE)) {
986      PTRACE(2, "H.263-RFC2429", "Trying to add " << remBytes 
987           << " bytes to frame at position " << m_encodedFrame.pos + (headerP ? 2 : 0) 
988 -         << " bytes while maximum frame size is  " << m_maxFrameSize << "-" << FF_INPUT_BUFFER_PADDING_SIZE << " bytes");
989 +         << " bytes while maximum frame size is  " << m_maxFrameSize << "-" << AV_INPUT_BUFFER_PADDING_SIZE << " bytes");
990      return false;
991    }
992  
993 diff -ur opal-3.10.11.org/plugins/video/MPEG4-ffmpeg/mpeg4.cxx opal-3.10.11/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
994 --- opal-3.10.11.org/plugins/video/MPEG4-ffmpeg/mpeg4.cxx       2018-09-27 12:41:23.304757504 +0200
995 +++ opal-3.10.11/plugins/video/MPEG4-ffmpeg/mpeg4.cxx   2018-09-27 12:57:41.014440233 +0200
996 @@ -589,13 +589,13 @@
997      m_avpicture->quality = m_videoQMin;
998  
999  #ifdef USE_ORIG
1000 -    m_avcontext->flags |= CODEC_FLAG_4MV;    // 4 motion vectors
1001 +    m_avcontext->flags |= AV_CODEC_FLAG_4MV;    // 4 motion vectors
1002  #else
1003      m_avcontext->max_b_frames=0; /*don't use b frames*/
1004 -    m_avcontext->flags|=CODEC_FLAG_AC_PRED;
1005 +    m_avcontext->flags|=AV_CODEC_FLAG_AC_PRED;
1006      /*c->flags|=CODEC_FLAG_QPEL;*/ /*don't enable this one: this forces profile_level to advanced simple profile */
1007 -    m_avcontext->flags|=CODEC_FLAG_4MV;
1008 -    m_avcontext->flags|=CODEC_FLAG_LOOP_FILTER;
1009 +    m_avcontext->flags|=AV_CODEC_FLAG_4MV;
1010 +    m_avcontext->flags|=AV_CODEC_FLAG_LOOP_FILTER;
1011  #endif
1012      m_avcontext->opaque = this;              // for use in RTP callback
1013  }
1014 @@ -607,6 +607,7 @@
1015  //
1016  
1017  void MPEG4EncoderContext::SetDynamicEncodingParams(bool restartOnResize) {
1018 +    char buf[1024];
1019      // If no bitrate limit is set, max out at 3 mbit
1020      // Use 75% of available bandwidth so not as many frames are dropped
1021      unsigned bitRate
1022 @@ -661,7 +662,7 @@
1023      {
1024          delete[] m_rawFrameBuffer;
1025      }
1026 -    m_rawFrameBuffer = new BYTE[m_rawFrameLen + FF_INPUT_BUFFER_PADDING_SIZE];
1027 +    m_rawFrameBuffer = new BYTE[m_rawFrameLen + AV_INPUT_BUFFER_PADDING_SIZE];
1028  
1029      if (m_encFrameBuffer)
1030      {
1031 @@ -671,7 +672,7 @@
1032      m_encFrameBuffer = new BYTE[m_encFrameLen];
1033  
1034      // Clear the back padding
1035 -    memset(m_rawFrameBuffer + m_rawFrameLen, 0, FF_INPUT_BUFFER_PADDING_SIZE);
1036 +    memset(m_rawFrameBuffer + m_rawFrameLen, 0, AV_INPUT_BUFFER_PADDING_SIZE);
1037      const unsigned fsz = m_frameWidth * m_frameHeight;
1038      m_avpicture->data[0] = m_rawFrameBuffer;              // luminance
1039      m_avpicture->data[1] = m_rawFrameBuffer + fsz;        // first chroma channel
1040 @@ -1322,7 +1323,7 @@
1041  //
1042  
1043  void MPEG4DecoderContext::SetStaticDecodingParams() {
1044 -    m_avcontext->flags |= CODEC_FLAG_4MV; 
1045 +    m_avcontext->flags |= AV_CODEC_FLAG_4MV; 
1046      m_avcontext->workaround_bugs = 0; // no workaround for buggy implementations
1047  }
1048  
This page took 0.141973 seconds and 3 git commands to generate.