]> git.pld-linux.org Git - packages/opal.git/blame - opal-ffmpeg08.patch
- up to 3.10.8
[packages/opal.git] / opal-ffmpeg08.patch
CommitLineData
2925c82f 1Index: 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],
6 HAVE_H264_DECODER=yes
7 ;;
8 * )
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)
15 ;;
16 esac
17 AC_SUBST(HAVE_H263P)
18Index: 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)
23 return false;
24 }
25
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");
29- return false;
30- }
31- }
32-
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" );
36- return false;
37- }
38-
39- if (!libAvcodec.GetFunction("h263p_encoder", (DynaLink::Function &)Favcodec_h263p_encoder)) {
40- TRACE (1, _codecString << "\tDYNA\tFailed to load h263p_encoder" );
41- return false;
42- }
43-
44- if (!libAvcodec.GetFunction("h263_decoder", (DynaLink::Function &)Favcodec_h263_decoder)) {
45- TRACE (1, _codecString << "\tDYNA\tFailed to load h263_decoder" );
46- return false;
47- }
48- }
49-
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");
53- return false;
54- }
55-
56- if (!libAvcodec.GetFunction("mpeg4_decoder", (DynaLink::Function &)mpeg4_decoder)) {
57- TRACE (1, _codecString << "\tDYNA\tFailed to load mpeg4_decoder");
58- return false;
59- }
60- }
61-
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");
65 return false;
66 }
67@@ -370,20 +334,13 @@ bool FFMPEGLibrary::Load(int ver)
68 }
69
70 Favcodec_init();
71+ Favcodec_register_all();
72
73- // register only the codecs needed (to have smaller code)
74- if (_codec==CODEC_ID_H264)
75- Favcodec_register(Favcodec_h264_decoder);
76-
77- if (_codec==CODEC_ID_H263P) {
78- Favcodec_register(Favcodec_h263_encoder);
79- Favcodec_register(Favcodec_h263p_encoder);
80- Favcodec_register(Favcodec_h263_decoder);
81- }
82-
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");
90+ return false;
91 }
92
93 if (FFCheckAlignment() != 0) {
94Index: 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];
100
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;
108
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);
114Index: 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])
120 fi
121 ])
122+
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],
129+ [
130+ AC_MSG_CHECKING(checking for codec $3 in libavcodec)
131+ AC_LANG([C])
132+ LIBS=-lavcodec
133+ AC_RUN_IFELSE(
134+ [AC_LANG_PROGRAM([[
135+ #include <libavcodec/avcodec.h>
136+ ]],
137+ [[
138+ avcodec_init();
139+ avcodec_register_all();
140+ return avcodec_find_$2($3) == NULL;
141+ ]]
142+ )], [$1=yes], [$1=no], [$1=no])
143+ AC_MSG_RESULT($$1)
144+ ])
145diff --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;
153
154 class H235SecurityInfo;
155
156diff --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 ()
160
161 #ifndef LICENCE_MPL
162 void H264Frame::SetFromFrame (x264_nal_t *NALs, int numberOfNALs) {
163- int vopBufferLen;
164 int currentNAL = 0;
165
166 uint8_t* currentPositionInFrame=(uint8_t*) _encodedFrame;
167@@ -99,8 +98,9 @@ void H264Frame::SetFromFrame (x264_nal_t
168
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++) {
171- int currentNALLen;
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);
175+
176 if (currentNALLen > 0)
177 {
178 _NALs[_numberOfNALsInFrame].length = currentNALLen;
This page took 4.132851 seconds and 4 git commands to generate.