1 Index: opal-3.6.8/plugins/configure.ac
2 ===================================================================
3 --- opal-3.6.8.orig/plugins/configure.ac
4 +++ opal-3.6.8/plugins/configure.ac
5 @@ -237,9 +237,9 @@ PKG_CHECK_MODULES([LIBAVCODEC],
9 - AC_CHECK_LIB(avcodec, h263p_encoder, [HAVE_H263P=yes], [HAVE_H263P=no])
10 - AC_CHECK_LIB(avcodec, mpeg4_encoder, [HAVE_MPEG4=yes], [HAVE_MPEG4=no])
11 - AC_CHECK_LIB(avcodec, h264_decoder, [HAVE_H264_DECODER=yes], [HAVE_H264_DECODER=no])
12 + OPAL_CODEC_CHECK(HAVE_H263P, encoder, CODEC_ID_H263P)
13 + OPAL_CODEC_CHECK(HAVE_MPEG4, encoder, CODEC_ID_MPEG4)
14 + OPAL_CODEC_CHECK(HAVE_H264_DECODER, decoder, CODEC_ID_H264)
18 Index: opal-3.6.8/plugins/video/common/dyna.cxx
19 ===================================================================
20 --- opal-3.6.8.orig/plugins/video/common/dyna.cxx
21 +++ opal-3.6.8/plugins/video/common/dyna.cxx
22 @@ -240,43 +240,7 @@ bool FFMPEGLibrary::Load(int ver)
26 - if (_codec==CODEC_ID_H264) {
27 - if (!libAvcodec.GetFunction("h264_decoder", (DynaLink::Function &)Favcodec_h264_decoder)) {
28 - TRACE (1, _codecString << "\tDYNA\tFailed to load h264_decoder");
33 - if (_codec==CODEC_ID_H263P) {
34 - if (!libAvcodec.GetFunction("h263_encoder", (DynaLink::Function &)Favcodec_h263_encoder)) {
35 - TRACE (1, _codecString << "\tDYNA\tFailed to load h263_encoder" );
39 - if (!libAvcodec.GetFunction("h263p_encoder", (DynaLink::Function &)Favcodec_h263p_encoder)) {
40 - TRACE (1, _codecString << "\tDYNA\tFailed to load h263p_encoder" );
44 - if (!libAvcodec.GetFunction("h263_decoder", (DynaLink::Function &)Favcodec_h263_decoder)) {
45 - TRACE (1, _codecString << "\tDYNA\tFailed to load h263_decoder" );
50 - if (_codec==CODEC_ID_MPEG4) {
51 - if (!libAvcodec.GetFunction("mpeg4_encoder", (DynaLink::Function &)mpeg4_encoder)) {
52 - TRACE (1, _codecString << "\tDYNA\tFailed to load mpeg4_encoder");
56 - if (!libAvcodec.GetFunction("mpeg4_decoder", (DynaLink::Function &)mpeg4_decoder)) {
57 - TRACE (1, _codecString << "\tDYNA\tFailed to load mpeg4_decoder");
62 - if (!libAvcodec.GetFunction("register_avcodec", (DynaLink::Function &)Favcodec_register)) {
63 + if (!libAvcodec.GetFunction("avcodec_register_all", (DynaLink::Function &)Favcodec_register_all)) {
64 TRACE (1, _codecString << "\tDYNA\tFailed to load register_avcodec");
67 @@ -370,20 +334,13 @@ bool FFMPEGLibrary::Load(int ver)
71 + Favcodec_register_all();
73 - // register only the codecs needed (to have smaller code)
74 - if (_codec==CODEC_ID_H264)
75 - Favcodec_register(Favcodec_h264_decoder);
77 - if (_codec==CODEC_ID_H263P) {
78 - Favcodec_register(Favcodec_h263_encoder);
79 - Favcodec_register(Favcodec_h263p_encoder);
80 - Favcodec_register(Favcodec_h263_decoder);
83 - if (_codec==CODEC_ID_MPEG4) {
84 - Favcodec_register(mpeg4_encoder);
85 - Favcodec_register(mpeg4_decoder);
86 + /* check for the codec */
87 + if (Favcodec_find_decoder(_codec) == NULL &&
88 + Favcodec_find_encoder(_codec) == NULL) {
89 + TRACE (1, _codecString << "\tDYNA\tFailed to load codec");
93 if (FFCheckAlignment() != 0) {
94 Index: opal-3.6.8/plugins/video/common/dyna.h
95 ===================================================================
96 --- opal-3.6.8.orig/plugins/video/common/dyna.h
97 +++ opal-3.6.8/plugins/video/common/dyna.h
98 @@ -187,14 +187,8 @@ class FFMPEGLibrary
99 char _codecString [32];
101 void (*Favcodec_init)(void);
102 - AVCodec *Favcodec_h263_encoder;
103 - AVCodec *Favcodec_h263p_encoder;
104 - AVCodec *Favcodec_h263_decoder;
105 - AVCodec *Favcodec_h264_decoder;
106 - AVCodec *mpeg4_encoder;
107 - AVCodec *mpeg4_decoder;
109 - void (*Favcodec_register)(AVCodec *format);
110 + void (*Favcodec_register_all)(void);
111 AVCodec *(*Favcodec_find_encoder)(enum CodecID id);
112 AVCodec *(*Favcodec_find_decoder)(enum CodecID id);
113 AVCodecContext *(*Favcodec_alloc_context)(void);
114 Index: opal-3.6.8/opal.m4
115 ===================================================================
116 --- opal-3.6.8.orig/opal.m4
117 +++ opal-3.6.8/opal.m4
118 @@ -1055,3 +1055,26 @@ AC_DEFUN([OPAL_DETERMINE_ILBC],
119 OPAL_MSG_CHECK([System iLBC], [$has_ilbc])
123 +dnl OPAL_CODEC_CHECK
124 +dnl check for a codec presence in ffmpeg
125 +dnl Arguments: $1 name of configure option
126 +dnl $2 'encode' or 'decode'
127 +dnl $3 name of codec to check for (define in ffmpeg)
128 +AC_DEFUN([OPAL_CODEC_CHECK],
130 + AC_MSG_CHECKING(checking for codec $3 in libavcodec)
134 + [AC_LANG_PROGRAM([[
135 + #include <libavcodec/avcodec.h>
139 + avcodec_register_all();
140 + return avcodec_find_$2($3) == NULL;
142 + )], [$1=yes], [$1=no], [$1=no])
145 diff --git a/include/h323/h323ep.h b/include/h323/h323ep.h
146 --- a/include/h323/h323ep.h
147 +++ b/include/h323/h323ep.h
148 @@ -60,6 +60,7 @@ class H225_H221NonStandard;
149 class H225_H221NonStandard;
150 class H225_ServiceControlDescriptor;
151 class H225_FeatureSet;
152 +class H225_ArrayOf_SupportedProtocols;
154 class H235SecurityInfo;
156 diff --git a/plugins/video/H.264/shared/h264frame.cxx b/plugins/video/H.264/shared/h264frame.cxx
157 --- a/plugins/video/H.264/shared/h264frame.cxx
158 +++ b/plugins/video/H.264/shared/h264frame.cxx
159 @@ -86,7 +86,6 @@ H264Frame::~H264Frame ()
162 void H264Frame::SetFromFrame (x264_nal_t *NALs, int numberOfNALs) {
166 uint8_t* currentPositionInFrame=(uint8_t*) _encodedFrame;
167 @@ -99,8 +98,9 @@ void H264Frame::SetFromFrame (x264_nal_t
169 // read the nals out of the encoder and create meta data about their location and size in the frame
170 for (currentNAL = 0; currentNAL < numberOfNALs; currentNAL++) {
172 - currentNALLen = X264_NAL_ENCODE(currentPositionInFrame, &vopBufferLen, 1, &NALs[currentNAL]);
173 + int currentNALLen = NALs[currentNAL].i_payload;
174 + memcpy(currentPositionInFrame, NALs[currentNAL].p_payload, NALs[currentNAL].i_payload);
176 if (currentNALLen > 0)
178 _NALs[_numberOfNALsInFrame].length = currentNALLen;
179 --- opal-3.6.8/plugins/video/H.263-1998/h263-1998.cxx~ 2010-05-27 08:52:46.000000000 +0200
180 +++ opal-3.6.8/plugins/video/H.263-1998/h263-1998.cxx 2011-06-30 16:50:50.842457173 +0200
183 _inputFrame->data[1] = _inputFrame->data[0] + size;
184 _inputFrame->data[2] = _inputFrame->data[1] + (size / 4);
185 - _inputFrame->pict_type = (flags && forceIFrame) ? FF_I_TYPE : 0;
186 + _inputFrame->pict_type = AV_PICTURE_TYPE_I;
191 _inputFrame->data[0] = _inputFrameBuffer + FF_INPUT_BUFFER_PADDING_SIZE;
192 _inputFrame->data[1] = _inputFrame->data[0] + size;
193 _inputFrame->data[2] = _inputFrame->data[1] + (size / 4);
194 - _inputFrame->pict_type = (flags && forceIFrame) ? FF_I_TYPE : 0;
195 + _inputFrame->pict_type = AV_PICTURE_TYPE_I;
197 _txH263PFrame->BeginNewFrame();
198 _txH263PFrame->SetTimestamp(srcRTP.GetTimestamp());
199 --- opal-3.6.8/plugins/video/MPEG4-ffmpeg/mpeg4.cxx~ 2010-05-27 08:52:47.000000000 +0200
200 +++ opal-3.6.8/plugins/video/MPEG4-ffmpeg/mpeg4.cxx 2011-07-01 10:27:44.590440941 +0200
202 // Should the next frame be an I-Frame?
203 if ((flags & PluginCodec_CoderForceIFrame) || (_frameNum == 0))
205 - _avpicture->pict_type = FF_I_TYPE;
207 - else // No IFrame requested, let avcodec decide what to do
209 - _avpicture->pict_type = 0;
210 + _avpicture->pict_type = AV_PICTURE_TYPE_I;
214 @@ -1363,7 +1359,7 @@
217 MpegEncContext *s = (MpegEncContext *) _avcontext->priv_data;
218 - if (s->error_count && _avcontext->coded_frame->pict_type == FF_I_TYPE) {
219 + if (s->error_count && _avcontext->coded_frame->pict_type == AV_PICTURE_TYPE_I) {
220 const uint8_t badflags = AC_ERROR | DC_ERROR | MV_ERROR;
221 for (int i = 0; i < s->mb_num && errors < threshold; ++i) {
222 if (s->error_status_table[s->mb_index2xy[i]] & badflags)