diff --git a/ChangeLog b/ChangeLog index a2e9fa1925..a859ccddd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2006-10-16 Tim-Philipp Müller + + Patch by: Josep Torra Valles + + * ext/cairo/gsttimeoverlay.c: (gst_cairo_time_overlay_transform): + * ext/esd/esdsink.c: (gst_esdsink_write): + * ext/flac/gstflacdec.c: (gst_flac_dec_length), + (gst_flac_dec_read_seekable), (gst_flac_dec_chain), + (gst_flac_dec_send_newsegment): + * ext/flac/gstflacenc.c: (gst_flac_enc_seek_callback), + (gst_flac_enc_tell_callback): + * ext/jpeg/smokecodec.c: (find_best_size), (smokecodec_encode), + (smokecodec_parse_header), (smokecodec_decode): + * gst/avi/gstavimux.c: (gst_avi_mux_write_avix_index): + * gst/debug/efence.c: (gst_fenced_buffer_alloc): + * gst/goom/Makefile.am: + * gst/goom/gstgoom.c: + * gst/icydemux/gsticydemux.c: (gst_icydemux_typefind_or_forward): + * gst/rtsp/gstrtspsrc.c: + * gst/rtsp/rtspconnection.c: (rtsp_connection_read): + * gst/udp/gstudpsink.c: + * gst/udp/gstudpsrc.c: + * gst/wavparse/gstwavparse.c: (gst_wavparse_change_state): + * sys/sunaudio/gstsunaudiomixertrack.h: + Fix a bunch of problems discovered by the Forte compiler, mostly type + mixups and pointer arithmetics with void pointers. Fixes #362603. + 2006-10-12 Tim-Philipp Müller * ext/speex/gstspeex.c: (plugin_init): diff --git a/ext/cairo/gsttimeoverlay.c b/ext/cairo/gsttimeoverlay.c index 404e6f7070..ff6d2fce85 100644 --- a/ext/cairo/gsttimeoverlay.c +++ b/ext/cairo/gsttimeoverlay.c @@ -186,7 +186,7 @@ gst_cairo_time_overlay_transform (GstBaseTransform * trans, GstBuffer * in, int i, j; unsigned char *image; cairo_text_extents_t extents; - gpointer dest, src; + guint8 *dest, *src; cairo_surface_t *font_surface; cairo_t *text_cairo; GstFlowReturn ret = GST_FLOW_OK; diff --git a/ext/esd/esdsink.c b/ext/esd/esdsink.c index 3a868d44b6..7fdfafcaa8 100644 --- a/ext/esd/esdsink.c +++ b/ext/esd/esdsink.c @@ -403,7 +403,7 @@ gst_esdsink_write (GstAudioSink * asink, gpointer data, guint length) goto write_error; to_write -= done; - data += done; + data = (char *) data + done; } return length; diff --git a/ext/flac/gstflacdec.c b/ext/flac/gstflacdec.c index 8a35291017..1cf238ea3c 100644 --- a/ext/flac/gstflacdec.c +++ b/ext/flac/gstflacdec.c @@ -642,11 +642,11 @@ gst_flac_dec_length (const FLAC__SeekableStreamDecoder * decoder, flacdec = GST_FLAC_DEC (client_data); if (!(peer = gst_pad_get_peer (flacdec->sinkpad))) - return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR; + return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR; gst_pad_query_duration (peer, &fmt, &len); gst_object_unref (peer); if (fmt != GST_FORMAT_BYTES || len == -1) - return FLAC__SEEKABLE_STREAM_DECODER_TELL_STATUS_ERROR; + return FLAC__SEEKABLE_STREAM_DECODER_LENGTH_STATUS_ERROR; *length = len; @@ -696,7 +696,7 @@ gst_flac_dec_read_seekable (const FLAC__SeekableStreamDecoder * decoder, if (gst_pad_pull_range (flacdec->sinkpad, flacdec->offset, *bytes, &buf) != GST_FLOW_OK) - return FLAC__SEEKABLE_STREAM_DECODER_READ_ERROR; + return FLAC__SEEKABLE_STREAM_DECODER_READ_STATUS_ERROR; GST_DEBUG ("Read %d bytes at %" G_GUINT64_FORMAT, GST_BUFFER_SIZE (buf), flacdec->offset); @@ -1101,7 +1101,7 @@ gst_flac_dec_sink_event (GstPad * pad, GstEvent * event) static GstFlowReturn gst_flac_dec_chain (GstPad * pad, GstBuffer * buf) { - FLAC__SeekableStreamDecoderState s; + FLAC__StreamDecoderState s; GstFlacDec *dec; gboolean got_audio_frame; @@ -1486,7 +1486,7 @@ gst_flac_dec_send_newsegment (GstFlacDec * flacdec, gboolean update) { GstSegment *s = &flacdec->segment; GstFormat target_format = GST_FORMAT_TIME; - gint64 stop_time = GST_CLOCK_TIME_NONE; + gint64 stop_time = -1; gint64 start_time = 0; /* segment is in DEFAULT format, but we want to send a TIME newsegment */ diff --git a/ext/flac/gstflacenc.c b/ext/flac/gstflacenc.c index b13d771976..90888fb4c8 100644 --- a/ext/flac/gstflacenc.c +++ b/ext/flac/gstflacenc.c @@ -501,7 +501,7 @@ gst_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * encoder, flacenc = GST_FLAC_ENC (client_data); if (flacenc->stopped) - return FLAC__STREAM_ENCODER_OK; + return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK; event = gst_event_new_new_segment (TRUE, 1.0, GST_FORMAT_BYTES, absolute_byte_offset, GST_BUFFER_OFFSET_NONE, 0); @@ -525,7 +525,7 @@ gst_flac_enc_seek_callback (const FLAC__SeekableStreamEncoder * encoder, flacenc->offset = absolute_byte_offset; - return FLAC__STREAM_ENCODER_OK; + return FLAC__SEEKABLE_STREAM_ENCODER_SEEK_STATUS_OK; } static FLAC__StreamEncoderWriteStatus @@ -585,7 +585,7 @@ gst_flac_enc_tell_callback (const FLAC__SeekableStreamEncoder * encoder, *absolute_byte_offset = flacenc->offset; - return FLAC__STREAM_ENCODER_OK; + return FLAC__SEEKABLE_STREAM_ENCODER_TELL_STATUS_OK; } static gboolean diff --git a/ext/jpeg/smokecodec.c b/ext/jpeg/smokecodec.c index 887e5c20b2..7fdda0820f 100644 --- a/ext/jpeg/smokecodec.c +++ b/ext/jpeg/smokecodec.c @@ -36,15 +36,7 @@ #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 { @@ -297,14 +289,14 @@ find_best_size (int blocks, unsigned int *width, unsigned int *height) w = sqchng; h = sqchng; - DEBUG ("guess: %d %d\n", w, h); + GST_DEBUG ("guess: %d %d", w, h); free = w * h - blocks; best = free; bestw = w; while (w < 256) { - DEBUG ("current: %d %d\n", w, h); + GST_DEBUG ("current: %d %d", w, h); if (free < best) { best = free; bestw = w; @@ -468,7 +460,7 @@ smokecodec_encode (SmokeCodecInfo * info, STORE16 (out, IDX_NUM_BLOCKS, blocks); out[IDX_FLAGS] = (flags & 0xff); - DEBUG ("blocks %d, encoding %d\n", blocks, encoding); + GST_DEBUG ("blocks %d, encoding %d", blocks, encoding); info->jdest.next_output_byte = &out[blocks * 2 + OFFS_PICT]; info->jdest.free_in_buffer = (*outsize) - OFFS_PICT; @@ -479,7 +471,7 @@ smokecodec_encode (SmokeCodecInfo * info, if (!(flags & SMOKECODEC_KEYFRAME)) find_best_size (encoding, &blocks_w, &blocks_h); - DEBUG ("best: %d %d\n", blocks_w, blocks_h); + GST_DEBUG ("best: %d %d", blocks_w, blocks_h); info->cinfo.image_width = blocks_w * DCTSIZE * 2; info->cinfo.image_height = blocks_h * DCTSIZE * 2; @@ -492,9 +484,9 @@ smokecodec_encode (SmokeCodecInfo * info, info->minquality) * blocks) / max; } - DEBUG ("set q %d %d %d\n", quality, encoding, max); + GST_DEBUG ("set q %d %d %d", quality, encoding, max); jpeg_set_quality (&info->cinfo, quality, TRUE); - DEBUG ("start\n"); + GST_DEBUG ("start"); jpeg_start_compress (&info->cinfo, TRUE); for (i = 0; i < encoding; i++) { @@ -523,11 +515,11 @@ smokecodec_encode (SmokeCodecInfo * info, put (ip, op, DCTSIZE, DCTSIZE, width / 2, 256 * DCTSIZE); if ((i % blocks_w) == (blocks_w - 1) || (i == encoding - 1)) { - DEBUG ("write %d\n", pos); + GST_DEBUG ("write %d", pos); jpeg_write_raw_data (&info->cinfo, info->line, 2 * DCTSIZE); } } - DEBUG ("finish\n"); + GST_DEBUG ("finish"); jpeg_finish_compress (&info->cinfo); } @@ -535,7 +527,7 @@ smokecodec_encode (SmokeCodecInfo * info, STORE16 (out, IDX_SIZE, size); *outsize = size + blocks * 2 + OFFS_PICT; - DEBUG ("outsize %d\n", *outsize); + GST_DEBUG ("outsize %d", *outsize); // and decode in reference frame again if (info->refdec) { @@ -596,7 +588,7 @@ smokecodec_parse_header (SmokeCodecInfo * info, if (info->width != *width || info->height != *height || info->fps_num != *fps_num || info->fps_denom != *fps_denom) { - DEBUG ("new width: %d %d\n", *width, *height); + GST_DEBUG ("new width: %d %d", *width, *height); info->reference = realloc (info->reference, 3 * ((*width) * (*height)) / 2); info->width = *width; @@ -627,7 +619,7 @@ smokecodec_decode (SmokeCodecInfo * info, &fps_num, &fps_denom); READ16 (in, IDX_NUM_BLOCKS, blocks); - DEBUG ("blocks %d\n", blocks); + GST_DEBUG ("blocks %d", blocks); if (flags & SMOKECODEC_KEYFRAME) decoding = width / (DCTSIZE * 2) * height / (DCTSIZE * 2); @@ -638,9 +630,9 @@ smokecodec_decode (SmokeCodecInfo * info, info->jsrc.next_input_byte = &in[blocks * 2 + OFFS_PICT]; info->jsrc.bytes_in_buffer = insize - (blocks * 2 + OFFS_PICT); - DEBUG ("header %02x %d\n", in[blocks * 2 + OFFS_PICT], insize); + GST_DEBUG ("header %02x %d", in[blocks * 2 + OFFS_PICT], insize); res = jpeg_read_header (&info->dinfo, TRUE); - DEBUG ("header %d %d %d\n", res, info->dinfo.image_width, + GST_DEBUG ("header %d %d %d", res, info->dinfo.image_width, info->dinfo.image_height); blocks_w = info->dinfo.image_width / (2 * DCTSIZE); @@ -649,7 +641,7 @@ smokecodec_decode (SmokeCodecInfo * info, info->dinfo.output_width = info->dinfo.image_width; info->dinfo.output_height = info->dinfo.image_height; - DEBUG ("start\n"); + GST_DEBUG ("start"); info->dinfo.do_fancy_upsampling = FALSE; info->dinfo.do_block_smoothing = FALSE; info->dinfo.out_color_space = JCS_YCbCr; @@ -660,10 +652,10 @@ smokecodec_decode (SmokeCodecInfo * info, blockptr = 0; for (i = 0; i < blocks_h; i++) { - DEBUG ("read\n"); + GST_DEBUG ("read"); jpeg_read_raw_data (&info->dinfo, info->line, 2 * DCTSIZE); - DEBUG ("copy %d\n", blocks_w); + GST_DEBUG ("copy %d", blocks_w); for (j = 0; j < blocks_w; j++) { int pos; int x, y; @@ -676,7 +668,7 @@ smokecodec_decode (SmokeCodecInfo * info, x = pos % (width / (DCTSIZE * 2)); y = pos / (width / (DCTSIZE * 2)); - DEBUG ("block %d %d %d\n", pos, x, y); + GST_DEBUG ("block %d %d %d", pos, x, y); ip = info->compbuf[0] + j * (DCTSIZE * 2); op = info->reference + (x * (DCTSIZE * 2)) + @@ -693,20 +685,20 @@ smokecodec_decode (SmokeCodecInfo * info, (y * DCTSIZE * width / 2); put (ip, op, DCTSIZE, DCTSIZE, 256 * DCTSIZE, width / 2); - DEBUG ("block done %d %d %d\n", pos, x, y); + GST_DEBUG ("block done %d %d %d", pos, x, y); blockptr++; if (blockptr >= decoding) break; } } - DEBUG ("finish\n"); + GST_DEBUG ("finish"); jpeg_finish_decompress (&info->dinfo); } - DEBUG ("copy\n"); + GST_DEBUG ("copy"); if (out != info->reference) memcpy (out, info->reference, 3 * (width * height) / 2); - DEBUG ("copy done\n"); + GST_DEBUG ("copy done"); return SMOKECODEC_OK; } diff --git a/gst/avi/gstavimux.c b/gst/avi/gstavimux.c index 1f1eb2765d..57c8ffbfe3 100644 --- a/gst/avi/gstavimux.c +++ b/gst/avi/gstavimux.c @@ -1109,7 +1109,7 @@ gst_avi_mux_write_avix_index (GstAviMux * avimux, guchar * code, /* msb is set if not (!) keyframe */ GST_WRITE_UINT32_LE (buffdata + 4, GUINT32_FROM_LE (entry->size) | (GUINT32_FROM_LE (entry->flags) - & GST_RIFF_IF_KEYFRAME ? 0 : 1 << 31)); + & GST_RIFF_IF_KEYFRAME ? 0 : 1U << 31)); buffdata += 8; } i--; diff --git a/gst/debug/efence.c b/gst/debug/efence.c index 94eed9eb1c..d77afbb0b6 100644 --- a/gst/debug/efence.c +++ b/gst/debug/efence.c @@ -473,7 +473,7 @@ gst_fenced_buffer_alloc (GstBuffer * buffer, unsigned int length, fenced_buffer->length = alloc_size - page_size; #else mprotect (region, page_size, PROT_NONE); - mprotect (region + alloc_size - page_size, page_size, PROT_NONE); + mprotect ((char *) region + alloc_size - page_size, page_size, PROT_NONE); fenced_buffer->region = region; fenced_buffer->length = alloc_size; @@ -487,9 +487,9 @@ gst_fenced_buffer_alloc (GstBuffer * buffer, unsigned int length, /* Align to top of region, but force alignment to 4 bytes */ offset = alloc_size - page_size - length; offset &= ~0x3; - return region + offset; + return (void *) ((char *) region + offset); } else { - return region + page_size; + return (void *) ((char *) region + page_size); } } diff --git a/gst/goom/Makefile.am b/gst/goom/Makefile.am index c265a84fd3..ce0891fe2c 100644 --- a/gst/goom/Makefile.am +++ b/gst/goom/Makefile.am @@ -7,7 +7,7 @@ noinst_HEADERS = gstgoom.h filters.h goom_core.h goom_tools.h graphic.h lines.h libgstgoom_la_SOURCES = gstgoom.c goom_core.c $(GOOM_FILTER_FILES) graphic.c lines.c -libgstgoom_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GOOM_FILTER_CFLAGS) +libgstgoom_la_CFLAGS = $(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(GOOM_FILTER_CFLAGS) libgstgoom_la_LIBADD = $(GST_BASE_LIBS) $(GST_LIBS) libgstgoom_la_LDFLAGS = $(GST_PLUGIN_LDFLAGS) diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c index 2633431691..19b38c9172 100644 --- a/gst/goom/gstgoom.c +++ b/gst/goom/gstgoom.c @@ -95,8 +95,8 @@ static GstFlowReturn gst_goom_chain (GstPad * pad, GstBuffer * buffer); static gboolean gst_goom_src_event (GstPad * pad, GstEvent * event); static gboolean gst_goom_sink_event (GstPad * pad, GstEvent * event); -static GstPadLinkReturn gst_goom_sink_setcaps (GstPad * pad, GstCaps * caps); -static GstPadLinkReturn gst_goom_src_setcaps (GstPad * pad, GstCaps * caps); +static gboolean gst_goom_sink_setcaps (GstPad * pad, GstCaps * caps); +static gboolean gst_goom_src_setcaps (GstPad * pad, GstCaps * caps); static GstElementClass *parent_class = NULL; diff --git a/gst/icydemux/gsticydemux.c b/gst/icydemux/gsticydemux.c index dd77566551..fd7e1a1504 100644 --- a/gst/icydemux/gsticydemux.c +++ b/gst/icydemux/gsticydemux.c @@ -429,7 +429,7 @@ gst_icydemux_typefind_or_forward (GstICYDemux * icydemux, GstBuffer * buf) if (icydemux->typefinding) { GstBuffer *tf_buf; GstCaps *caps; - guint prob; + GstTypeFindProbability prob; if (icydemux->typefind_buf) { icydemux->typefind_buf = gst_buffer_join (icydemux->typefind_buf, buf); diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index 479175354b..e698f6addc 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -2222,7 +2222,7 @@ open_failed: /*** GSTURIHANDLER INTERFACE *************************************************/ -static guint +static GstURIType gst_rtspsrc_uri_get_type (void) { return GST_URI_SRC; diff --git a/gst/rtsp/rtspconnection.c b/gst/rtsp/rtspconnection.c index 27cc3ebb76..9466db7ccf 100644 --- a/gst/rtsp/rtspconnection.c +++ b/gst/rtsp/rtspconnection.c @@ -40,6 +40,10 @@ * SOFTWARE. */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include @@ -60,6 +64,10 @@ #include #endif +#ifdef HAVE_FIONREAD_IN_SYS_FILIO +#include +#endif + #include "rtspconnection.h" /* the select call is also performed on the control sockets, that way @@ -542,7 +550,7 @@ rtsp_connection_read (RTSPConnection * conn, gpointer data, guint size) goto read_error; } else { toread -= bytes; - data += bytes; + data = (char *) data + bytes; } } return RTSP_OK; diff --git a/gst/udp/gstudpsink.c b/gst/udp/gstudpsink.c index 382e9195b2..f647e60c84 100644 --- a/gst/udp/gstudpsink.c +++ b/gst/udp/gstudpsink.c @@ -200,7 +200,7 @@ gst_udpsink_get_property (GObject * object, guint prop_id, GValue * value, /*** GSTURIHANDLER INTERFACE *************************************************/ -static guint +static GstURIType gst_udpsink_uri_get_type (void) { return GST_URI_SINK; diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c index 73a0151c1f..23e2721e2e 100644 --- a/gst/udp/gstudpsrc.c +++ b/gst/udp/gstudpsrc.c @@ -838,7 +838,7 @@ gst_udpsrc_stop (GstBaseSrc * bsrc) /*** GSTURIHANDLER INTERFACE *************************************************/ -static guint +static GstURIType gst_udpsrc_uri_get_type (void) { return GST_URI_SRC; diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index 7ac9bc54f5..4f61437ea6 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -1964,10 +1964,6 @@ gst_wavparse_change_state (GstElement * element, GstStateChange transition) GstStateChangeReturn ret; GstWavParse *wav = GST_WAVPARSE (element); - GST_DEBUG_OBJECT (wav, "changing state %s - %s", - gst_element_state_get_name (GST_STATE_TRANSITION_CURRENT (transition)), - gst_element_state_get_name (GST_STATE_TRANSITION_NEXT (transition))); - switch (transition) { case GST_STATE_CHANGE_NULL_TO_READY: break; diff --git a/sys/sunaudio/gstsunaudiomixertrack.h b/sys/sunaudio/gstsunaudiomixertrack.h index 42b0fa5d3d..fdf494d936 100644 --- a/sys/sunaudio/gstsunaudiomixertrack.h +++ b/sys/sunaudio/gstsunaudiomixertrack.h @@ -62,7 +62,7 @@ typedef struct _GstSunAudioMixerTrackClass { } GstSunAudioMixerTrackClass; GType gst_sunaudiomixer_track_get_type (void); -GstMixerTrack* gst_sunaudiomixer_track_new (gint track_num, gint max_chans, gint flags); +GstMixerTrack* gst_sunaudiomixer_track_new (GstSunAudioTrackType track_num, gint max_chans, gint flags); G_END_DECLS