[Pkg-gstreamer-commits] [gstreamer-vaapi] 81/176: tests: simple-decoder: don't use deprecated g_thread_create().
Vincent Cheng
vcheng at moszumanska.debian.org
Tue Jun 3 08:09:29 UTC 2014
This is an automated email from the git hooks/post-receive script.
vcheng pushed a commit to branch upstream
in repository gstreamer-vaapi.
commit dd2ca582a150edd5c9c95a6ddde8960a204bfabe
Author: Gwenole Beauchesne <gwenole.beauchesne at intel.com>
Date: Thu Jan 2 11:35:30 2014 +0100
tests: simple-decoder: don't use deprecated g_thread_create().
Use g_thread_try_new() instead of the deprecated g_thread_create()
function. Provide compatibility glue for any GLib version < 2.31.2.
---
gst-libs/gst/vaapi/glibcompat.h | 11 +++++++++++
tests/simple-decoder.c | 6 ++++--
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/gst-libs/gst/vaapi/glibcompat.h b/gst-libs/gst/vaapi/glibcompat.h
index 66ee910..34e4791 100644
--- a/gst-libs/gst/vaapi/glibcompat.h
+++ b/gst-libs/gst/vaapi/glibcompat.h
@@ -134,6 +134,17 @@ g_cond_wait_until(GCompatCond *cond, GStaticMutex *mutex, gint64 end_time)
#define g_cond_signal(cond) g_compat_cond_signal(cond)
#undef g_cond_wait
#define g_cond_wait(cond, mutex) g_compat_cond_wait(cond, mutex)
+
+#undef g_thread_try_new
+#define g_thread_try_new(name, func, data, error) \
+ g_compat_thread_try_new(name, func, data, error)
+
+static inline GThread *
+g_compat_thread_try_new(const gchar *name, GThreadFunc func, gpointer data,
+ GError **error)
+{
+ return g_thread_create(func, data, TRUE, error);
+}
#endif
#if !GLIB_CHECK_VERSION(2,31,18)
diff --git a/tests/simple-decoder.c b/tests/simple-decoder.c
index 69c960b..bba4f85 100644
--- a/tests/simple-decoder.c
+++ b/tests/simple-decoder.c
@@ -396,7 +396,8 @@ start_decoder(App *app)
g_timer_start(app->timer);
- app->decoder_thread = g_thread_create(decoder_thread, app, TRUE, NULL);
+ app->decoder_thread = g_thread_try_new("Decoder Thread", decoder_thread,
+ app, NULL);
if (!app->decoder_thread)
return FALSE;
return TRUE;
@@ -571,7 +572,8 @@ flush_decoder_queue(App *app)
static gboolean
start_renderer(App *app)
{
- app->render_thread = g_thread_create(renderer_thread, app, TRUE, NULL);
+ app->render_thread = g_thread_try_new("Renderer Thread", renderer_thread,
+ app, NULL);
if (!app->render_thread)
return FALSE;
return TRUE;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gstreamer/gstreamer-vaapi.git
More information about the Pkg-gstreamer-commits
mailing list