]>
Commit | Line | Data |
---|---|---|
a4d42991 AM |
1 | diff -ur opal-3.10.11.org/plugins/audio/G.722.2/G7222Codec.cpp opal-3.10.11/plugins/audio/G.722.2/G7222Codec.cpp |
2 | --- opal-3.10.11.org/plugins/audio/G.722.2/G7222Codec.cpp 2013-08-15 01:22:45.000000000 +0200 | |
3 | +++ opal-3.10.11/plugins/audio/G.722.2/G7222Codec.cpp 2018-09-29 11:58:07.796456792 +0200 | |
4 | @@ -109,7 +109,7 @@ | |
5 | const UWord16 AMRWB_efficient_ToC_bits = 6; | |
6 | const UWord16 AMRWB_efficient_CMR_bits = 4; | |
7 | ||
8 | -const UWord8 AMRWB_block_size_octet[16]= { 18, 24, 33, 37, 41, 47, 51, 59, 61, 6, 6, 0, 0, 0, 1, 1 }; | |
9 | +const unsigned AMRWB_block_size_octet[16]= { 18, 24, 33, 37, 41, 47, 51, 59, 61, 6, 6, 0, 0, 0, 1, 1 }; | |
10 | ||
11 | // RFC 3267 octet-aligned ToC adds 8 bits to each core speech bits frame and 8 per packet for header | |
12 | // RFC 3267 bandwidth-efficient adds 6 bits to each core speech bits frame and 4 per packet for header | |
13 | @@ -186,7 +186,7 @@ | |
14 | //PTRACE(2, "Codec\tAMR-WB encoder: Audio data of size " << *fromLen << " did not match expected " << AMRWB_FRAME_SAMPLES * sizeof(short)); | |
15 | return 0; | |
8d7f7562 | 16 | } |
a4d42991 AM |
17 | - if (*toLen < (unsigned) AMRWB_block_size_octet[Context->mode] + 1) |
18 | + if (*toLen < AMRWB_block_size_octet[Context->mode] + 1) | |
19 | { | |
20 | //PTRACE(2,"Codec\tAMR-WB encoder: Output buffer of size " << *toLen << " too short for mode " << mode); | |
21 | return 0; | |
22 | @@ -346,7 +346,7 @@ | |
23 | return 0; | |
24 | ||
25 | case -2: | |
26 | - //PTRACE(2, "Codec\tAMR-WB decoder: Packet size " << *fromLen << " did not match expected " << (unsigned)(AMRWB_block_size_octet[FrameType] + 1) << " for frame type " << FrameType); | |
27 | + //PTRACE(2, "Codec\tAMR-WB decoder: Packet size " << *fromLen << " did not match expected " << (AMRWB_block_size_octet[FrameType] + 1) << " for frame type " << FrameType); | |
28 | return 0; | |
29 | ||
30 | case -3: | |
31 | diff -ur opal-3.10.11.org/plugins/audio/Speex/speexcodec.cxx opal-3.10.11/plugins/audio/Speex/speexcodec.cxx | |
32 | --- opal-3.10.11.org/plugins/audio/Speex/speexcodec.cxx 2013-08-15 01:22:44.000000000 +0200 | |
33 | +++ opal-3.10.11/plugins/audio/Speex/speexcodec.cxx 2018-09-29 11:58:07.796456792 +0200 | |
34 | @@ -756,18 +756,19 @@ | |
35 | ||
36 | //////////////////////////////////////////////////////////////////////////////////////////////// | |
37 | ||
38 | -#define NARROW_BITSPERFRAME_MODE2 (Speex_Bits_Per_Second(2, 8000)/50) // 119 // 5950 | |
39 | -#define NARROW_BITSPERFRAME_MODE3 (Speex_Bits_Per_Second(3, 8000)/50) // 160 // 8000 | |
40 | -#define NARROW_BITSPERFRAME_MODE4 (Speex_Bits_Per_Second(4, 8000)/50) // 220 // 11000 | |
41 | -#define NARROW_BITSPERFRAME_MODE5 (Speex_Bits_Per_Second(5, 8000)/50) // 300 // 15000 | |
42 | -#define NARROW_BITSPERFRAME_MODE6 (Speex_Bits_Per_Second(6, 8000)/50) // 364 // 18200 | |
43 | -#define NARROW_BITSPERFRAME_MODE7 (Speex_Bits_Per_Second(7, 8000)/50) // 492 // 26400 | |
44 | +#define NARROW_BITSPERFRAME_MODE(m) ((unsigned)Speex_Bits_Per_Second(m, 8000)/50) | |
45 | +#define NARROW_BITSPERFRAME_MODE2 NARROW_BITSPERFRAME_MODE(2) // 119 // 5950 | |
46 | +#define NARROW_BITSPERFRAME_MODE3 NARROW_BITSPERFRAME_MODE(3) // 160 // 8000 | |
47 | +#define NARROW_BITSPERFRAME_MODE4 NARROW_BITSPERFRAME_MODE(4) // 220 // 11000 | |
48 | +#define NARROW_BITSPERFRAME_MODE5 NARROW_BITSPERFRAME_MODE(5) // 300 // 15000 | |
49 | +#define NARROW_BITSPERFRAME_MODE6 NARROW_BITSPERFRAME_MODE(6) // 364 // 18200 | |
50 | +#define NARROW_BITSPERFRAME_MODE7 NARROW_BITSPERFRAME_MODE(7) // 492 // 26400 | |
51 | ||
52 | //#define WIDE_BITSPERFRAME_MODE2 ((Speex_Bytes_Per_Frame(2, 16000)/50) // NARROW_BITSPERFRAME_MODE2 + 112) // 11550 | |
53 | //#define WIDE_BITSPERFRAME_MODE3 ((Speex_Bytes_Per_Frame(3, 16000)/50) // 17600 | |
54 | //#define WIDE_BITSPERFRAME_MODE4 ((Speex_Bytes_Per_Frame(4, 16000)/50) // 28600 | |
55 | //#define WIDE_BITSPERFRAME_MODE5 ((Speex_Bytes_Per_Frame(5, 16000)/50) // 28600 | |
56 | -#define WIDE_BITSPERFRAME_MODE6 (Speex_Bits_Per_Second(6, 16000)/50) // 20600 | |
57 | +#define WIDE_BITSPERFRAME_MODE6 ((unsigned)Speex_Bits_Per_Second(6, 16000)/50) // 20600 | |
58 | ||
59 | static struct PluginCodec_Definition ver1SpeexCodecDefn[] = { | |
60 | ||
61 | diff -ur opal-3.10.11.org/plugins/video/common/dyna.cxx opal-3.10.11/plugins/video/common/dyna.cxx | |
62 | --- opal-3.10.11.org/plugins/video/common/dyna.cxx 2013-08-15 01:22:47.000000000 +0200 | |
63 | +++ opal-3.10.11/plugins/video/common/dyna.cxx 2018-09-29 11:58:52.681123038 +0200 | |
64 | @@ -210,14 +210,14 @@ | |
8d7f7562 AM |
65 | #endif |
66 | ||
67 | ||
68 | -FFMPEGLibrary::FFMPEGLibrary(CodecID codec) | |
69 | +FFMPEGLibrary::FFMPEGLibrary(AVCodecID codec) | |
70 | { | |
71 | m_codec = codec; | |
72 | - if (m_codec==CODEC_ID_H264) | |
73 | + if (m_codec==AV_CODEC_ID_H264) | |
74 | snprintf( m_codecString, sizeof(m_codecString), "H264"); | |
75 | - if (m_codec==CODEC_ID_H263P) | |
76 | + if (m_codec==AV_CODEC_ID_H263P) | |
77 | snprintf( m_codecString, sizeof(m_codecString), "H263+"); | |
78 | - if (m_codec==CODEC_ID_MPEG4) | |
79 | + if (m_codec==AV_CODEC_ID_MPEG4) | |
80 | snprintf( m_codecString, sizeof(m_codecString), "MPEG4"); | |
81 | m_isLoadedOK = false; | |
82 | } | |
a4d42991 | 83 | @@ -348,12 +348,12 @@ |
8d7f7562 AM |
84 | return true; |
85 | } | |
86 | ||
87 | -AVCodec *FFMPEGLibrary::AvcodecFindEncoder(enum CodecID id) | |
88 | +AVCodec *FFMPEGLibrary::AvcodecFindEncoder(enum AVCodecID id) | |
89 | { | |
a4d42991 | 90 | return Favcodec_find_encoder(id); |
8d7f7562 AM |
91 | } |
92 | ||
93 | -AVCodec *FFMPEGLibrary::AvcodecFindDecoder(enum CodecID id) | |
94 | +AVCodec *FFMPEGLibrary::AvcodecFindDecoder(enum AVCodecID id) | |
95 | { | |
96 | WaitAndSignal m(processLock); | |
97 | ||
a4d42991 AM |
98 | @@ -374,7 +374,7 @@ |
99 | return Favcodec_alloc_frame(); | |
8d7f7562 AM |
100 | } |
101 | ||
a4d42991 AM |
102 | -int FFMPEGLibrary::AvcodecOpen(AVCodecContext *ctx, AVCodec *codec) |
103 | +int FFMPEGLibrary::AvcodecOpen(AVCodecContext *ctx, AVCodec *codec, AVDictionary **options) | |
8d7f7562 | 104 | { |
a4d42991 | 105 | WaitAndSignal m(processLock); |
8d7f7562 | 106 | |
a4d42991 AM |
107 | diff -ur opal-3.10.11.org/plugins/video/common/dyna.h opal-3.10.11/plugins/video/common/dyna.h |
108 | --- opal-3.10.11.org/plugins/video/common/dyna.h 2013-08-15 01:22:47.000000000 +0200 | |
109 | +++ opal-3.10.11/plugins/video/common/dyna.h 2018-09-29 11:58:52.681123038 +0200 | |
110 | @@ -88,16 +88,16 @@ | |
8d7f7562 AM |
111 | class FFMPEGLibrary |
112 | { | |
113 | public: | |
114 | - FFMPEGLibrary(CodecID codec); | |
115 | + FFMPEGLibrary(AVCodecID codec); | |
116 | ~FFMPEGLibrary(); | |
117 | ||
118 | bool Load(); | |
119 | ||
120 | - AVCodec *AvcodecFindEncoder(enum CodecID id); | |
121 | - AVCodec *AvcodecFindDecoder(enum CodecID id); | |
122 | + AVCodec *AvcodecFindEncoder(enum AVCodecID id); | |
123 | + AVCodec *AvcodecFindDecoder(enum AVCodecID id); | |
a4d42991 | 124 | AVCodecContext *AvcodecAllocContext(void); |
8d7f7562 | 125 | AVFrame *AvcodecAllocFrame(void); |
a4d42991 AM |
126 | - int AvcodecOpen(AVCodecContext *ctx, AVCodec *codec); |
127 | + int AvcodecOpen(AVCodecContext *ctx, AVCodec *codec, AVDictionary **options); | |
128 | int AvcodecClose(AVCodecContext *ctx); | |
129 | int AvcodecEncodeVideo(AVCodecContext *ctx, BYTE *buf, int buf_size, const AVFrame *pict); | |
130 | int AvcodecDecodeVideo(AVCodecContext *ctx, AVFrame *pict, int *got_picture_ptr, BYTE *buf, int buf_size); | |
131 | @@ -117,15 +117,15 @@ | |
8d7f7562 AM |
132 | DynaLink m_libAvcodec; |
133 | DynaLink m_libAvutil; | |
134 | ||
135 | - CodecID m_codec; | |
136 | + AVCodecID m_codec; | |
137 | char m_codecString[32]; | |
138 | ||
a4d42991 AM |
139 | void (*Favcodec_init)(void); |
140 | void (*Fav_init_packet)(AVPacket *pkt); | |
8d7f7562 | 141 | |
a4d42991 AM |
142 | void (*Favcodec_register_all)(void); |
143 | - AVCodec *(*Favcodec_find_encoder)(enum CodecID id); | |
144 | - AVCodec *(*Favcodec_find_decoder)(enum CodecID id); | |
145 | + AVCodec *(*Favcodec_find_encoder)(enum AVCodecID id); | |
146 | + AVCodec *(*Favcodec_find_decoder)(enum AVCodecID id); | |
147 | AVCodecContext *(*Favcodec_alloc_context)(void); | |
148 | AVFrame *(*Favcodec_alloc_frame)(void); | |
149 | int (*Favcodec_open)(AVCodecContext *ctx, AVCodec *codec); | |
150 | diff -ur opal-3.10.11.org/plugins/video/common/ffmpeg/libavcodec/avcodec.h opal-3.10.11/plugins/video/common/ffmpeg/libavcodec/avcodec.h | |
151 | --- opal-3.10.11.org/plugins/video/common/ffmpeg/libavcodec/avcodec.h 2013-08-15 01:22:47.000000000 +0200 | |
152 | +++ opal-3.10.11/plugins/video/common/ffmpeg/libavcodec/avcodec.h 2018-09-29 11:58:31.047147254 +0200 | |
153 | @@ -101,7 +101,7 @@ | |
154 | * 1. no value of a existing codec ID changes (that would break ABI), | |
155 | * 2. it is as close as possible to similar codecs. | |
156 | */ | |
157 | -enum CodecID { | |
158 | +enum AVCodecID { | |
159 | CODEC_ID_NONE, | |
160 | ||
161 | /* video codecs */ | |
162 | @@ -1390,7 +1390,7 @@ | |
163 | ||
164 | char codec_name[32]; | |
165 | enum AVMediaType codec_type; /* see AVMEDIA_TYPE_xxx */ | |
166 | - enum CodecID codec_id; /* see CODEC_ID_xxx */ | |
167 | + enum AVCodecID codec_id; /* see CODEC_ID_xxx */ | |
168 | ||
169 | /** | |
170 | * fourcc (LSB first, so "ABCD" -> ('D'<<24) + ('C'<<16) + ('B'<<8) + 'A'). | |
171 | @@ -2843,7 +2843,7 @@ | |
172 | */ | |
173 | const char *name; | |
174 | enum AVMediaType type; | |
175 | - enum CodecID id; | |
176 | + enum AVCodecID id; | |
177 | int priv_data_size; | |
178 | int (*init)(AVCodecContext *); | |
179 | int (*encode)(AVCodecContext *, uint8_t *buf, int buf_size, void *data); | |
180 | @@ -2898,7 +2898,7 @@ | |
181 | * | |
182 | * See CODEC_ID_xxx | |
183 | */ | |
184 | - enum CodecID id; | |
185 | + enum AVCodecID id; | |
186 | ||
187 | /** | |
188 | * Supported pixel format. | |
189 | @@ -3402,10 +3402,10 @@ | |
190 | /** | |
191 | * Find a registered encoder with a matching codec ID. | |
192 | * | |
193 | - * @param id CodecID of the requested encoder | |
194 | + * @param id AVCodecID of the requested encoder | |
195 | * @return An encoder if one was found, NULL otherwise. | |
196 | */ | |
197 | -AVCodec *avcodec_find_encoder(enum CodecID id); | |
198 | +AVCodec *avcodec_find_encoder(enum AVCodecID id); | |
199 | ||
200 | /** | |
201 | * Find a registered encoder with the specified name. | |
202 | @@ -3418,10 +3418,10 @@ | |
203 | /** | |
204 | * Find a registered decoder with a matching codec ID. | |
205 | * | |
206 | - * @param id CodecID of the requested decoder | |
207 | + * @param id AVCodecID of the requested decoder | |
208 | * @return A decoder if one was found, NULL otherwise. | |
209 | */ | |
210 | -AVCodec *avcodec_find_decoder(enum CodecID id); | |
211 | +AVCodec *avcodec_find_decoder(enum AVCodecID id); | |
212 | ||
213 | /** | |
214 | * Find a registered decoder with the specified name. | |
215 | @@ -3822,7 +3822,7 @@ | |
216 | * @param[in] codec_id the codec | |
217 | * @return Number of bits per sample or zero if unknown for the given codec. | |
218 | */ | |
219 | -int av_get_bits_per_sample(enum CodecID codec_id); | |
220 | +int av_get_bits_per_sample(enum AVCodecID codec_id); | |
221 | ||
222 | #if FF_API_OLD_SAMPLE_FMT | |
223 | /** | |
224 | diff -ur opal-3.10.11.org/plugins/video/common/ffmpeg.h opal-3.10.11/plugins/video/common/ffmpeg.h | |
225 | --- opal-3.10.11.org/plugins/video/common/ffmpeg.h 2013-08-15 01:22:47.000000000 +0200 | |
226 | +++ opal-3.10.11/plugins/video/common/ffmpeg.h 2018-09-29 11:58:52.681123038 +0200 | |
227 | @@ -46,6 +46,7 @@ | |
228 | #include "platform.h" | |
8d7f7562 | 229 | |
a4d42991 AM |
230 | #include "libavcodec/avcodec.h" |
231 | +#include "libavutil/imgutils.h" | |
232 | // AVPacket was declared in avformat.h before April 2009 | |
233 | #if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(52, 25, 0) | |
234 | #include "libavformat/avformat.h" | |
235 | diff -ur opal-3.10.11.org/plugins/video/common/mpi.cxx opal-3.10.11/plugins/video/common/mpi.cxx | |
236 | --- opal-3.10.11.org/plugins/video/common/mpi.cxx 2013-08-15 01:22:47.000000000 +0200 | |
237 | +++ opal-3.10.11/plugins/video/common/mpi.cxx 2018-09-29 12:00:33.957463916 +0200 | |
238 | @@ -132,8 +132,8 @@ | |
239 | // to the desired one or matches it | |
240 | for (i=0; i < MPIs.size(); i++) { | |
241 | // we square the value in order to get absolute distances | |
242 | - distance = ( abs(MPIs[i].width - desiredWidth ) * | |
243 | - abs(MPIs[i].height - desiredHeight) ); | |
244 | + distance = ( abs((int)(MPIs[i].width - desiredWidth )) * | |
245 | + abs((int)(MPIs[i].height - desiredHeight)) ); | |
246 | ||
247 | if (distance < minDistance) { | |
248 | minDistance = distance; | |
249 | 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 | |
250 | --- opal-3.10.11.org/plugins/video/H.263-1998/h263-1998.cxx 2013-08-15 01:22:47.000000000 +0200 | |
251 | +++ opal-3.10.11/plugins/video/H.263-1998/h263-1998.cxx 2018-09-29 11:59:17.348522238 +0200 | |
252 | @@ -48,6 +48,10 @@ | |
8d7f7562 | 253 | #endif |
8d7f7562 | 254 | |
a4d42991 AM |
255 | #include "h263-1998.h" |
256 | +extern "C" | |
257 | +{ | |
258 | +#include <libavutil/opt.h> | |
259 | +} | |
260 | #include <limits> | |
261 | #include <iomanip> | |
262 | #include <stdio.h> | |
263 | @@ -70,7 +74,7 @@ | |
8d7f7562 | 264 | |
8d7f7562 | 265 | |
a4d42991 AM |
266 | #define MAX_H263_CUSTOM_SIZES 10 |
267 | -#define DEFAULT_CUSTOM_MPI "0,0,"STRINGIZE(PLUGINCODEC_MPI_DISABLED) | |
268 | +#define DEFAULT_CUSTOM_MPI "0,0," STRINGIZE(PLUGINCODEC_MPI_DISABLED) | |
8d7f7562 | 269 | |
a4d42991 AM |
270 | static struct StdSizes { |
271 | enum { | |
272 | @@ -94,7 +98,7 @@ | |
273 | { CIF16_WIDTH, CIF16_HEIGHT, PLUGINCODEC_CIF16_MPI }, | |
274 | }; | |
8d7f7562 | 275 | |
a4d42991 AM |
276 | -static FFMPEGLibrary FFMPEGLibraryInstance(CODEC_ID_H263P); |
277 | +static FFMPEGLibrary FFMPEGLibraryInstance(AV_CODEC_ID_H263P); | |
8d7f7562 | 278 | |
8d7f7562 | 279 | |
a4d42991 AM |
280 | ///////////////////////////////////////////////////////////////////////////// |
281 | @@ -203,7 +207,7 @@ | |
282 | PTRACE(4, m_prefix, "Encoder closed"); | |
283 | } | |
8d7f7562 | 284 | |
a4d42991 AM |
285 | -bool H263_Base_EncoderContext::Init(CodecID codecId) |
286 | +bool H263_Base_EncoderContext::Init(AVCodecID codecId) | |
287 | { | |
288 | PTRACE(5, m_prefix, "Opening encoder"); | |
289 | ||
290 | @@ -230,11 +234,10 @@ | |
8d7f7562 AM |
291 | |
292 | m_context->opaque = this; | |
293 | ||
a4d42991 AM |
294 | - m_context->flags = CODEC_FLAG_EMU_EDGE // don't draw edges |
295 | - | CODEC_FLAG_TRUNCATED // Possible missing packets | |
8d7f7562 AM |
296 | + m_context->flags = AV_CODEC_FLAG_TRUNCATED // Possible missing packets |
297 | ; | |
298 | ||
a4d42991 AM |
299 | - m_context->pix_fmt = PIX_FMT_YUV420P; |
300 | + m_context->pix_fmt = AV_PIX_FMT_YUV420P; | |
301 | m_context->gop_size = H263_KEY_FRAME_INTERVAL; | |
302 | ||
303 | // X-Lite does not like Custom Picture frequency clocks... stick to 29.97Hz | |
304 | @@ -317,9 +320,9 @@ | |
305 | // Level 2+ | |
306 | // works with eyeBeam, signaled via non-standard "D" | |
307 | if (atoi(value) == 1) | |
308 | - m_context->flags |= CODEC_FLAG_H263P_UMV; | |
309 | + av_opt_set_int(m_context->priv_data, "umv", 1, 0); | |
310 | else | |
311 | - m_context->flags &= ~CODEC_FLAG_H263P_UMV; | |
312 | + av_opt_set_int(m_context->priv_data, "umv", 0, 0); | |
313 | return; | |
314 | } | |
315 | ||
316 | @@ -328,9 +331,9 @@ | |
317 | // Annex F: Advanced Prediction Mode | |
318 | // does not work with eyeBeam | |
319 | if (atoi(value) == 1) | |
320 | - m_context->flags |= CODEC_FLAG_OBMC; | |
321 | + av_opt_set_int(m_context->priv_data, "obmc", 1, 0); | |
322 | else | |
323 | - m_context->flags &= ~CODEC_FLAG_OBMC; | |
324 | + av_opt_set_int(m_context->priv_data, "obmc", 0, 0); | |
325 | return; | |
326 | } | |
327 | #endif | |
328 | @@ -340,9 +343,9 @@ | |
8d7f7562 AM |
329 | // Level 3+ |
330 | // works with eyeBeam | |
331 | if (atoi(value) == 1) | |
332 | - m_context->flags |= CODEC_FLAG_AC_PRED; | |
333 | + m_context->flags |= AV_CODEC_FLAG_AC_PRED; | |
334 | else | |
335 | - m_context->flags &= ~CODEC_FLAG_AC_PRED; | |
336 | + m_context->flags &= ~AV_CODEC_FLAG_AC_PRED; | |
337 | return; | |
338 | } | |
339 | ||
a4d42991 | 340 | @@ -350,9 +353,9 @@ |
8d7f7562 AM |
341 | // Annex J: Deblocking Filter |
342 | // works with eyeBeam | |
343 | if (atoi(value) == 1) | |
344 | - m_context->flags |= CODEC_FLAG_LOOP_FILTER; | |
345 | + m_context->flags |= AV_CODEC_FLAG_LOOP_FILTER; | |
346 | else | |
347 | - m_context->flags &= ~CODEC_FLAG_LOOP_FILTER; | |
348 | + m_context->flags &= ~AV_CODEC_FLAG_LOOP_FILTER; | |
349 | return; | |
350 | } | |
351 | ||
a4d42991 AM |
352 | @@ -360,9 +363,9 @@ |
353 | // Annex K: Slice Structure | |
354 | // does not work with eyeBeam | |
355 | if (atoi(value) != 0) | |
356 | - m_context->flags |= CODEC_FLAG_H263P_SLICE_STRUCT; | |
357 | + av_opt_set_int(m_context->priv_data, "structured_slices", 1, 0); | |
358 | else | |
359 | - m_context->flags &= ~CODEC_FLAG_H263P_SLICE_STRUCT; | |
360 | + av_opt_set_int(m_context->priv_data, "structured_slices", 0, 0); | |
361 | return; | |
362 | } | |
363 | ||
364 | @@ -370,9 +373,9 @@ | |
365 | // Annex S: Alternative INTER VLC mode | |
366 | // does not work with eyeBeam | |
367 | if (atoi(value) == 1) | |
368 | - m_context->flags |= CODEC_FLAG_H263P_AIV; | |
369 | + av_opt_set_int(m_context->priv_data, "aiv", 1, 0); | |
370 | else | |
371 | - m_context->flags &= ~CODEC_FLAG_H263P_AIV; | |
372 | + av_opt_set_int(m_context->priv_data, "aiv", 0, 0); | |
373 | return; | |
374 | } | |
375 | ||
376 | @@ -416,8 +419,8 @@ | |
377 | m_context->qcompress = 0.5; // qscale factor between easy & hard scenes (0.0-1.0) | |
378 | ||
379 | // Lagrange multipliers - this is how the context defaults do it: | |
380 | - m_context->lmin = m_context->qmin * FF_QP2LAMBDA; | |
381 | - m_context->lmax = m_context->qmax * FF_QP2LAMBDA; | |
382 | + av_opt_set_int(m_context->priv_data, "lmin", m_context->qmin * FF_QP2LAMBDA, 0); | |
383 | + av_opt_set_int(m_context->priv_data, "lmax", m_context->qmax * FF_QP2LAMBDA, 0); | |
384 | ||
385 | // YUV420P input | |
386 | m_inputFrame->linesize[0] = m_context->width; | |
387 | @@ -434,9 +437,6 @@ | |
388 | m_inputFrame->data[1] = m_inputFrame->data[0] + planeSize; | |
389 | m_inputFrame->data[2] = m_inputFrame->data[1] + (planeSize / 4); | |
390 | ||
391 | - if (m_context->width > 352) | |
392 | - m_context->flags &= ~CODEC_FLAG_EMU_EDGE; // Totally bizarre! FFMPEG crashes if on for CIF4 | |
393 | - | |
394 | // Dump info | |
395 | PTRACE(5, m_prefix, "Size is " << m_context->width << "x" << m_context->height); | |
396 | PTRACE(5, m_prefix, "GOP is " << m_context->gop_size); | |
397 | @@ -450,16 +450,7 @@ | |
398 | PTRACE(5, m_prefix, "qmax set to " << m_context->qmax); | |
399 | PTRACE(5, m_prefix, "payload size set to " << m_context->rtp_payload_size); | |
400 | ||
401 | - #define CODEC_TRACER_FLAG(tracer, flag) \ | |
402 | - PTRACE(4, m_prefix, #flag " is " << ((m_context->flags & flag) ? "enabled" : "disabled")); | |
403 | - CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_UMV); | |
404 | - CODEC_TRACER_FLAG(tracer, CODEC_FLAG_OBMC); | |
405 | - CODEC_TRACER_FLAG(tracer, CODEC_FLAG_AC_PRED); | |
406 | - CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_SLICE_STRUCT) | |
407 | - CODEC_TRACER_FLAG(tracer, CODEC_FLAG_LOOP_FILTER); | |
408 | - CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_AIV); | |
409 | - | |
410 | - return FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec) == 0; | |
411 | + return FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec, NULL) == 0; | |
412 | } | |
413 | ||
414 | void H263_Base_EncoderContext::CloseCodec() | |
415 | @@ -521,7 +512,7 @@ | |
416 | ||
417 | // Need to copy to local buffer to guarantee 16 byte alignment | |
418 | memcpy(m_inputFrame->data[0], OPAL_VIDEO_FRAME_DATA_PTR(header), header->width*header->height*3/2); | |
419 | - m_inputFrame->pict_type = (flags & PluginCodec_CoderForceIFrame) ? FF_I_TYPE : AV_PICTURE_TYPE_NONE; | |
420 | + m_inputFrame->pict_type = (flags & PluginCodec_CoderForceIFrame) ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_NONE; | |
421 | ||
422 | /* | |
423 | m_inputFrame->pts = (int64_t)srcRTP.GetTimestamp()*m_context->time_base.den/m_context->time_base.num/VIDEO_CLOCKRATE; | |
424 | @@ -592,7 +583,7 @@ | |
425 | ||
426 | bool H263_RFC2190_EncoderContext::Init() | |
427 | { | |
428 | - if (!H263_Base_EncoderContext::Init(CODEC_ID_H263)) | |
429 | + if (!H263_Base_EncoderContext::Init(AV_CODEC_ID_H263)) | |
430 | return false; | |
431 | ||
432 | #if LIBAVCODEC_RTP_MODE | |
433 | @@ -603,13 +594,13 @@ | |
434 | m_context->rtp_callback = &H263_RFC2190_EncoderContext::RTPCallBack; | |
435 | m_context->opaque = this; // used to separate out packets from different encode threads | |
436 | ||
437 | - m_context->flags &= ~CODEC_FLAG_H263P_UMV; | |
8d7f7562 | 438 | - m_context->flags &= ~CODEC_FLAG_4MV; |
a4d42991 | 439 | + av_opt_set_int(m_context->priv_data, "umv", 0, 0); |
8d7f7562 AM |
440 | + m_context->flags &= ~AV_CODEC_FLAG_4MV; |
441 | #if LIBAVCODEC_RTP_MODE | |
442 | m_context->flags &= ~CODEC_FLAG_H263P_AIC; | |
443 | #endif | |
a4d42991 AM |
444 | - m_context->flags &= ~CODEC_FLAG_H263P_AIV; |
445 | - m_context->flags &= ~CODEC_FLAG_H263P_SLICE_STRUCT; | |
446 | + av_opt_set_int(m_context->priv_data, "aiv", 0, 0); | |
447 | + av_opt_set_int(m_context->priv_data, "structured_slices", 0, 0); | |
448 | ||
449 | return true; | |
450 | } | |
451 | @@ -629,7 +620,7 @@ | |
452 | ||
453 | bool H263_RFC2429_EncoderContext::Init() | |
454 | { | |
455 | - return H263_Base_EncoderContext::Init(CODEC_ID_H263P); | |
456 | + return H263_Base_EncoderContext::Init(AV_CODEC_ID_H263P); | |
457 | } | |
458 | ||
459 | ||
460 | @@ -653,7 +644,7 @@ | |
461 | if (!FFMPEGLibraryInstance.Load()) | |
462 | return; | |
463 | ||
464 | - if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_H263)) == NULL) { | |
465 | + if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(AV_CODEC_ID_H263)) == NULL) { | |
466 | PTRACE(1, m_prefix, "Codec not found for decoder"); | |
467 | return; | |
468 | } | |
469 | @@ -704,7 +695,7 @@ | |
470 | return 0; | |
471 | } | |
472 | ||
473 | - if (FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec) < 0) { | |
474 | + if (FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec, NULL) < 0) { | |
475 | PTRACE(1, m_prefix, "Failed to open H.263 decoder"); | |
476 | return false; | |
477 | } | |
478 | diff -ur opal-3.10.11.org/plugins/video/H.263-1998/h263-1998.h opal-3.10.11/plugins/video/H.263-1998/h263-1998.h | |
479 | --- opal-3.10.11.org/plugins/video/H.263-1998/h263-1998.h 2013-08-15 01:22:47.000000000 +0200 | |
480 | +++ opal-3.10.11/plugins/video/H.263-1998/h263-1998.h 2018-09-29 11:58:31.047147254 +0200 | |
481 | @@ -115,7 +115,7 @@ | |
482 | virtual ~H263_Base_EncoderContext(); | |
483 | ||
484 | virtual bool Init() = 0; | |
485 | - virtual bool Init(CodecID codecId); | |
486 | + virtual bool Init(AVCodecID codecId); | |
487 | ||
488 | virtual bool SetOptions(const char * const * options); | |
489 | virtual void SetOption(const char * option, const char * value); | |
490 | diff -ur opal-3.10.11.org/plugins/video/H.263-1998/Makefile.in opal-3.10.11/plugins/video/H.263-1998/Makefile.in | |
491 | --- opal-3.10.11.org/plugins/video/H.263-1998/Makefile.in 2013-08-15 01:22:47.000000000 +0200 | |
492 | +++ opal-3.10.11/plugins/video/H.263-1998/Makefile.in 2018-09-29 11:58:31.047147254 +0200 | |
493 | @@ -35,7 +35,7 @@ | |
494 | $(COMMONDIR)/dyna.cxx | |
495 | ||
496 | CFLAGS += @LIBAVCODEC_CFLAGS@ -I$(COMMONDIR) | |
497 | -LIBS += @DL_LIBS@ | |
498 | +LIBS += @DL_LIBS@ @LIBAVUTIL_LIBS@ | |
499 | ||
500 | HAVE_LIBAVCODEC_RTP_MODE=@HAVE_LIBAVCODEC_RTP_MODE@ | |
501 | ifeq ($(HAVE_LIBAVCODEC_RTP_MODE),yes) | |
502 | diff -ur opal-3.10.11.org/plugins/video/H.263-1998/rfc2190.cxx opal-3.10.11/plugins/video/H.263-1998/rfc2190.cxx | |
503 | --- opal-3.10.11.org/plugins/video/H.263-1998/rfc2190.cxx 2013-08-15 01:22:47.000000000 +0200 | |
504 | +++ opal-3.10.11/plugins/video/H.263-1998/rfc2190.cxx 2018-09-29 12:00:01.429831294 +0200 | |
505 | @@ -25,7 +25,7 @@ | |
506 | ||
507 | #include <iostream> | |
508 | #include <string.h> | |
509 | -#include <malloc.h> | |
510 | +#include <stdlib.h> | |
511 | ||
512 | ||
513 | const unsigned char PSC[3] = { 0x00, 0x00, 0x80 }; | |
8d7f7562 AM |
514 | 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 |
515 | --- opal-3.10.11.org/plugins/video/H.263-1998/rfc2429.cxx 2013-08-15 01:22:47.000000000 +0200 | |
a4d42991 | 516 | +++ opal-3.10.11/plugins/video/H.263-1998/rfc2429.cxx 2018-09-29 11:59:17.348522238 +0200 |
8d7f7562 AM |
517 | @@ -286,7 +286,7 @@ |
518 | ||
519 | unsigned char * RFC2429Frame::GetBuffer() | |
520 | { | |
521 | - memset (m_encodedFrame.ptr + m_encodedFrame.pos,0 , FF_INPUT_BUFFER_PADDING_SIZE); | |
522 | + memset (m_encodedFrame.ptr + m_encodedFrame.pos,0 , AV_INPUT_BUFFER_PADDING_SIZE); | |
523 | return (m_encodedFrame.ptr); | |
524 | } | |
525 | ||
526 | @@ -340,10 +340,10 @@ | |
527 | ||
528 | unsigned remBytes = packet.GetPayloadSize() - headerPLEN - (headerV ? 3 : 2); | |
529 | ||
530 | - if ((m_encodedFrame.pos + (headerP ? 2 : 0) + remBytes) > (m_maxFrameSize - FF_INPUT_BUFFER_PADDING_SIZE)) { | |
531 | + if ((m_encodedFrame.pos + (headerP ? 2 : 0) + remBytes) > (m_maxFrameSize - AV_INPUT_BUFFER_PADDING_SIZE)) { | |
532 | PTRACE(2, "H.263-RFC2429", "Trying to add " << remBytes | |
533 | << " bytes to frame at position " << m_encodedFrame.pos + (headerP ? 2 : 0) | |
534 | - << " bytes while maximum frame size is " << m_maxFrameSize << "-" << FF_INPUT_BUFFER_PADDING_SIZE << " bytes"); | |
535 | + << " bytes while maximum frame size is " << m_maxFrameSize << "-" << AV_INPUT_BUFFER_PADDING_SIZE << " bytes"); | |
536 | return false; | |
537 | } | |
538 | ||
a4d42991 AM |
539 | diff -ur opal-3.10.11.org/plugins/video/H.264/gpl/h264_helper.cxx opal-3.10.11/plugins/video/H.264/gpl/h264_helper.cxx |
540 | --- opal-3.10.11.org/plugins/video/H.264/gpl/h264_helper.cxx 2013-08-15 01:22:47.000000000 +0200 | |
541 | +++ opal-3.10.11/plugins/video/H.264/gpl/h264_helper.cxx 2018-09-29 11:58:31.047147254 +0200 | |
542 | @@ -27,6 +27,7 @@ | |
543 | #include <fstream> | |
544 | #include <stdlib.h> | |
545 | #include <sys/stat.h> | |
546 | +#include <unistd.h> | |
547 | ||
548 | #ifdef HAVE_UNISTD_H | |
549 | #include <unistd.h> | |
550 | diff -ur opal-3.10.11.org/plugins/video/H.264/h264-x264.cxx opal-3.10.11/plugins/video/H.264/h264-x264.cxx | |
551 | --- opal-3.10.11.org/plugins/video/H.264/h264-x264.cxx 2013-08-15 01:22:47.000000000 +0200 | |
552 | +++ opal-3.10.11/plugins/video/H.264/h264-x264.cxx 2018-09-29 11:59:17.351855670 +0200 | |
553 | @@ -40,6 +40,9 @@ | |
554 | #include "plugin-config.h" | |
555 | #endif | |
556 | ||
557 | +#define FF_IDCT_H264 11 | |
558 | +#define CODEC_FLAG2_SKIP_RD 0x00004000 | |
559 | + | |
560 | #include <codec/opalplugin.hpp> | |
561 | ||
562 | #include "../common/ffmpeg.h" | |
563 | @@ -104,7 +107,7 @@ | |
564 | ||
565 | /////////////////////////////////////////////////////////////////////////////// | |
566 | ||
567 | -FFMPEGLibrary FFMPEGLibraryInstance(CODEC_ID_H264); | |
568 | +FFMPEGLibrary FFMPEGLibraryInstance(AV_CODEC_ID_H264); | |
569 | ||
570 | PLUGINCODEC_CONTROL_LOG_FUNCTION_DEF | |
571 | ||
572 | @@ -1064,27 +1067,23 @@ | |
573 | allows you to fail the create operation (return false), which cannot | |
574 | be done in the normal C++ constructor. */ | |
575 | ||
576 | - if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_H264)) == NULL) | |
577 | + if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(AV_CODEC_ID_H264)) == NULL) | |
578 | return false; | |
579 | ||
580 | if ((m_context = FFMPEGLibraryInstance.AvcodecAllocContext()) == NULL) | |
581 | return false; | |
582 | ||
583 | m_context->workaround_bugs = FF_BUG_AUTODETECT; | |
584 | - m_context->error_recognition = FF_ER_AGGRESSIVE; | |
585 | m_context->idct_algo = FF_IDCT_H264; | |
586 | m_context->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK; | |
587 | - m_context->flags = CODEC_FLAG_INPUT_PRESERVED | CODEC_FLAG_EMU_EDGE; | |
588 | - m_context->flags2 = CODEC_FLAG2_BRDO | | |
589 | - CODEC_FLAG2_MEMC_ONLY | | |
590 | - CODEC_FLAG2_DROP_FRAME_TIMECODE | | |
591 | + m_context->flags2 = AV_CODEC_FLAG2_DROP_FRAME_TIMECODE | | |
592 | CODEC_FLAG2_SKIP_RD | | |
593 | - CODEC_FLAG2_CHUNKS; | |
594 | + AV_CODEC_FLAG2_CHUNKS; | |
595 | ||
596 | if ((m_picture = FFMPEGLibraryInstance.AvcodecAllocFrame()) == NULL) | |
597 | return false; | |
598 | ||
599 | - if (FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec) < 0) | |
600 | + if (FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec, NULL) < 0) | |
601 | return false; | |
602 | ||
603 | PTRACE(4, MY_CODEC_LOG, "Opened decoder (SVN $Revision: 28048 $)"); | |
604 | @@ -1181,7 +1180,7 @@ | |
605 | ||
606 | uint8_t * src[3] = { m_picture->data[0], m_picture->data[1], m_picture->data[2] }; | |
607 | uint8_t * dst[3] = { OPAL_VIDEO_FRAME_DATA_PTR(videoHeader), dst[0] + ySize, dst[1] + uvSize }; | |
608 | - size_t dstLineSize[3] = { m_context->width, m_context->width/2, m_context->width/2 }; | |
609 | + size_t dstLineSize[3] = { (size_t)m_context->width, (size_t)m_context->width/2, (size_t)m_context->width/2 }; | |
610 | ||
611 | for (int y = 0; y < m_context->height; ++y) { | |
612 | for (int plane = 0; plane < 3; ++plane) { | |
613 | diff -ur opal-3.10.11.org/plugins/video/H.264/shared/x264wrap.cxx opal-3.10.11/plugins/video/H.264/shared/x264wrap.cxx | |
614 | --- opal-3.10.11.org/plugins/video/H.264/shared/x264wrap.cxx 2013-08-15 01:22:47.000000000 +0200 | |
615 | +++ opal-3.10.11/plugins/video/H.264/shared/x264wrap.cxx 2018-09-29 11:58:31.047147254 +0200 | |
616 | @@ -33,6 +33,7 @@ | |
617 | ||
618 | #include <codec/opalplugin.hpp> | |
619 | #include <stdio.h> | |
620 | +#include <unistd.h> | |
621 | ||
622 | #ifdef HAVE_UNISTD_H | |
623 | #include <unistd.h> | |
624 | diff -ur opal-3.10.11.org/plugins/video/MPEG4-ffmpeg/Makefile.in opal-3.10.11/plugins/video/MPEG4-ffmpeg/Makefile.in | |
625 | --- opal-3.10.11.org/plugins/video/MPEG4-ffmpeg/Makefile.in 2013-08-15 01:22:47.000000000 +0200 | |
626 | +++ opal-3.10.11/plugins/video/MPEG4-ffmpeg/Makefile.in 2018-09-29 11:58:31.047147254 +0200 | |
627 | @@ -31,7 +31,7 @@ | |
628 | SRCS := mpeg4.cxx $(COMMONDIR)/dyna.cxx | |
629 | ||
630 | CFLAGS += @LIBAVCODEC_CFLAGS@ -I$(COMMONDIR) | |
631 | -LIBS += @DL_LIBS@ | |
632 | +LIBS += @DL_LIBS@ @LIBAVUTIL_LIBS@ | |
633 | ||
634 | # Add LIBAVCODEC_SOURCE_DIR to the include path so we can #include <libavcodec/...h> | |
635 | # Also add libavutil, so ffmpeg headers can #include "log.h". | |
8d7f7562 | 636 | diff -ur opal-3.10.11.org/plugins/video/MPEG4-ffmpeg/mpeg4.cxx opal-3.10.11/plugins/video/MPEG4-ffmpeg/mpeg4.cxx |
a4d42991 AM |
637 | --- opal-3.10.11.org/plugins/video/MPEG4-ffmpeg/mpeg4.cxx 2013-08-15 01:22:47.000000000 +0200 |
638 | +++ opal-3.10.11/plugins/video/MPEG4-ffmpeg/mpeg4.cxx 2018-09-29 11:59:17.351855670 +0200 | |
639 | @@ -103,6 +103,7 @@ | |
640 | ||
641 | #else /* LIBAVCODEC_HAVE_SOURCE_DIR */ | |
642 | #include "../common/ffmpeg.h" | |
643 | +#include <libavutil/opt.h> | |
644 | #endif /* LIBAVCODEC_HAVE_SOURCE_DIR */ | |
645 | } | |
646 | ||
647 | @@ -205,7 +206,7 @@ | |
648 | { 0 } | |
649 | }; | |
650 | ||
651 | -FFMPEGLibrary FFMPEGLibraryInstance(CODEC_ID_MPEG4); | |
652 | +FFMPEGLibrary FFMPEGLibraryInstance(AV_CODEC_ID_MPEG4); | |
653 | ||
654 | ||
655 | static bool mpeg4IsIframe (BYTE * frameBuffer, unsigned int frameLen ) | |
656 | @@ -539,7 +540,7 @@ | |
657 | // | |
658 | ||
659 | void MPEG4EncoderContext::SetStaticEncodingParams(){ | |
660 | - m_avcontext->pix_fmt = PIX_FMT_YUV420P; | |
661 | + m_avcontext->pix_fmt = AV_PIX_FMT_YUV420P; | |
662 | m_avcontext->mb_decision = FF_MB_DECISION_SIMPLE; // high quality off | |
663 | m_avcontext->rtp_payload_size = 750; // ffh263 uses 750 | |
664 | m_avcontext->rtp_callback = &MPEG4EncoderContext::RtpCallback; | |
665 | @@ -547,19 +548,19 @@ | |
666 | // Reduce the difference in quantization between frames. | |
667 | m_avcontext->qblur = 0.3f; | |
668 | // default is tex^qComp; 1 is constant bitrate | |
669 | - m_avcontext->rc_eq = (char*) "1"; | |
670 | - //avcontext->rc_eq = "tex^qComp"; | |
671 | + av_opt_set(m_avcontext->priv_data, "rc_eq", (char*) "1", 0); | |
672 | + //av_opt_set(m_avcontext->priv_data, "rc_eq", "tex^qComp", 0); | |
673 | // These ones technically could be dynamic, I think | |
674 | m_avcontext->rc_min_rate = 0; | |
675 | // This is set to 0 in ffmpeg.c, the command-line utility. | |
676 | - m_avcontext->rc_initial_cplx = 0.0f; | |
677 | + av_opt_set_double(m_avcontext->priv_data, "rc_init_cplx", 0.0f, 0); | |
678 | ||
679 | // And this is set to 1. | |
680 | // It seems to affect how aggressively the library will raise and lower | |
681 | // quantization to keep bandwidth constant. Except it's in reference to | |
682 | // the "vbv buffer", not bits per second, so nobody really knows how | |
683 | // it works. | |
684 | - m_avcontext->rc_buffer_aggressivity = 1.0f; | |
685 | + av_opt_set_double(m_avcontext->priv_data, "rc_buf_aggressivity", 1.0f, 0); | |
686 | ||
687 | // Ratecontrol buffer size, in bits. Usually 0.5-1 second worth. | |
688 | // 224 kbyte is what VLC uses, and it seems to fix the quantization pulse (at Level 5) | |
689 | @@ -589,17 +590,16 @@ | |
8d7f7562 AM |
690 | m_avpicture->quality = m_videoQMin; |
691 | ||
692 | #ifdef USE_ORIG | |
a4d42991 AM |
693 | - m_avcontext->flags |= CODEC_FLAG_PART; // data partitioning |
694 | + av_opt_set_int(m_avcontext->priv_data, "data_partitionin", 1, 0); | |
695 | m_avcontext->flags |= CODEC_FLAG_4MV; // 4 motion vectors | |
8d7f7562 AM |
696 | #else |
697 | m_avcontext->max_b_frames=0; /*don't use b frames*/ | |
698 | - m_avcontext->flags|=CODEC_FLAG_AC_PRED; | |
a4d42991 | 699 | - m_avcontext->flags|=CODEC_FLAG_H263P_UMV; |
8d7f7562 | 700 | + m_avcontext->flags|=AV_CODEC_FLAG_AC_PRED; |
a4d42991 | 701 | + av_opt_set_int(m_avcontext->priv_data, "umv", 1, 0); |
8d7f7562 AM |
702 | /*c->flags|=CODEC_FLAG_QPEL;*/ /*don't enable this one: this forces profile_level to advanced simple profile */ |
703 | - m_avcontext->flags|=CODEC_FLAG_4MV; | |
a4d42991 | 704 | - m_avcontext->flags|=CODEC_FLAG_GMC; |
8d7f7562 | 705 | - m_avcontext->flags|=CODEC_FLAG_LOOP_FILTER; |
a4d42991 | 706 | - m_avcontext->flags|=CODEC_FLAG_H263P_SLICE_STRUCT; |
8d7f7562 AM |
707 | + m_avcontext->flags|=AV_CODEC_FLAG_4MV; |
708 | + m_avcontext->flags|=AV_CODEC_FLAG_LOOP_FILTER; | |
a4d42991 | 709 | + av_opt_set_int(m_avcontext->priv_data, "structured_slices", 1, 0); |
8d7f7562 AM |
710 | #endif |
711 | m_avcontext->opaque = this; // for use in RTP callback | |
712 | } | |
a4d42991 AM |
713 | @@ -636,8 +636,8 @@ |
714 | m_avcontext->qmax = std::min( m_avcontext->qmax, 31); | |
715 | ||
716 | // Lagrange multipliers - this is how the context defaults do it: | |
717 | - m_avcontext->lmin = m_avcontext->qmin * FF_QP2LAMBDA; | |
718 | - m_avcontext->lmax = m_avcontext->qmax * FF_QP2LAMBDA; | |
719 | + av_opt_set_int(m_avcontext->priv_data, "lmin", m_avcontext->qmin * FF_QP2LAMBDA, 0); | |
720 | + av_opt_set_int(m_avcontext->priv_data, "lmax", m_avcontext->qmax * FF_QP2LAMBDA, 0); | |
721 | ||
722 | // If framesize has changed or is not yet initialized, fix it up | |
723 | if((unsigned)m_avcontext->width != m_frameWidth || (unsigned)m_avcontext->height != m_frameHeight) { | |
724 | @@ -665,7 +665,7 @@ | |
8d7f7562 AM |
725 | { |
726 | delete[] m_rawFrameBuffer; | |
727 | } | |
728 | - m_rawFrameBuffer = new BYTE[m_rawFrameLen + FF_INPUT_BUFFER_PADDING_SIZE]; | |
729 | + m_rawFrameBuffer = new BYTE[m_rawFrameLen + AV_INPUT_BUFFER_PADDING_SIZE]; | |
730 | ||
731 | if (m_encFrameBuffer) | |
732 | { | |
a4d42991 | 733 | @@ -675,7 +675,7 @@ |
8d7f7562 AM |
734 | m_encFrameBuffer = new BYTE[m_encFrameLen]; |
735 | ||
736 | // Clear the back padding | |
737 | - memset(m_rawFrameBuffer + m_rawFrameLen, 0, FF_INPUT_BUFFER_PADDING_SIZE); | |
738 | + memset(m_rawFrameBuffer + m_rawFrameLen, 0, AV_INPUT_BUFFER_PADDING_SIZE); | |
739 | const unsigned fsz = m_frameWidth * m_frameHeight; | |
740 | m_avpicture->data[0] = m_rawFrameBuffer; // luminance | |
741 | m_avpicture->data[1] = m_rawFrameBuffer + fsz; // first chroma channel | |
a4d42991 AM |
742 | @@ -703,7 +703,7 @@ |
743 | return false; | |
744 | } | |
745 | ||
746 | - if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(CODEC_ID_MPEG4)) == NULL){ | |
747 | + if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(AV_CODEC_ID_MPEG4)) == NULL){ | |
748 | PTRACE(1, "MPEG4", "Encoder not found"); | |
749 | return false; | |
750 | } | |
751 | @@ -713,13 +713,15 @@ | |
752 | if (PTRACE_CHECK(4)) { | |
753 | m_avcontext->debug |= FF_DEBUG_RC; | |
754 | m_avcontext->debug |= FF_DEBUG_PICT_INFO; | |
755 | - m_avcontext->debug |= FF_DEBUG_MV; | |
756 | +// m_avcontext->debug |= FF_DEBUG_MV; | |
757 | } | |
758 | #endif | |
759 | ||
760 | SetStaticEncodingParams(); | |
761 | SetDynamicEncodingParams(false); // don't force a restart, it's not open | |
762 | - if (FFMPEGLibraryInstance.AvcodecOpen(m_avcontext, m_avcodec) < 0) | |
763 | + AVDictionary *opts = NULL; | |
764 | + av_dict_set_int(&opts, "gmc", 1, 0); | |
765 | + if (FFMPEGLibraryInstance.AvcodecOpen(m_avcontext, m_avcodec, &opts) < 0) | |
766 | { | |
767 | PTRACE(1, "MPEG4", "Encoder could not be opened"); | |
768 | return false; | |
769 | @@ -804,7 +806,7 @@ | |
770 | // Should the next frame be an I-Frame? | |
771 | if ((flags & PluginCodec_CoderForceIFrame) || (m_frameNum == 0)) | |
772 | { | |
773 | - m_avpicture->pict_type = FF_I_TYPE; | |
774 | + m_avpicture->pict_type = AV_PICTURE_TYPE_I; | |
775 | } | |
776 | else // No IFrame requested, let avcodec decide what to do | |
777 | { | |
778 | @@ -1324,8 +1326,8 @@ | |
8d7f7562 AM |
779 | // |
780 | ||
781 | void MPEG4DecoderContext::SetStaticDecodingParams() { | |
782 | - m_avcontext->flags |= CODEC_FLAG_4MV; | |
a4d42991 | 783 | - m_avcontext->flags |= CODEC_FLAG_PART; |
8d7f7562 | 784 | + m_avcontext->flags |= AV_CODEC_FLAG_4MV; |
a4d42991 | 785 | + av_opt_set_int(m_avcontext->priv_data, "data_partitionin", 1, 0); |
8d7f7562 AM |
786 | m_avcontext->workaround_bugs = 0; // no workaround for buggy implementations |
787 | } | |
788 | ||
a4d42991 AM |
789 | @@ -1394,7 +1396,7 @@ |
790 | ||
791 | bool MPEG4DecoderContext::OpenCodec() | |
792 | { | |
793 | - if ((m_avcodec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_MPEG4)) == NULL) { | |
794 | + if ((m_avcodec = FFMPEGLibraryInstance.AvcodecFindDecoder(AV_CODEC_ID_MPEG4)) == NULL) { | |
795 | PTRACE(1, "MPEG4", "Decoder not found for encoder"); | |
796 | return false; | |
797 | } | |
798 | @@ -1415,7 +1417,7 @@ | |
799 | ||
800 | SetStaticDecodingParams(); | |
801 | SetDynamicDecodingParams(false); // don't force a restart, it's not open | |
802 | - if (FFMPEGLibraryInstance.AvcodecOpen(m_avcontext, m_avcodec) < 0) { | |
803 | + if (FFMPEGLibraryInstance.AvcodecOpen(m_avcontext, m_avcodec, NULL) < 0) { | |
804 | PTRACE(1, "MPEG4", "Decoder failed to open"); | |
805 | return false; | |
806 | } | |
807 | diff -ur opal-3.10.11.org/src/im/msrp.cxx opal-3.10.11/src/im/msrp.cxx | |
808 | --- opal-3.10.11.org/src/im/msrp.cxx 2013-08-15 01:22:57.000000000 +0200 | |
809 | +++ opal-3.10.11/src/im/msrp.cxx 2018-09-29 11:58:07.796456792 +0200 | |
810 | @@ -835,7 +835,8 @@ | |
811 | flush(); | |
812 | ||
813 | { | |
814 | - PStringStream str; str << ::setfill('\r') << mime.PrintContents(str); | |
815 | + PStringStream str; str << ::setfill('\r'); | |
816 | + mime.PrintContents(str); | |
817 | PTRACE(4, "Sending MSRP REPORT\n" << "MSRP " << chunkId << " " << MSRPCommands[REPORT] << CRLF | |
818 | << "To-Path: " << toUrl << CRLF | |
819 | << "From-Path: "<< fromUrl << CRLF | |
820 | diff -ur opal-3.10.11.org/src/sip/sipep.cxx opal-3.10.11/src/sip/sipep.cxx | |
821 | --- opal-3.10.11.org/src/sip/sipep.cxx 2013-08-15 01:22:51.000000000 +0200 | |
822 | +++ opal-3.10.11/src/sip/sipep.cxx 2018-09-29 11:58:07.796456792 +0200 | |
823 | @@ -471,7 +471,7 @@ | |
824 | if (!AddConnection(connection)) | |
825 | return false; | |
826 | ||
827 | - if (remoteParty.Find(";OPAL-"OPAL_SIP_REFERRED_CONNECTION) == P_MAX_INDEX) | |
828 | + if (remoteParty.Find(";OPAL-" OPAL_SIP_REFERRED_CONNECTION) == P_MAX_INDEX) | |
829 | otherConnection->Release(OpalConnection::EndedByCallForwarded); | |
830 | else | |
831 | otherConnection->SetPhase(OpalConnection::ForwardingPhase); |