mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 16:08:51 +00:00
Add stdlib include (free, atoi, exit).
Original commit message from CVS: * examples/app/appsrc_ex.c: * examples/switch/switcher.c: * ext/neon/gstneonhttpsrc.c: * ext/timidity/gstwildmidi.c: * ext/x264/gstx264enc.c: * gst/mve/mveaudioenc.c: (mve_compress_audio): * gst/rtpmanager/gstrtpclient.c: * gst/rtpmanager/gstrtpjitterbuffer.c: * gst/spectrum/demo-audiotest.c: * gst/spectrum/demo-osssrc.c: * sys/dvb/gstdvbsrc.c: Add stdlib include (free, atoi, exit).
This commit is contained in:
parent
7da951e3d5
commit
f56adf75ca
13 changed files with 107 additions and 45 deletions
15
ChangeLog
15
ChangeLog
|
@ -1,3 +1,18 @@
|
||||||
|
2007-07-18 Stefan Kost <ensonic@users.sf.net>
|
||||||
|
|
||||||
|
* examples/app/appsrc_ex.c:
|
||||||
|
* examples/switch/switcher.c:
|
||||||
|
* ext/neon/gstneonhttpsrc.c:
|
||||||
|
* ext/timidity/gstwildmidi.c:
|
||||||
|
* ext/x264/gstx264enc.c:
|
||||||
|
* gst/mve/mveaudioenc.c: (mve_compress_audio):
|
||||||
|
* gst/rtpmanager/gstrtpclient.c:
|
||||||
|
* gst/rtpmanager/gstrtpjitterbuffer.c:
|
||||||
|
* gst/spectrum/demo-audiotest.c:
|
||||||
|
* gst/spectrum/demo-osssrc.c:
|
||||||
|
* sys/dvb/gstdvbsrc.c:
|
||||||
|
Add stdlib include (free, atoi, exit).
|
||||||
|
|
||||||
2007-07-16 Sebastian Dröge <slomo@circular-chaos.org>
|
2007-07-16 Sebastian Dröge <slomo@circular-chaos.org>
|
||||||
|
|
||||||
* ext/faad/gstfaad.c: (clip_outgoing_buffer):
|
* ext/faad/gstfaad.c: (clip_outgoing_buffer):
|
||||||
|
|
2
common
2
common
|
@ -1 +1 @@
|
||||||
Subproject commit fb4b30ebbec59a8944cacae5fb5cf40bff5dfcaa
|
Subproject commit b3fe2a25c1cd0f4b021795d0db7330aeb338da7c
|
|
@ -11,6 +11,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
typedef struct _App App;
|
typedef struct _App App;
|
||||||
|
|
|
@ -21,6 +21,8 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "gstneonhttpsrc.h"
|
#include "gstneonhttpsrc.h"
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
|
|
@ -53,6 +53,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <glib/gstdio.h>
|
#include <glib/gstdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include "gstwildmidi.h"
|
#include "gstwildmidi.h"
|
||||||
|
|
|
@ -25,6 +25,8 @@
|
||||||
#include "gstx264enc.h"
|
#include "gstx264enc.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
|
||||||
enum
|
enum
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,37 +20,55 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
||||||
static const gint32 dec_table[256] =
|
static const gint32 dec_table[256] = {
|
||||||
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
16, 17, 18, 19,
|
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
|
||||||
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37,
|
16, 17, 18, 19,
|
||||||
38, 39, 40, 41, 42, 43, 47, 51, 56, 61,
66, 72, 79, 86, 94, 102, 112,
|
20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||||
122, 133, 145, 158, 173, 189, 206, 225, 245,
267, 292, 318, 348, 379,
|
32, 33, 34, 35, 36, 37,
|
||||||
414, 452, 493, 538, 587, 640, 699, 763, 832, 908, 991,
1081, 1180, 1288,
|
38, 39, 40, 41, 42, 43, 47, 51, 56, 61,
|
||||||
|
66, 72, 79, 86, 94, 102, 112,
|
||||||
|
122, 133, 145, 158, 173, 189, 206, 225, 245,
|
||||||
|
267, 292, 318, 348, 379,
|
||||||
|
414, 452, 493, 538, 587, 640, 699, 763, 832, 908, 991,
|
||||||
|
1081, 1180, 1288,
|
||||||
1405, 1534, 1673, 1826, 1993, 2175, 2373, 2590, 2826, 3084, 3365, 3672,
|
1405, 1534, 1673, 1826, 1993, 2175, 2373, 2590, 2826, 3084, 3365, 3672,
|
||||||
4008,
4373, 4772, 5208, 5683, 6202, 6767, 7385, 8059, 8794, 9597, 10472,
|
4008,
|
||||||
11428, 12471, 13609, 14851, 16206,
17685, 19298, 21060, 22981, 25078,
|
4373, 4772, 5208, 5683, 6202, 6767, 7385, 8059, 8794, 9597, 10472,
|
||||||
|
11428, 12471, 13609, 14851, 16206,
|
||||||
|
17685, 19298, 21060, 22981, 25078,
|
||||||
27367, 29864, 32589, 35563, 38808, 42350, 46214, 50431, 55033, 60055,
|
27367, 29864, 32589, 35563, 38808, 42350, 46214, 50431, 55033, 60055,
|
||||||
65535,
1, -65535, -60055, -55033, -50431, -46214, -42350, -38808, -35563,
|
65535,
|
||||||
-32589, -29864, -27367, -25078, -22981, -21060, -19298,
-17685, -16206,
|
1, -65535, -60055, -55033, -50431, -46214, -42350, -38808, -35563,
|
||||||
|
-32589, -29864, -27367, -25078, -22981, -21060, -19298,
|
||||||
|
-17685, -16206,
|
||||||
-14851, -13609, -12471, -11428, -10472, -9597, -8794, -8059, -7385, -6767,
|
-14851, -13609, -12471, -11428, -10472, -9597, -8794, -8059, -7385, -6767,
|
||||||
-6202, -5683, -5208, -4772,
-4373, -4008, -3672, -3365, -3084, -2826,
|
-6202, -5683, -5208, -4772,
|
||||||
|
-4373, -4008, -3672, -3365, -3084, -2826,
|
||||||
-2590, -2373, -2175, -1993, -1826, -1673, -1534, -1405, -1288, -1180,
|
-2590, -2373, -2175, -1993, -1826, -1673, -1534, -1405, -1288, -1180,
|
||||||
|
|
||||||
-1081, -991, -908, -832, -763, -699, -640, -587, -538, -493, -452, -414,
|
-1081, -991, -908, -832, -763, -699, -640, -587, -538, -493, -452, -414,
|
||||||
-379, -348, -318, -292,
-267, -245, -225, -206, -189, -173, -158, -145,
|
-379, -348, -318, -292,
|
||||||
-133, -122, -112, -102, -94, -86, -79, -72,
-66, -61, -56, -51, -47, -43,
|
-267, -245, -225, -206, -189, -173, -158, -145,
|
||||||
-42, -41, -40, -39, -38, -37, -36, -35, -34, -33,
-32, -31, -30, -29,
|
-133, -122, -112, -102, -94, -86, -79, -72,
|
||||||
-28, -27, -26, -25, -24, -23, -22, -21, -20, -19, -18, -17,
-16, -15,
|
-66, -61, -56, -51, -47, -43,
|
||||||
|
-42, -41, -40, -39, -38, -37, -36, -35, -34, -33,
|
||||||
|
-32, -31, -30, -29,
|
||||||
|
-28, -27, -26, -25, -24, -23, -22, -21, -20, -19, -18, -17,
|
||||||
|
-16, -15,
|
||||||
-14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1
|
-14, -13, -12, -11, -10, -9, -8, -7, -6, -5, -4, -3, -2, -1
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* This value could be non-optimal. Without knowledge of the value
|
/* This value could be non-optimal. Without knowledge of the value
|
||||||
distribution in the real signal, the actual optimum cannot be evaluated.
|
distribution in the real signal, the actual optimum cannot be evaluated.
|
||||||
Should be somewhere between 11.458 and 11.542. */
|
Should be somewhere between 11.458 and 11.542. */
|
||||||
static const gdouble DPCM_SCALE = 11.5131;
|
static const gdouble DPCM_SCALE = 11.5131;
|
||||||
static gint8
|
|
||||||
|
static gint8
|
||||||
mve_enc_delta (guint n)
|
mve_enc_delta (guint n)
|
||||||
{
|
{
|
||||||
if (n < 44)
|
if (n < 44)
|
||||||
|
@ -81,12 +99,18 @@ mve_compress_audio (guint8 * dest, const guint8 * src, guint16 len,
|
||||||
src += 2;
|
src += 2;
|
||||||
|
|
||||||
delta = s - prev[cur_chan];
|
delta = s - prev[cur_chan];
|
||||||
|
|
||||||
if (delta >= 0)
|
if (delta >= 0)
|
||||||
|
|
||||||
v = mve_enc_delta (delta);
|
v = mve_enc_delta (delta);
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
v = 256 - mve_enc_delta (-delta);
|
v = 256 - mve_enc_delta (-delta);
|
||||||
|
|
||||||
|
|
||||||
real_res = dec_table[v] + prev[cur_chan];
|
real_res = dec_table[v] + prev[cur_chan];
|
||||||
|
|
||||||
if (real_res < -32768 || real_res > 32767) {
|
if (real_res < -32768 || real_res > 32767) {
|
||||||
|
|
||||||
/* correct overflow */
|
/* correct overflow */
|
||||||
|
@ -94,14 +118,19 @@ mve_compress_audio (guint8 * dest, const guint8 * src, guint16 len,
|
||||||
prev[cur_chan], dec_table[v], real_res,
|
prev[cur_chan], dec_table[v], real_res,
|
||||||
v, dec_table[v], prev[cur_chan]+dec_table[v]); */
|
v, dec_table[v], prev[cur_chan]+dec_table[v]); */
|
||||||
if (s > 0) {
|
if (s > 0) {
|
||||||
|
|
||||||
if (real_res > 32767)
|
if (real_res > 32767)
|
||||||
--v;
|
--v;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (real_res < -32768)
|
if (real_res < -32768)
|
||||||
++v;
|
++v;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
real_res = dec_table[v] + prev[cur_chan];
|
real_res = dec_table[v] + prev[cur_chan];
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (G_UNLIKELY (abs (real_res - s) > 32767)) {
|
if (G_UNLIKELY (abs (real_res - s) > 32767)) {
|
||||||
|
@ -109,11 +138,15 @@ mve_compress_audio (guint8 * dest, const guint8 * src, guint16 len,
|
||||||
real_res - s);
|
real_res - s);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
*dest++ = v;
|
*dest++ = v;
|
||||||
|
|
||||||
--len;
|
--len;
|
||||||
/* use previous output instead of input. That way output will not go too far from input. */
|
/* use previous output instead of input. That way output will not go too far from input. */
|
||||||
prev[cur_chan] += dec_table[v];
|
prev[cur_chan] += dec_table[v];
|
||||||
cur_chan = channels - 1 - cur_chan;
|
cur_chan = channels - 1 - cur_chan;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -44,6 +44,8 @@
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "gstrtpclient.h"
|
#include "gstrtpclient.h"
|
||||||
|
|
|
@ -65,6 +65,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <gst/rtp/gstrtpbuffer.h>
|
#include <gst/rtp/gstrtpbuffer.h>
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
|
@ -20,6 +20,8 @@
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <gst/gst.h>
|
#include <gst/gst.h>
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <error.h>
|
#include <error.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include "_stdint.h"
|
#include "_stdint.h"
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue