diff options
author | Andoni Morales <ylatuya@gmail.com> | 2009-02-22 18:41:08 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian.droege@collabora.co.uk> | 2009-02-22 18:41:08 +0100 |
commit | 7992233522f6fe60c54cbdaa7f7e8ea9ce9fb398 (patch) | |
tree | 6cc4bb40c0f99b6b0aa46433222054e0c5d2e4b2 | |
parent | 5bdb5c4de142e2fe2ec920faea07a6f8d270a8bc (diff) | |
download | gstreamer-plugins-bad-7992233522f6fe60c54cbdaa7f7e8ea9ce9fb398.tar.gz |
camerabin: Fix compilation on Windows with Visual Studio
Windows doesn't have strcasecmp so we should use
g_ascii_strcasecmp here instead.
Also Windows doesn't have sys/time.h so we first
need to check if it actually exists and if not
we should not include it.
Fixes bug #572315.
-rw-r--r-- | configure.ac | 3 | ||||
-rw-r--r-- | gst/camerabin/camerabingeneral.h | 2 | ||||
-rw-r--r-- | gst/camerabin/gstcamerabin.c | 8 |
3 files changed, 9 insertions, 4 deletions
diff --git a/configure.ac b/configure.ac index 34db3428e..4e07af9cb 100644 --- a/configure.ac +++ b/configure.ac @@ -133,6 +133,9 @@ if test "x$HAVE_UNISTD_H" != "xyes"; then GST_PLUGINS_SELECTED=`echo $GST_PLUGINS_SELECTED | $SED -e s/festival//` fi +dnl used by camerabin +AC_CHECK_HEADERS([sys/time.h]) + dnl used by ext/dts AX_CREATE_STDINT_H diff --git a/gst/camerabin/camerabingeneral.h b/gst/camerabin/camerabingeneral.h index e05bb1f25..a84ab64b8 100644 --- a/gst/camerabin/camerabingeneral.h +++ b/gst/camerabin/camerabingeneral.h @@ -21,7 +21,9 @@ #ifndef __CAMERABIN_GENERAL_H_ #define __CAMERABIN_GENERAL_H_ +#ifdef HAVE_SYS_TIME_H #include <sys/time.h> +#endif #include <time.h> #include <gst/gst.h> diff --git a/gst/camerabin/gstcamerabin.c b/gst/camerabin/gstcamerabin.c index 6a7bbb061..c54a909b3 100644 --- a/gst/camerabin/gstcamerabin.c +++ b/gst/camerabin/gstcamerabin.c @@ -1165,7 +1165,7 @@ gst_camerabin_get_internal_tags (GstCameraBin * camera) mid_value = min_value + ((max_value - min_value) / 2); cur_value = gst_color_balance_get_value (balance, channel); - if (!strcasecmp (channel->label, "brightness")) { + if (!g_ascii_strcasecmp (channel->label, "brightness")) { /* The value of brightness. The unit is the APEX value (Additive System of Photographic Exposure). * Ordinarily it is given in the range of -99.99 to 99.99. Note that * if the numerator of the recorded value is 0xFFFFFFFF, Unknown shall be indicated. @@ -1178,20 +1178,20 @@ gst_camerabin_get_internal_tags (GstCameraBin * camera) */ gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, "capture-brightness", cur_value, 1, NULL); - } else if (!strcasecmp (channel->label, "contrast")) { + } else if (!g_ascii_strcasecmp (channel->label, "contrast")) { /* 0 = Normal, 1 = Soft, 2 = Hard */ gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, "capture-contrast", (cur_value == mid_value) ? 0 : ((cur_value < mid_value) ? 1 : 2), NULL); - } else if (!strcasecmp (channel->label, "gain")) { + } else if (!g_ascii_strcasecmp (channel->label, "gain")) { /* 0 = Normal, 1 = Low Up, 2 = High Up, 3 = Low Down, 4 = Hight Down */ gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, "capture-gain", (guint) (cur_value == mid_value) ? 0 : ((cur_value < mid_value) ? 1 : 3), NULL); - } else if (!strcasecmp (channel->label, "saturation")) { + } else if (!g_ascii_strcasecmp (channel->label, "saturation")) { /* 0 = Normal, 1 = Low, 2 = High */ gst_tag_list_add (list, GST_TAG_MERGE_REPLACE, "capture-saturation", |