From 05a205860dae7478153d436af3fe485df078f53d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Andr=C3=A9=20Vadla=20Ravn=C3=A5s?= Date: Thu, 1 Nov 2007 12:51:57 +0000 Subject: [PATCH] gst-libs/gst/audio/gstringbuffer.c: Return NULL instead of an enum that happens to be 0, fixes warning on MSVC (#4921... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message from CVS: Patch by: Ole André Vadla Ravnås * gst-libs/gst/audio/gstringbuffer.c: (build_linear_format), (gst_ring_buffer_parse_caps): Return NULL instead of an enum that happens to be 0, fixes warning on MSVC (#492114). * gst-libs/gst/audio/gstringbuffer.h: No trailing commas in enum list (for gcc-2.9x). * gst/videotestsrc/videotestsrc.c: (random_char): Make information loss explicit instead of implicitly truncating to eight bits via the return value. Fixes runtime error on MSVC when using the debug CRT (#492114). * win32/common/config.h.in: Fix a bunch of '#undef FOO bar', which MSVC doesn't like (#492114). * win32/common/libgstinterfaces.def: * win32/common/libgstrtp.def: Export a few more symbols (#492114). --- ChangeLog | 24 +++++++++++++++++ gst-libs/gst/audio/gstringbuffer.c | 7 +++-- gst-libs/gst/audio/gstringbuffer.h | 11 +++----- gst/videotestsrc/videotestsrc.c | 2 +- win32/common/config.h.in | 14 +++++----- win32/common/libgstinterfaces.def | 1 + win32/common/libgstrtp.def | 43 +++++++++++++++++++++--------- 7 files changed, 74 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index c7674d25de..bbbcc10d88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2007-11-01 Tim-Philipp Müller + + Patch by: Ole André Vadla Ravnås + + * gst-libs/gst/audio/gstringbuffer.c: (build_linear_format), + (gst_ring_buffer_parse_caps): + Return NULL instead of an enum that happens to be 0, fixes warning + on MSVC (#492114). + + * gst-libs/gst/audio/gstringbuffer.h: + No trailing commas in enum list (for gcc-2.9x). + + * gst/videotestsrc/videotestsrc.c: (random_char): + Make information loss explicit instead of implicitly truncating to + eight bits via the return value. Fixes runtime error on MSVC when + using the debug CRT (#492114). + + * win32/common/config.h.in: + Fix a bunch of '#undef FOO bar', which MSVC doesn't like (#492114). + + * win32/common/libgstinterfaces.def: + * win32/common/libgstrtp.def: + Export a few more symbols (#492114). + 2007-11-01 Stefan Kost * gst-libs/gst/audio/audio.c: diff --git a/gst-libs/gst/audio/gstringbuffer.c b/gst-libs/gst/audio/gstringbuffer.c index 8cc6591b4c..fc3c13cf0b 100644 --- a/gst-libs/gst/audio/gstringbuffer.c +++ b/gst-libs/gst/audio/gstringbuffer.c @@ -189,7 +189,7 @@ build_linear_format (int depth, int width, int unsignd, int big_endian) formats = &linear24_defs[8]; break; default: - return GST_UNKNOWN; + return NULL; } } else { switch (depth) { @@ -206,7 +206,7 @@ build_linear_format (int depth, int width, int unsignd, int big_endian) formats = &linear_defs[12]; break; default: - return GST_UNKNOWN; + return NULL; } } if (unsignd) @@ -317,6 +317,9 @@ gst_ring_buffer_parse_caps (GstRingBufferSpec * spec, GstCaps * caps) def = build_linear_format (spec->depth, spec->width, spec->sign ? 0 : 1, spec->bigend ? 1 : 0); + if (def == NULL) + goto parse_error; + spec->format = def->format; bytes = spec->width >> 3; diff --git a/gst-libs/gst/audio/gstringbuffer.h b/gst-libs/gst/audio/gstringbuffer.h index 3ead78fd13..6729cdb784 100644 --- a/gst-libs/gst/audio/gstringbuffer.h +++ b/gst-libs/gst/audio/gstringbuffer.h @@ -62,7 +62,7 @@ typedef void (*GstRingBufferCallback) (GstRingBuffer *rbuf, guint8* data, guint typedef enum { GST_RING_BUFFER_STATE_STOPPED, GST_RING_BUFFER_STATE_PAUSED, - GST_RING_BUFFER_STATE_STARTED, + GST_RING_BUFFER_STATE_STARTED } GstRingBufferState; /** @@ -78,7 +78,7 @@ typedef enum { GST_SEGSTATE_INVALID, GST_SEGSTATE_EMPTY, GST_SEGSTATE_FILLED, - GST_SEGSTATE_PARTIAL, + GST_SEGSTATE_PARTIAL } GstRingBufferSegState; /** @@ -101,7 +101,7 @@ typedef enum GST_BUFTYPE_A_LAW, GST_BUFTYPE_IMA_ADPCM, GST_BUFTYPE_MPEG, - GST_BUFTYPE_GSM, + GST_BUFTYPE_GSM } GstBufferFormatType; typedef enum @@ -149,10 +149,7 @@ typedef enum GST_A_LAW, GST_IMA_ADPCM, GST_MPEG, - GST_GSM, - - /* fill me */ - + GST_GSM } GstBufferFormat; /** diff --git a/gst/videotestsrc/videotestsrc.c b/gst/videotestsrc/videotestsrc.c index 4a9f33ceaa..bf70a8b267 100644 --- a/gst/videotestsrc/videotestsrc.c +++ b/gst/videotestsrc/videotestsrc.c @@ -43,7 +43,7 @@ random_char (void) state *= 1103515245; state += 12345; - return (state >> 16); + return (state >> 16) & 0xff; } #if 0 diff --git a/win32/common/config.h.in b/win32/common/config.h.in index de32ea36dc..47e67c5fd6 100644 --- a/win32/common/config.h.in +++ b/win32/common/config.h.in @@ -169,10 +169,10 @@ #undef HAVE_SYS_SOCKET_H /* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H 1 +#undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H 1 +#undef HAVE_SYS_TYPES_H /* support for features: theoradec theoraenc */ #undef HAVE_THEORA @@ -208,16 +208,16 @@ #define PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@" /* Define to the full name of this package. */ -#undef PACKAGE_NAME "@PACKAGE_NAME@" +#define PACKAGE_NAME "@PACKAGE_NAME@" /* Define to the full name and version of this package. */ -#undef PACKAGE_STRING "@PACKAGE_STRING@" +#define PACKAGE_STRING "@PACKAGE_STRING@" /* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME "@PACKAGE_TARNAME@" +#define PACKAGE_TARNAME "@PACKAGE_TARNAME@" /* Define to the version of this package. */ -#undef PACKAGE_VERSION "@PACKAGE_VERSION@" +#define PACKAGE_VERSION "@PACKAGE_VERSION@" /* directory where plugins are located */ #undef PLUGINDIR @@ -256,4 +256,6 @@ #undef inline #endif +/* FIXME: this should probably be hard-coded to some win32 system path */ #define GST_INSTALL_PLUGINS_HELPER "@GST_INSTALL_PLUGINS_HELPER@" + diff --git a/win32/common/libgstinterfaces.def b/win32/common/libgstinterfaces.def index d27c9ff408..4dc783e437 100644 --- a/win32/common/libgstinterfaces.def +++ b/win32/common/libgstinterfaces.def @@ -30,6 +30,7 @@ EXPORTS gst_property_probe_get_property gst_property_probe_get_type gst_property_probe_get_values_name + gst_property_probe_probe_and_get_values gst_property_probe_needs_probe_name gst_property_probe_probe_property_name gst_tuner_channel_changed diff --git a/win32/common/libgstrtp.def b/win32/common/libgstrtp.def index ddb9c70745..e235b84ee8 100644 --- a/win32/common/libgstrtp.def +++ b/win32/common/libgstrtp.def @@ -12,21 +12,40 @@ EXPORTS gst_base_rtp_depayload_get_type gst_base_rtp_depayload_push gst_base_rtp_depayload_push_ts + gst_rtp_buffer_allocate_data + gst_rtp_buffer_new_take_data + gst_rtp_buffer_new_copy_data + gst_rtp_buffer_new_allocate + gst_rtp_buffer_new_allocate_len gst_rtp_buffer_calc_header_len gst_rtp_buffer_calc_packet_len gst_rtp_buffer_calc_payload_len - gst_rtp_buffer_get_marker - gst_rtp_buffer_get_payload - gst_rtp_buffer_get_payload_buffer - gst_rtp_buffer_get_payload_len - gst_rtp_buffer_get_payload_subbuffer - gst_rtp_buffer_get_payload_type - gst_rtp_buffer_get_seq + gst_rtp_buffer_validate_data + gst_rtp_buffer_validate + gst_rtp_buffer_set_packet_len + gst_rtp_buffer_get_packet_len + gst_rtp_buffer_get_version + gst_rtp_buffer_set_version + gst_rtp_buffer_get_padding + gst_rtp_buffer_set_padding + gst_rtp_buffer_pad_to + gst_rtp_buffer_get_extension + gst_rtp_buffer_set_extension gst_rtp_buffer_get_ssrc - gst_rtp_buffer_get_timestamp - gst_rtp_buffer_new_allocate - gst_rtp_buffer_new_allocate_len - gst_rtp_buffer_new_take_data + gst_rtp_buffer_set_ssrc + gst_rtp_buffer_get_csrc_count + gst_rtp_buffer_get_csrc + gst_rtp_buffer_set_csrc + gst_rtp_buffer_get_marker gst_rtp_buffer_set_marker + gst_rtp_buffer_get_payload_type gst_rtp_buffer_set_payload_type - gst_rtp_buffer_validate + gst_rtp_buffer_get_seq + gst_rtp_buffer_set_seq + gst_rtp_buffer_get_timestamp + gst_rtp_buffer_set_timestamp + gst_rtp_buffer_get_payload_buffer + gst_rtp_buffer_get_payload_subbuffer + gst_rtp_buffer_get_payload_len + gst_rtp_buffer_get_payload + gst_rtp_buffer_default_clock_rate \ No newline at end of file