mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-30 05:31:15 +00:00
coreelements: Use G_OS_WIN32 macro
* 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>
This commit is contained in:
parent
14062c06a6
commit
a29a1b21c3
5 changed files with 10 additions and 10 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue