[aravis/realtime] viewer: make stream thread high priority
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis/realtime] viewer: make stream thread high priority
- Date: Tue, 2 Dec 2014 13:32:52 +0000 (UTC)
commit d42a6d54c20ad74170eba1c41bbfa60ca2d6f44d
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Tue Dec 2 14:32:25 2014 +0100
viewer: make stream thread high priority
viewer/arvviewer.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/viewer/arvviewer.c b/viewer/arvviewer.c
index 431a21a..b49b625 100644
--- a/viewer/arvviewer.c
+++ b/viewer/arvviewer.c
@@ -526,6 +526,16 @@ bus_sync_handler (GstBus *bus, GstMessage *message, gpointer user_data)
return GST_BUS_DROP;
}
+static void
+stream_cb (void *user_data, ArvStreamCallbackType type, ArvBuffer *buffer)
+{
+ if (type == ARV_STREAM_CALLBACK_TYPE_INIT) {
+ if (!arv_make_thread_realtime (10) &&
+ !arv_make_thread_high_priority (-10))
+ g_warning ("Failed to make stream thread high priority");
+ }
+}
+
void
arv_viewer_select_camera_cb (GtkComboBox *combo_box, ArvViewer *viewer)
{
@@ -567,7 +577,7 @@ arv_viewer_select_camera_cb (GtkComboBox *combo_box, ArvViewer *viewer)
arv_camera_set_chunk_mode (viewer->camera, FALSE);
viewer->rotation = 0;
- viewer->stream = arv_camera_create_stream (viewer->camera, NULL, NULL);
+ viewer->stream = arv_camera_create_stream (viewer->camera, stream_cb, NULL);
if (viewer->stream == NULL) {
g_object_unref (viewer->camera);
viewer->camera = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]