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)
38 gst_mutex_dummy_impl (GMutex * mutex)
43 gst_mutex_trylock_dummy_impl (GMutex * mutex)
49 gst_cond_new_dummy_impl (void)
58 gst_cond_dummy_impl (GCond * cond)
63 gst_cond_timed_wait_dummy_impl (GCond * cond, GMutex * mutex,
66 struct timeval tvtarget;
71 target = end_time->tv_sec * 1000000 + end_time->tv_usec;
73 g_get_current_time (&tvnow);
74 now = tvnow.tv_sec * 1000000 + tvnow.tv_usec;
78 tvtarget.tv_usec = diff % 1000000;
79 tvtarget.tv_sec = diff / 1000000;
81 select (0, NULL, NULL, NULL, &tvtarget);
88 gst_private_new_dummy_impl (GDestroyNotify destructor)
92 data = g_new0 (gpointer, 1);
94 return (GPrivate *) data;
98 gst_private_get_dummy_impl (GPrivate * private_key)
100 gpointer *data = (gpointer) private_key;
106 gst_private_set_dummy_impl (GPrivate * private_key, gpointer data)
108 *((gpointer *) private_key) = data;
112 gst_thread_create_dummy_impl (GThreadFunc func, gpointer data,
113 gulong stack_size, gboolean joinable, gboolean bound,
114 GThreadPriority priority, gpointer thread, GError ** error)
116 g_warning ("GStreamer configured to not use threads");
120 gst_thread_dummy_impl (void)
125 gst_thread_dummy_impl_1 (gpointer thread)
130 gst_thread_set_priority_dummy_impl (gpointer thread, GThreadPriority priority)
135 gst_thread_equal_dummy_impl (gpointer thread1, gpointer thread2)
137 return (thread1 == thread2);
140 GThreadFunctions gst_thread_dummy_functions = {
141 gst_mutex_new_dummy_impl,
142 (void (*)(GMutex *)) gst_mutex_dummy_impl,
143 gst_mutex_trylock_dummy_impl,
144 (void (*)(GMutex *)) gst_mutex_dummy_impl,
145 gst_mutex_dummy_impl,
146 gst_cond_new_dummy_impl,
147 (void (*)(GCond *)) gst_cond_dummy_impl,
148 (void (*)(GCond *)) gst_cond_dummy_impl,
149 (void (*)(GCond *, GMutex *)) gst_cond_dummy_impl,
150 gst_cond_timed_wait_dummy_impl,
152 gst_private_new_dummy_impl,
153 gst_private_get_dummy_impl,
154 gst_private_set_dummy_impl,
155 gst_thread_create_dummy_impl,
156 gst_thread_dummy_impl,
157 gst_thread_dummy_impl_1,
158 gst_thread_dummy_impl,
159 gst_thread_set_priority_dummy_impl,
160 gst_thread_dummy_impl_1, gst_thread_equal_dummy_impl};