2 * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Library General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
25 static GMutex *mutex = NULL;
26 static GCond *cond = NULL;
29 gst_mutex_new_dummy_impl (void)
37 static void gst_mutex_dummy_impl (GMutex *mutex) { /* NOP */ }
40 gst_mutex_trylock_dummy_impl (GMutex *mutex)
46 gst_cond_new_dummy_impl (void)
55 gst_cond_dummy_impl (GCond *cond) { /* NOP */ }
58 gst_cond_timed_wait_dummy_impl (GCond *cond, GMutex *mutex, GTimeVal *end_time)
60 struct timeval tvtarget;
65 target = end_time->tv_sec * 1000000 + end_time->tv_usec;
67 g_get_current_time (&tvnow);
68 now = tvnow.tv_sec * 1000000 + tvnow.tv_usec;
72 tvtarget.tv_usec = diff % 1000000;
73 tvtarget.tv_sec = diff / 1000000;
75 select(0, NULL, NULL, NULL, &tvtarget);
82 gst_private_new_dummy_impl (GDestroyNotify destructor)
86 data = g_new0 (gpointer, 1);
88 return (GPrivate *) data;
92 gst_private_get_dummy_impl (GPrivate *private_key)
94 gpointer *data = (gpointer) private_key;
100 gst_private_set_dummy_impl (GPrivate *private_key, gpointer data)
102 *((gpointer*)private_key) = data;
106 gst_thread_create_dummy_impl (GThreadFunc func, gpointer data, gulong stack_size,
107 gboolean joinable, gboolean bound, GThreadPriority priority,
108 gpointer thread, GError **error)
110 g_warning ("GStreamer configured to not use threads");
114 gst_thread_dummy_impl (void) { /* NOP */ }
117 gst_thread_dummy_impl_1 (gpointer thread) { /* NOP */ }
120 gst_thread_set_priority_dummy_impl (gpointer thread, GThreadPriority priority) { /* NOP */ }
123 gst_thread_equal_dummy_impl (gpointer thread1, gpointer thread2)
125 return (thread1 == thread2);
129 gst_thread_dummy_functions =
131 gst_mutex_new_dummy_impl,
132 (void (*)(GMutex *)) gst_mutex_dummy_impl,
133 gst_mutex_trylock_dummy_impl,
134 (void (*)(GMutex *)) gst_mutex_dummy_impl,
135 gst_mutex_dummy_impl,
136 gst_cond_new_dummy_impl,
137 (void (*)(GCond *)) gst_cond_dummy_impl,
138 (void (*)(GCond *)) gst_cond_dummy_impl,
139 (void (*)(GCond *, GMutex *)) gst_cond_dummy_impl,
140 gst_cond_timed_wait_dummy_impl,
142 gst_private_new_dummy_impl,
143 gst_private_get_dummy_impl,
144 gst_private_set_dummy_impl,
145 gst_thread_create_dummy_impl,
146 gst_thread_dummy_impl,
147 gst_thread_dummy_impl_1,
148 gst_thread_dummy_impl,
149 gst_thread_set_priority_dummy_impl,
150 gst_thread_dummy_impl_1,
151 gst_thread_equal_dummy_impl