Displaying 13 results from an estimated 13 matches for "gsourcefunc".
2019 Jul 15
2
[PATCH libnbd] examples: Include an example of integrating with the glibc main loop.
** NOT WORKING **
This patch shows how to integrate libnbd and the glib main loop.
Posted mainly as a point of discussion as it doesn't quite work yet.
Rich.
2019 Jul 17
1
Re: [PATCH libnbd] examples: Include an example of integrating with the glib main loop.
...&source->pollfd);
https://developer.gnome.org/glib/stable/glib-The-Main-Event-Loop.html#g-source-add-poll
states that g_source_add_unix_fd is preferred these days; do you have a
minimum glib version in mind for targetting?
> +static gboolean
> +dispatch (GSource *sp,
> + GSourceFunc callback,
> + gpointer user_data)
> +{
> + struct NBDSource *source = (struct NBDSource *) sp;
> +
> + DEBUG (source, "dispatch: revents = 0x%x%s%s",
> + source->pollfd.revents,
> + source->pollfd.revents & G_IO_IN ? " G_IO_IN...
2007 Apr 03
0
11 commits - libswfdec-gtk/swfdec_gtk_loader.c libswfdec-gtk/swfdec_playback_alsa.c libswfdec-gtk/swfdec_source.c libswfdec/swfdec_cached.c libswfdec/swfdec_font.c libswfdec/swfdec_morphshape.c libswfdec/swfdec_net_stream.c libswfdec/swfdec_script.c
...ate_get_msecs_to_next_event (source);
-
+ glong diff;
+
+ if (((SwfdecIterateSource *) source)->player == NULL)
+ return 0;
+ diff = swfdec_iterate_get_msecs_to_next_event (source);
return diff < 0;
}
@@ -88,8 +98,11 @@ static gboolean
swfdec_iterate_dispatch (GSource *source_, GSourceFunc callback, gpointer user_data)
{
SwfdecIterateSource *source = (SwfdecIterateSource *) source_;
- glong diff = swfdec_iterate_get_msecs_to_next_event (source_);
-
+ glong diff;
+
+ if (source->player == NULL)
+ return FALSE;
+ diff = swfdec_iterate_get_msecs_to_next_event (source_);...
2019 Jul 15
0
[PATCH libnbd] examples: Include an example of integrating with the glib main loop.
...N) != 0 &&
+ (dir & LIBNBD_AIO_DIRECTION_READ) != 0)
+ return TRUE;
+ if ((source->pollfd.revents & G_IO_OUT) != 0 &&
+ (dir & LIBNBD_AIO_DIRECTION_WRITE) != 0)
+ return TRUE;
+
+ return FALSE;
+}
+
+static gboolean
+dispatch (GSource *sp,
+ GSourceFunc callback,
+ gpointer user_data)
+{
+ struct NBDSource *source = (struct NBDSource *) sp;
+
+ DEBUG (source, "dispatch: revents = 0x%x%s%s",
+ source->pollfd.revents,
+ source->pollfd.revents & G_IO_IN ? " G_IO_IN" : "",
+ so...
2019 Jul 17
0
[PATCH libnbd v2] examples: Include an example of integrating with the glib main loop.
...;
+
+ if ((revents & G_IO_IN) != 0 && (dir & LIBNBD_AIO_DIRECTION_READ) != 0)
+ return TRUE;
+ if ((revents & G_IO_OUT) != 0 && (dir & LIBNBD_AIO_DIRECTION_WRITE) != 0)
+ return TRUE;
+
+ return FALSE;
+}
+
+static gboolean
+dispatch (GSource *sp,
+ GSourceFunc callback,
+ gpointer user_data)
+{
+ struct NBDSource *source = (struct NBDSource *) sp;
+ int revents;
+ int r;
+
+ revents = g_source_query_unix_fd ((GSource *) source, source->tag);
+
+ DEBUG (source, "dispatch: revents = 0x%x%s%s",
+ revents,
+ revents...
2019 Jul 17
2
[PATCH libnbd v2] examples: Include an example of integrating with glib main loop.
This is working now, and incorporates all of the changes in Eric's
review, *except* that it still doesn't retire commands (although this
seems to make no obvious difference, except possibly a performance and
memory impact).
Rich.
2007 Jul 16
0
configure.ac libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec_playback_oss.c
...ze;
+ sound->streams = g_list_prepend (sound->streams, stream);
+
+ channel = g_io_channel_unix_new (stream->dsp_fd);
+ stream->source = g_io_create_watch (channel, G_IO_OUT);
+ g_source_set_priority (stream->source, G_PRIORITY_HIGH);
+ g_source_set_callback (stream->source, (GSourceFunc) handle_stream, stream,
+ NULL);
+ g_io_channel_unref (channel);
+ g_source_attach (stream->source, stream->sound->context);
+
+ return;
+}
+
+static void
+swfdec_stream_close (Stream *stream)
+{
+ close (stream->dsp_fd);
+ g_source_destroy (stream->source);
+ g_source_unref...
2007 Jan 29
0
3 commits - autogen.sh configure.ac player/.gitignore player/Makefile.am player/swfdec_playback_alsa.c player/swfdec_playback.c player/swfdec_playback_none.c
...sources[i] != NULL)
- continue;
- GIOChannel *channel = g_io_channel_unix_new (polls[i].fd);
- stream->sources[i] = g_io_create_watch (channel, polls[i].events);
- g_source_set_priority (stream->sources[i], G_PRIORITY_HIGH);
- g_source_set_callback (stream->sources[i], (GSourceFunc) handle_stream, stream, NULL);
- g_io_channel_unref (channel);
- g_source_attach (stream->sources[i], stream->sound->context);
- }
- }
-}
-
-static void
-swfdec_stream_start (Stream *stream)
-{
- snd_pcm_state_t state = snd_pcm_state (stream->pcm);
- switch (state) {
-...
2007 Mar 27
0
15 commits - configure.ac doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt doc/swfdec.types libswfdec-gtk/.gitignore libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec-gtk.h libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h
...sources[i] != NULL)
+ continue;
+ GIOChannel *channel = g_io_channel_unix_new (polls[i].fd);
+ stream->sources[i] = g_io_create_watch (channel, polls[i].events);
+ g_source_set_priority (stream->sources[i], G_PRIORITY_HIGH);
+ g_source_set_callback (stream->sources[i], (GSourceFunc) handle_stream, stream, NULL);
+ g_io_channel_unref (channel);
+ g_source_attach (stream->sources[i], stream->sound->context);
+ }
+ }
+}
+
+static void
+swfdec_stream_start (Stream *stream)
+{
+ snd_pcm_state_t state = snd_pcm_state (stream->pcm);
+ switch (state) {
+...
2007 Jan 31
0
Branch 'interpreter' - 20 commits - autogen.sh configure.ac libswfdec/js libswfdec/swfdec_debug.h libswfdec/swfdec_js.c libswfdec/swfdec_js_color.c libswfdec/swfdec_js_movie.c libswfdec/swfdec_movie.c libswfdec/swfdec_movie.h libswfdec/swfdec_script.c
...sources[i] != NULL)
- continue;
- GIOChannel *channel = g_io_channel_unix_new (polls[i].fd);
- stream->sources[i] = g_io_create_watch (channel, polls[i].events);
- g_source_set_priority (stream->sources[i], G_PRIORITY_HIGH);
- g_source_set_callback (stream->sources[i], (GSourceFunc) handle_stream, stream, NULL);
- g_io_channel_unref (channel);
- g_source_attach (stream->sources[i], stream->sound->context);
- }
- }
-}
-
-static void
-swfdec_stream_start (Stream *stream)
-{
- snd_pcm_state_t state = snd_pcm_state (stream->pcm);
- switch (state) {
-...
2007 Jul 18
0
12 commits - configure.ac doc/swfdec-sections.txt libswfdec-gtk/swfdec_playback_alsa.c libswfdec/jpeg libswfdec/Makefile.am libswfdec/swfdec_amf.c libswfdec/swfdec_as_array.c libswfdec/swfdec_as_boolean.h libswfdec/swfdec_as_context.c
...nnel = g_io_channel_unix_new (polls[i].fd);
+ channel = g_io_channel_unix_new (polls[i].fd);
stream->sources[i] = g_io_create_watch (channel, polls[i].events);
g_source_set_priority (stream->sources[i], G_PRIORITY_HIGH);
g_source_set_callback (stream->sources[i], (GSourceFunc) handle_stream, stream, NULL);
diff --git a/libswfdec/Makefile.am b/libswfdec/Makefile.am
index 500c431..313afbf 100644
--- a/libswfdec/Makefile.am
+++ b/libswfdec/Makefile.am
@@ -176,6 +176,7 @@ noinst_HEADERS = \
swfdec_graphic.h \
swfdec_graphic_movie.h \
swfdec_image.h \
+ swfdec_internal...
2007 Apr 04
0
Branch 'as' - 17 commits - configure.ac doc/Makefile.am doc/swfdec-docs.sgml doc/swfdec-sections.txt doc/swfdec.types libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec-gtk.h libswfdec-gtk/swfdec_gtk_loader.c libswfdec-gtk/swfdec_gtk_loader.h
...ate_get_msecs_to_next_event (source);
-
+ glong diff;
+
+ if (((SwfdecIterateSource *) source)->player == NULL)
+ return 0;
+ diff = swfdec_iterate_get_msecs_to_next_event (source);
return diff < 0;
}
@@ -88,8 +98,11 @@ static gboolean
swfdec_iterate_dispatch (GSource *source_, GSourceFunc callback, gpointer user_data)
{
SwfdecIterateSource *source = (SwfdecIterateSource *) source_;
- glong diff = swfdec_iterate_get_msecs_to_next_event (source_);
-
+ glong diff;
+
+ if (source->player == NULL)
+ return FALSE;
+ diff = swfdec_iterate_get_msecs_to_next_event (source_);...
2016 Oct 04
28
[Bug 98039] New: KMail crash on starting (nouveau-related)
...entry=0,
data=0xbd8a40) at kernel/qcoreapplication.cpp:1650
#42 0x00007ff6ce401df8 in QCoreApplication::sendPostedEvents(QObject*, int)
(receiver=receiver at entry=0x0, event_type=event_type at entry=0) at
kernel/qcoreapplication.cpp:1508
#43 0x00007ff6ce455683 in postEventSourceDispatch(GSource*, GSourceFunc,
gpointer) (s=0xc51720) at kernel/qeventdispatcher_glib.cpp:270
#44 0x00007ff6c2f83677 in g_main_context_dispatch () at
/usr/lib64/libglib-2.0.so.0
#45 0x00007ff6c2f838e0 in () at /usr/lib64/libglib-2.0.so.0
#46 0x00007ff6c2f8398c in g_main_context_iteration () at
/usr/lib64/libglib-2.0.so.0
#47 0...