From 0debb1e9fcb4cae6ad74a1b1a8d4f75f5749eb69 Mon Sep 17 00:00:00 2001 From: Sébastien Moutte Date: Thu, 30 Mar 2006 23:37:16 +0000 Subject: ext\jpeg\smokecodec.c: use of GST_DEBUG instead of DEBUG(a...) for WIN32 Original commit message from CVS: * ext\jpeg\smokecodec.c: use of GST_DEBUG instead of DEBUG(a...) for WIN32 * ext\speex\gstspeexenc.c: (gst_speexenc_set_header_on_caps): move first instruction after all variables declarations * gst\alpha\gstalpha.c: * gst\effectv\gstshagadelic.c: * gst\smpte\paint.c: * gst\videofilter\gstvideobalance.c: define M_PI if it's not defined (it's not defined on WIN32) * gst\cutter\gstcutter.c: (gst_cutter_chain): * gst\id3demux\id3v2frames.c: (parse_relative_volume_adjustment_two): * gst\level\gstlevel.c: (gst_level_set_property), (gst_level_transform_ip): * gst\matroska\matroska-demux.c: (gst_matroska_demux_parse_info), (gst_matroska_demux_video_caps): * gst\matroska\matroska-mux.c: (gst_matroska_mux_start), (gst_matroska_mux_finish): * gst\wavparse\gstwavparse.c: (gst_wavparse_stream_data): use gst_guint64_to_gdouble for conversions * gst\goom\filters.c: (setPixelRGB_): fix a debug which was using undefined variable * gst\level\gstlevel.c: (gst_level_set_caps), (gst_level_transform_ip): * gst\matroska\ebml-read.c: (gst_ebml_read_sint): replace LL suffix with L suffix (LL isn't supported by MSVC6.0) * win32/vs6: add vs6 projects files for most of plugins-good --- ChangeLog | 27 +++++++++++++++++++++++++++ ext/jpeg/smokecodec.c | 7 +++++++ ext/speex/gstspeexenc.c | 6 ++++-- gst/alpha/gstalpha.c | 4 ++++ gst/cutter/gstcutter.c | 14 +++++++++----- gst/effectv/gstshagadelic.c | 4 ++++ gst/goom/filters.c | 3 ++- gst/id3demux/id3v2frames.c | 3 ++- gst/level/gstlevel.c | 14 ++++++++------ gst/matroska/ebml-read.c | 2 +- gst/matroska/matroska-demux.c | 4 ++-- gst/matroska/matroska-mux.c | 4 ++-- gst/smpte/paint.c | 4 ++++ gst/videofilter/gstvideobalance.c | 4 ++++ gst/wavparse/gstwavparse.c | 4 +++- 15 files changed, 83 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50cd81ad..294e1473 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2006-03-31 Sebastien Moutte + + * ext\jpeg\smokecodec.c: + use of GST_DEBUG instead of DEBUG(a...) for WIN32 + * ext\speex\gstspeexenc.c: (gst_speexenc_set_header_on_caps): + move first instruction after all variables declarations + * gst\alpha\gstalpha.c: + * gst\effectv\gstshagadelic.c: + * gst\smpte\paint.c: + * gst\videofilter\gstvideobalance.c: + define M_PI if it's not defined (it's not defined on WIN32) + * gst\cutter\gstcutter.c: (gst_cutter_chain): + * gst\id3demux\id3v2frames.c: (parse_relative_volume_adjustment_two): + * gst\level\gstlevel.c: (gst_level_set_property), (gst_level_transform_ip): + * gst\matroska\matroska-demux.c: (gst_matroska_demux_parse_info), + (gst_matroska_demux_video_caps): + * gst\matroska\matroska-mux.c: (gst_matroska_mux_start), (gst_matroska_mux_finish): + * gst\wavparse\gstwavparse.c: (gst_wavparse_stream_data): + use gst_guint64_to_gdouble for conversions + * gst\goom\filters.c: (setPixelRGB_): + fix a debug which was using undefined variable + * gst\level\gstlevel.c: (gst_level_set_caps), (gst_level_transform_ip): + * gst\matroska\ebml-read.c: (gst_ebml_read_sint): + replace LL suffix with L suffix (LL isn't supported by MSVC6.0) + * win32/vs6: + add vs6 projects files for most of plugins-good + 2006-03-30 j^ * ext/aalib/gstaasink.c: diff --git a/ext/jpeg/smokecodec.c b/ext/jpeg/smokecodec.c index 930aa412..887e5c20 100644 --- a/ext/jpeg/smokecodec.c +++ b/ext/jpeg/smokecodec.c @@ -36,8 +36,15 @@ #include "smokecodec.h" #include "smokeformat.h" +#ifndef WIN32 //#define DEBUG(a...) printf( a ); #define DEBUG(a,...) +#else +#include +#define DEBUG GST_DEBUG +#endif + + struct _SmokeCodecInfo { diff --git a/ext/speex/gstspeexenc.c b/ext/speex/gstspeexenc.c index 429c7c7a..f6d97467 100644 --- a/ext/speex/gstspeexenc.c +++ b/ext/speex/gstspeexenc.c @@ -841,11 +841,13 @@ static GstCaps * gst_speexenc_set_header_on_caps (GstCaps * caps, GstBuffer * buf1, GstBuffer * buf2) { - caps = gst_caps_make_writable (caps); - GstStructure *structure = gst_caps_get_structure (caps, 0); + GstStructure *structure = NULL; GValue array = { 0 }; GValue value = { 0 }; + caps = gst_caps_make_writable (caps); + structure = gst_caps_get_structure (caps, 0); + /* mark buffers */ GST_BUFFER_FLAG_SET (buf1, GST_BUFFER_FLAG_IN_CAPS); GST_BUFFER_FLAG_SET (buf2, GST_BUFFER_FLAG_IN_CAPS); diff --git a/gst/alpha/gstalpha.c b/gst/alpha/gstalpha.c index da6e0732..cdb9db1c 100644 --- a/gst/alpha/gstalpha.c +++ b/gst/alpha/gstalpha.c @@ -26,6 +26,10 @@ #include #include +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + #define GST_TYPE_ALPHA \ (gst_alpha_get_type()) #define GST_ALPHA(obj) \ diff --git a/gst/cutter/gstcutter.c b/gst/cutter/gstcutter.c index 8d3c0647..5f794d90 100644 --- a/gst/cutter/gstcutter.c +++ b/gst/cutter/gstcutter.c @@ -263,7 +263,8 @@ gst_cutter_chain (GstPad * pad, GstBuffer * buf) NMS, RMS, gst_audio_duration_from_pad_buffer (filter->sinkpad, buf)); if (RMS < filter->threshold_level) filter->silent_run_length += - gst_audio_duration_from_pad_buffer (filter->sinkpad, buf); + gst_guint64_to_gdouble (gst_audio_duration_from_pad_buffer (filter-> + sinkpad, buf)); else { filter->silent_run_length = 0 * GST_SECOND; filter->silent = FALSE; @@ -307,13 +308,15 @@ gst_cutter_chain (GstPad * pad, GstBuffer * buf) if (filter->silent) { filter->pre_buffer = g_list_append (filter->pre_buffer, buf); filter->pre_run_length += - gst_audio_duration_from_pad_buffer (filter->sinkpad, buf); + gst_guint64_to_gdouble (gst_audio_duration_from_pad_buffer (filter-> + sinkpad, buf)); while (filter->pre_run_length > filter->pre_length) { prebuf = (g_list_first (filter->pre_buffer))->data; g_assert (GST_IS_BUFFER (prebuf)); filter->pre_buffer = g_list_remove (filter->pre_buffer, prebuf); filter->pre_run_length -= - gst_audio_duration_from_pad_buffer (filter->sinkpad, prebuf); + gst_guint64_to_gdouble (gst_audio_duration_from_pad_buffer (filter-> + sinkpad, prebuf)); /* only pass buffers if we don't leak */ if (!filter->leaky) gst_pad_push (filter->srcpad, prebuf); @@ -349,11 +352,12 @@ gst_cutter_set_property (GObject * object, guint prop_id, break; case PROP_RUN_LENGTH: /* set the minimum length of the silent run required */ - filter->threshold_length = g_value_get_uint64 (value); + filter->threshold_length = + gst_guint64_to_gdouble (g_value_get_uint64 (value)); break; case PROP_PRE_LENGTH: /* set the length of the pre-record block */ - filter->pre_length = g_value_get_uint64 (value); + filter->pre_length = gst_guint64_to_gdouble (g_value_get_uint64 (value)); break; case PROP_LEAKY: /* set if the pre-record buffer is leaky or not */ diff --git a/gst/effectv/gstshagadelic.c b/gst/effectv/gstshagadelic.c index b049d0ae..c5f9980d 100644 --- a/gst/effectv/gstshagadelic.c +++ b/gst/effectv/gstshagadelic.c @@ -33,6 +33,10 @@ #include +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + #define GST_TYPE_SHAGADELICTV \ (gst_shagadelictv_get_type()) #define GST_SHAGADELICTV(obj) \ diff --git a/gst/goom/filters.c b/gst/goom/filters.c index e3153aa5..866885be 100644 --- a/gst/goom/filters.c +++ b/gst/goom/filters.c @@ -237,7 +237,8 @@ setPixelRGB_ (Uint * buffer, Uint x, Color c, guint32 resolx, guint32 resoly) { #ifdef _DEBUG if (x >= resolx * resoly) { - printf ("setPixel ERROR : hors du tableau... %i, %i\n", x, y); + printf ("setPixel ERROR : hors du tableau... %i >= %i*%i (%i)\n", x, resolx, + resoly, resolx * resoly); exit (1); } #endif diff --git a/gst/id3demux/id3v2frames.c b/gst/id3demux/id3v2frames.c index 8e1ee048..cf56f8bd 100644 --- a/gst/id3demux/id3v2frames.c +++ b/gst/id3demux/id3v2frames.c @@ -408,7 +408,8 @@ parse_relative_volume_adjustment_two (ID3TagsWorking * work) } peak = peak << (64 - GST_ROUND_UP_8 (peak_bits)); - peak_val = (gdouble) peak / gst_util_guint64_to_gdouble (G_MAXINT64); + peak_val = + gst_guint64_to_gdouble (peak) / gst_util_guint64_to_gdouble (G_MAXINT64); GST_LOG ("RVA2 frame: id=%s, chan=%u, adj=%.2fdB, peak_bits=%u, peak=%.2f", id, chan, gain_dB, (guint) peak_bits, peak_val); diff --git a/gst/level/gstlevel.c b/gst/level/gstlevel.c index 0d37f524..d20a8462 100644 --- a/gst/level/gstlevel.c +++ b/gst/level/gstlevel.c @@ -238,10 +238,11 @@ gst_level_set_property (GObject * object, guint prop_id, filter->message = g_value_get_boolean (value); break; case PROP_SIGNAL_INTERVAL: - filter->interval = g_value_get_uint64 (value); + filter->interval = gst_guint64_to_gdouble (g_value_get_uint64 (value)); break; case PROP_PEAK_TTL: - filter->decay_peak_ttl = g_value_get_uint64 (value); + filter->decay_peak_ttl = + gst_guint64_to_gdouble (g_value_get_uint64 (value)); break; case PROP_PEAK_FALLOFF: filter->decay_peak_falloff = g_value_get_double (value); @@ -321,7 +322,7 @@ gst_level_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out) for (i = 0; i < filter->channels; ++i) { filter->CS[i] = filter->peak[i] = filter->last_peak[i] = filter->decay_peak[i] = filter->decay_peak_base[i] = 0.0; - filter->decay_peak_age[i] = 0LL; + filter->decay_peak_age[i] = 0L; } return TRUE; @@ -476,14 +477,15 @@ gst_level_transform_ip (GstBaseTransform * trans, GstBuffer * in) filter->last_peak[i] = filter->peak[i]; /* make decay peak fall off if too old */ - if (filter->decay_peak_age[i] > filter->decay_peak_ttl) { + if (gst_guint64_to_gdouble (filter->decay_peak_age[i]) > + filter->decay_peak_ttl) { double falloff_dB; double falloff; GstClockTimeDiff falloff_time; double length; /* length of falloff time in seconds */ falloff_time = GST_CLOCK_DIFF (filter->decay_peak_ttl, - filter->decay_peak_age[i]); + gst_guint64_to_gdouble (filter->decay_peak_age[i])); length = (gdouble) falloff_time / GST_SECOND; falloff_dB = filter->decay_peak_falloff * length; falloff = pow (10, falloff_dB / -20.0); @@ -507,7 +509,7 @@ gst_level_transform_ip (GstBaseTransform * trans, GstBuffer * in) GST_LOG_OBJECT (filter, "new peak, %f", filter->peak[i]); filter->decay_peak[i] = filter->peak[i]; filter->decay_peak_base[i] = filter->peak[i]; - filter->decay_peak_age[i] = 0LL; + filter->decay_peak_age[i] = 0L; } } diff --git a/gst/matroska/ebml-read.c b/gst/matroska/ebml-read.c index ce11b906..24f0f3f6 100644 --- a/gst/matroska/ebml-read.c +++ b/gst/matroska/ebml-read.c @@ -507,7 +507,7 @@ gst_ebml_read_sint (GstEbmlRead * ebml, guint32 * id, gint64 * num) /* make signed */ if (negative) { - *num = *num - (1LL << ((8 * size) - 1)); + *num = *num - (1L << ((8 * size) - 1)); } gst_buffer_unref (buf); diff --git a/gst/matroska/matroska-demux.c b/gst/matroska/matroska-demux.c index 68f248a3..d34bac24 100644 --- a/gst/matroska/matroska-demux.c +++ b/gst/matroska/matroska-demux.c @@ -1584,7 +1584,7 @@ gst_matroska_demux_parse_info (GstMatroskaDemux * demux) res = FALSE; break; } - demux->duration = num * demux->time_scale; + demux->duration = num * gst_guint64_to_gdouble (demux->time_scale); break; } @@ -3088,7 +3088,7 @@ gst_matroska_demux_video_caps (GstMatroskaTrackVideoContext * g_value_init (&fps_double, G_TYPE_DOUBLE); g_value_init (&fps_fraction, GST_TYPE_FRACTION); g_value_set_double (&fps_double, - GST_SECOND / context->default_duration); + gst_guint64_to_gdouble (GST_SECOND / context->default_duration)); g_value_transform (&fps_double, &fps_fraction); gst_structure_set_value (structure, "framerate", &fps_fraction); diff --git a/gst/matroska/matroska-mux.c b/gst/matroska/matroska-mux.c index 23774df4..cb56c291 100644 --- a/gst/matroska/matroska-mux.c +++ b/gst/matroska/matroska-mux.c @@ -1066,7 +1066,7 @@ gst_matroska_mux_start (GstMatroskaMux * mux) gst_object_unref (peerpad); } gst_ebml_write_float (ebml, GST_MATROSKA_ID_DURATION, - duration / mux->time_scale); + duration / gst_guint64_to_gdouble (mux->time_scale)); gst_ebml_write_utf8 (ebml, GST_MATROSKA_ID_MUXINGAPP, "GStreamer plugin version " GST_PLUGINS_GOOD_VERSION); if (mux->writing_app && mux->writing_app[0]) { @@ -1232,7 +1232,7 @@ gst_matroska_mux_finish (GstMatroskaMux * mux) pos = mux->ebml_write->pos; gst_ebml_write_seek (ebml, mux->duration_pos); gst_ebml_write_float (ebml, GST_MATROSKA_ID_DURATION, - (gdouble) duration / mux->time_scale); + gst_guint64_to_gdouble (duration / mux->time_scale)); gst_ebml_write_seek (ebml, pos); } diff --git a/gst/smpte/paint.c b/gst/smpte/paint.c index 369e36f0..9b60de37 100644 --- a/gst/smpte/paint.c +++ b/gst/smpte/paint.c @@ -25,6 +25,10 @@ #include #include "paint.h" +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + void gst_smpte_paint_vbox (guint32 * dest, gint stride, gint x0, gint y0, gint c0, gint x1, gint y1, gint c1) diff --git a/gst/videofilter/gstvideobalance.c b/gst/videofilter/gstvideobalance.c index deb3a553..cd8ba432 100644 --- a/gst/videofilter/gstvideobalance.c +++ b/gst/videofilter/gstvideobalance.c @@ -56,6 +56,10 @@ #include #include +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif + static GstElementDetails video_balance_details = GST_ELEMENT_DETAILS ("Video balance", "Filter/Effect/Video", diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index 2fa63f68..27b2964e 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -1178,7 +1178,9 @@ gst_wavparse_stream_data (GstWavParse * wav, gboolean first) /* scale the amount of data by the segment rate so we get equal * amounts of data regardless of the playback rate */ - desired = MIN (wav->dataleft, MAX_BUFFER_SIZE * ABS (wav->segment.rate)); + desired = + MIN (gst_guint64_to_gdouble (wav->dataleft), + MAX_BUFFER_SIZE * ABS (wav->segment.rate)); if (desired >= wav->blockalign && wav->blockalign > 0) desired -= (desired % wav->blockalign); -- cgit