coreelements: Use G_OS_WIN32 macro
authorHiero32 <unnoh@tkd.att.ne.jp>
Mon, 19 Dec 2022 18:51:45 +0000 (03:51 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Wed, 21 Dec 2022 06:34:15 +0000 (06:34 +0000)
* HAVE_WIN32 is not defined elsewhere
* Enables fdsrc/fdsink for MinGW build as well

Co-authored-by: Seungha Yang <seungha@centricular.com>
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3070>

subprojects/gstreamer/plugins/elements/gstcoreelementselements.h
subprojects/gstreamer/plugins/elements/gstcoreelementsplugin.c
subprojects/gstreamer/plugins/elements/gstelements_private.c
subprojects/gstreamer/plugins/elements/gstfdsink.c
subprojects/gstreamer/plugins/elements/gstfdsrc.c

index fa930aa..5c543bb 100644 (file)
@@ -31,7 +31,7 @@ GST_ELEMENT_REGISTER_DECLARE (dataurisrc);
 GST_ELEMENT_REGISTER_DECLARE (downloadbuffer);
 GST_ELEMENT_REGISTER_DECLARE (fakesink);
 GST_ELEMENT_REGISTER_DECLARE (fakesrc);
-#if defined(HAVE_SYS_SOCKET_H) || defined(_MSC_VER)
+#if defined(HAVE_SYS_SOCKET_H) || defined(G_OS_WIN32)
 GST_ELEMENT_REGISTER_DECLARE (fdsrc);
 GST_ELEMENT_REGISTER_DECLARE (fdsink);
 #endif
index 82ea0d5..1ee3e4c 100644 (file)
@@ -46,7 +46,7 @@ plugin_init (GstPlugin * plugin)
   ret |= GST_ELEMENT_REGISTER (downloadbuffer, plugin);
   ret |= GST_ELEMENT_REGISTER (fakesrc, plugin);
   ret |= GST_ELEMENT_REGISTER (fakesink, plugin);
-#if defined(HAVE_SYS_SOCKET_H) || defined(_MSC_VER)
+#if defined(HAVE_SYS_SOCKET_H) || defined(G_OS_WIN32)
   ret |= GST_ELEMENT_REGISTER (fdsrc, plugin);
   ret |= GST_ELEMENT_REGISTER (fdsink, plugin);
 #endif
index 75cdcfd..ea50373 100644 (file)
@@ -234,7 +234,7 @@ gst_writev_iovecs (GstObject * sink, gint fd, GstPoll * fdset,
         flow_ret = GST_FLOW_FLUSHING;
         goto out;
       }
-#ifndef HAVE_WIN32
+#ifndef G_OS_WIN32
       if (fdset != NULL) {
         do {
           GST_DEBUG_OBJECT (sink, "going into select, have %" G_GSSIZE_FORMAT
@@ -298,7 +298,7 @@ gst_writev_iovecs (GstObject * sink, gint fd, GstPoll * fdset,
       } else {
         goto write_error;
       }
-#ifdef HAVE_WIN32
+#ifdef G_OS_WIN32
       /* do short sleep on windows where we don't use gst_poll(),
        * to avoid excessive busy looping */
       if (fdset != NULL)
@@ -315,7 +315,7 @@ out:
   return flow_ret;
 
 /* ERRORS */
-#ifndef HAVE_WIN32
+#ifndef G_OS_WIN32
 select_error:
   {
     GST_ELEMENT_ERROR (sink, RESOURCE, READ, (NULL),
index df7b612..bc6f502 100644 (file)
@@ -111,7 +111,7 @@ static void gst_fd_sink_uri_handler_init (gpointer g_iface,
   GST_DEBUG_CATEGORY_INIT (gst_fd_sink__debug, "fdsink", 0, "fdsink element");
 #define gst_fd_sink_parent_class parent_class
 G_DEFINE_TYPE_WITH_CODE (GstFdSink, gst_fd_sink, GST_TYPE_BASE_SINK, _do_init);
-#if defined(HAVE_SYS_SOCKET_H) || defined(_MSC_VER)
+#if defined(HAVE_SYS_SOCKET_H) || defined(G_OS_WIN32)
 GST_ELEMENT_REGISTER_DEFINE (fdsink, "fdsink", GST_RANK_NONE, GST_TYPE_FD_SINK);
 #endif
 
index f88d38e..bf8c4de 100644 (file)
@@ -120,7 +120,7 @@ static void gst_fd_src_uri_handler_init (gpointer g_iface, gpointer iface_data);
   GST_DEBUG_CATEGORY_INIT (gst_fd_src_debug, "fdsrc", 0, "fdsrc element");
 #define gst_fd_src_parent_class parent_class
 G_DEFINE_TYPE_WITH_CODE (GstFdSrc, gst_fd_src, GST_TYPE_PUSH_SRC, _do_init);
-#if defined(HAVE_SYS_SOCKET_H) || defined(_MSC_VER)
+#if defined(HAVE_SYS_SOCKET_H) || defined(G_OS_WIN32)
 GST_ELEMENT_REGISTER_DEFINE (fdsrc, "fdsrc", GST_RANK_NONE, GST_TYPE_FD_SRC);
 #endif
 
@@ -396,7 +396,7 @@ gst_fd_src_create (GstPushSrc * psrc, GstBuffer ** outbuf)
   guint blocksize;
   GstMapInfo info;
 
-#ifndef HAVE_WIN32
+#ifndef G_OS_WIN32
   GstClockTime timeout;
   gboolean try_again;
   gint retval;
@@ -404,7 +404,7 @@ gst_fd_src_create (GstPushSrc * psrc, GstBuffer ** outbuf)
 
   src = GST_FD_SRC (psrc);
 
-#ifndef HAVE_WIN32
+#ifndef G_OS_WIN32
   if (src->timeout > 0) {
     timeout = src->timeout * GST_USECOND;
   } else {
@@ -476,7 +476,7 @@ gst_fd_src_create (GstPushSrc * psrc, GstBuffer ** outbuf)
   return GST_FLOW_OK;
 
   /* ERRORS */
-#ifndef HAVE_WIN32
+#ifndef G_OS_WIN32
 poll_error:
   {
     GST_ELEMENT_ERROR (src, RESOURCE, READ, (NULL),