Displaying 18 results from an estimated 18 matches for "gsourc".
Did you mean:
gsource
2019 Jul 17
0
[PATCH libnbd v2] examples: Include an example of integrating with the glib main loop.
...de <stdint.h>
+#include <inttypes.h>
+#include <assert.h>
+
+#include <libnbd.h>
+
+#include <glib.h>
+
+struct NBDSource;
+typedef void (*connecting_callback_t) (struct NBDSource *);
+typedef void (*connected_callback_t) (struct NBDSource *);
+
+/* This is the derived GSource type. */
+struct NBDSource {
+ /* The base type. This MUST be the first element in this struct. */
+ GSource source;
+
+ /* The underlying libnbd handle. */
+ struct nbd_handle *nbd;
+ bool debug; /* true if handle has debug set */
+
+ /* The poll file descriptor. We stor...
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
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.
2019 Jul 15
0
[PATCH libnbd] examples: Include an example of integrating with the glib main loop.
...ude <stdbool.h>
+#include <stdint.h>
+#include <assert.h>
+
+#include <libnbd.h>
+
+#include <glib.h>
+
+struct NBDSource;
+typedef void (*connecting_callback_t) (struct NBDSource *);
+typedef void (*connected_callback_t) (struct NBDSource *);
+
+/* This is the derived GSource type. */
+struct NBDSource {
+ /* The base type. This MUST be the first element in this struct. */
+ GSource source;
+
+ /* The underlying libnbd handle. */
+ struct nbd_handle *nbd;
+ bool debug; /* true if handle has debug set */
+
+ /* The poll file descriptor, only val...
2019 Jul 17
1
Re: [PATCH libnbd] examples: Include an example of integrating with the glib main loop.
...ure.ac | 9 +
> examples/Makefile.am | 22 ++
> examples/glib-main-loop.c | 501 ++++++++++++++++++++++++++++++++++++++
> 5 files changed, 535 insertions(+)
>
Rough review (since I've never used a glib main loop before)...
> +static gboolean
> +prepare (GSource *sp, gint *timeout_)
> +{
> + struct NBDSource *source = (struct NBDSource *) sp;
> +
> + /* When the NBD handle moves out of the created state (which means
> + * that it first has a socket associated with it) we must initialize
> + * and register the pollfd.
> + */
&g...
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
...wfdec_source.c b/libswfdec-gtk/swfdec_source.c
index f001de3..10d0f0e 100644
--- a/libswfdec-gtk/swfdec_source.c
+++ b/libswfdec-gtk/swfdec_source.c
@@ -34,7 +34,7 @@ my_time_val_difference (const GTimeVal *
typedef struct _SwfdecIterateSource SwfdecIterateSource;
struct _SwfdecIterateSource {
GSource source;
- SwfdecPlayer * player;
+ SwfdecPlayer * player; /* player we manage or NULL if player was deleted */
double speed; /* inverse playback speed (so 0.5 means double speed) */
gulong notify; /* set for iterate notifications */
GTimeVal last; /* last time */
@@ -47,6 +47,7...
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
...ec-gtk/swfdec-gtk.h>
#include "swfdec_slow_loader.h"
-static gpointer playback;
-
static void
set_title (GtkWindow *window, const char *filename)
{
@@ -61,20 +57,6 @@ view_swf (SwfdecPlayer *player, double s
}
static void
-play_swf (SwfdecPlayer *player, double speed)
-{
- GSource *source;
-
- source = swfdec_iterate_source_new (player, speed);
- g_source_attach (source, NULL);
-
- gtk_main ();
-
- g_source_destroy (source);
- g_source_unref (source);
-}
-
-static void
print_trace (SwfdecPlayer *player, const char *message, gpointer unused)
{
g_print ("%s\n&q...
2007 Aug 22
0
Branch 'vivi' - 2 commits - libswfdec-gtk/swfdec_source.c vivified/ui
...47 2007 +0200
only disconnect signals when the objet still exists
diff --git a/libswfdec-gtk/swfdec_source.c b/libswfdec-gtk/swfdec_source.c
index d570710..59f0d85 100644
--- a/libswfdec-gtk/swfdec_source.c
+++ b/libswfdec-gtk/swfdec_source.c
@@ -36,7 +36,7 @@ struct _SwfdecIterateSource {
GSource source;
SwfdecPlayer * player; /* player we manage or NULL if player was deleted */
double speed; /* inverse playback speed (so 0.5 means double speed) */
- gulong notify; /* set for iterate notifications */
+ gulong notify; /* set for iterate notifications (only valid when player...
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
...* player;
- GList * streams; /* all Stream objects */
- GMainContext * context; /* context we work in */
-} Sound;
-
-typedef struct {
- Sound * sound; /* reference to sound object */
- SwfdecAudio * audio; /* the audio we play back */
- snd_pcm_t * pcm; /* the pcm we play back to */
- GSource ** sources; /* sources for writing data */
- guint n_sources; /* number of sources */
- guint offset; /* offset into sound */
-} Stream;
-
-#define ALSA_TRY(func,msg) G_STMT_START{ \
- int err = func; \
- if (err < 0) \
- g_printerr (msg ": %s\n", snd_strerror (err)); \
-...
2016 Oct 04
28
[Bug 98039] New: KMail crash on starting (nouveau-related)
...82e8 in QThreadPrivate::start(void*) (arg=0xe149b0) at
thread/qthread_unix.cpp:341
#8 0x00007ff6c37a9454 in start_thread () at /lib64/libpthread.so.0
#9 0x00007ff6cd91f3ff in clone () at /lib64/libc.so.6
Thread 7 (Thread 0x7ff687fff700 (LWP 12029)):
#0 0x00007ff6ce4552a0 in postEventSourceCheck(GSource*) (this=<optimized out>)
at ../../src/corelib/thread/qmutex.h:159
#1 0x00007ff6ce4552a0 in postEventSourceCheck(GSource*) (this=<optimized out>)
at ../../src/corelib/thread/qmutex.h:138
#2 0x00007ff6ce4552a0 in postEventSourceCheck(GSource*) (this=<optimized out>,
__in_chrg=<...
2007 Jul 16
0
configure.ac libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec_playback_oss.c
...t * streams; /* all Stream objects */
+ GMainContext * context; /* context we work in */
+};
+
+typedef struct {
+ SwfdecPlayback * sound; /* reference to sound object */
+ SwfdecAudio * audio; /* the audio we play back */
+ int dsp_fd;
+ int fragsize; /* Audio fragment size */
+ GSource * source; /* source for writing data */
+ guint offset; /* offset into sound */
+} Stream;
+
+/* Size of one of our audio samples, in bytes */
+#define SAMPLESIZE 2
+#define CHANNELS 2
+
+/*** STREAMS ***/
+
+static gboolean
+handle_stream (GIOChannel *source, GIOCondition cond, gpointer dat...
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
...* player;
- GList * streams; /* all Stream objects */
- GMainContext * context; /* context we work in */
-} Sound;
-
-typedef struct {
- Sound * sound; /* reference to sound object */
- SwfdecAudio * audio; /* the audio we play back */
- snd_pcm_t * pcm; /* the pcm we play back to */
- GSource ** sources; /* sources for writing data */
- guint n_sources; /* number of sources */
- guint offset; /* offset into sound */
-} Stream;
-
-#define ALSA_TRY(func,msg) G_STMT_START{ \
- int err = func; \
- if (err < 0) \
- g_printerr (msg ": %s\n", snd_strerror (err)); \
-...
2019 Jul 17
2
Re: [PATCH libnbd v2] examples: Include an example of integrating with the glib main loop.
...t; README | 2 +
> configure.ac | 9 +
> examples/Makefile.am | 22 ++
> examples/glib-main-loop.c | 511 ++++++++++++++++++++++++++++++++++++++
> 5 files changed, 545 insertions(+)
Looks good.
>
> + revents = g_source_query_unix_fd ((GSource *) source, source->tag);
> +
> + DEBUG (source, "dispatch: revents = 0x%x%s%s",
> + revents,
> + revents & G_IO_IN ? " G_IO_IN" : "",
> + revents & G_IO_OUT ? " G_IO_OUT" : "");
> +
> + r =...
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
...wfdec_source.c b/libswfdec-gtk/swfdec_source.c
index f001de3..10d0f0e 100644
--- a/libswfdec-gtk/swfdec_source.c
+++ b/libswfdec-gtk/swfdec_source.c
@@ -34,7 +34,7 @@ my_time_val_difference (const GTimeVal *
typedef struct _SwfdecIterateSource SwfdecIterateSource;
struct _SwfdecIterateSource {
GSource source;
- SwfdecPlayer * player;
+ SwfdecPlayer * player; /* player we manage or NULL if player was deleted */
double speed; /* inverse playback speed (so 0.5 means double speed) */
gulong notify; /* set for iterate notifications */
GTimeVal last; /* last time */
@@ -47,6 +47,7...
2019 Jul 23
4
[libnbd PATCH] api: Allow completion callbacks to auto-retire
...ests/server-death.c | 30 +++++++++++++++++++++++-
6 files changed, 116 insertions(+), 61 deletions(-)
diff --git a/examples/glib-main-loop.c b/examples/glib-main-loop.c
index c633c1d..2230077 100644
--- a/examples/glib-main-loop.c
+++ b/examples/glib-main-loop.c
@@ -188,6 +188,8 @@ finalize (GSource *sp)
DEBUG (source, "finalize");
+ assert (nbd_aio_in_flight (source->nbd) == 0);
+ assert (nbd_aio_peek_command_completed (source->nbd) == -1);
nbd_close (source->nbd);
}
@@ -418,7 +420,7 @@ finished_read (void *vp, int64_t rcookie, int *error)
/* Create a writer...
2020 Sep 25
20
[RFC PATCH 00/19] vhost-user-rpmb (Replay Protected Memory Block)
Hi,
This is an initial implementation of a vhost-user backend for the
VirtIO RPMB device. The device is currently in the draft of the next
VirtIO specification and describes block device which uses combination
of a key, nonce, hashing and a persistent write counter to prevent
replay attacks (hence Replay Protected Memory Block).
It is implemented as a vhost-user device because we want to
2007 Aug 22
0
163 commits - autogen.sh configure.ac doc/swfdec-sections.txt libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_player.h libswfdec-gtk/swfdec_gtk_widget.c libswfdec-gtk/swfdec_source.c libswfdec/Makefile.am libswfdec/swfdec_as_array.c
...47 2007 +0200
only disconnect signals when the objet still exists
diff --git a/libswfdec-gtk/swfdec_source.c b/libswfdec-gtk/swfdec_source.c
index d570710..59f0d85 100644
--- a/libswfdec-gtk/swfdec_source.c
+++ b/libswfdec-gtk/swfdec_source.c
@@ -36,7 +36,7 @@ struct _SwfdecIterateSource {
GSource source;
SwfdecPlayer * player; /* player we manage or NULL if player was deleted */
double speed; /* inverse playback speed (so 0.5 means double speed) */
- gulong notify; /* set for iterate notifications */
+ gulong notify; /* set for iterate notifications (only valid when player...
2008 Jan 21
0
70 commits - configure.ac libswfdec-gtk/Makefile.am libswfdec-gtk/swfdec-gtk.h libswfdec-gtk/swfdec_gtk_loader.c libswfdec-gtk/swfdec_gtk_player.c libswfdec-gtk/swfdec_gtk_socket.c libswfdec-gtk/swfdec_gtk_socket.h libswfdec-gtk/swfdec_playback_alsa.c
...back *sound, SwfdecAudio *audio)
+swfdec_playback_stream_open (SwfdecPlayback *sound, SwfdecAudio *audio)
{
Stream *stream;
snd_pcm_t *ret;
@@ -259,7 +259,7 @@ swfdec_stream_open (SwfdecPlayback *sound, SwfdecAudio *audio)
if (stream->n_sources > 0)
stream->sources = g_new0 (GSource *, stream->n_sources);
sound->streams = g_list_prepend (sound->streams, stream);
- swfdec_stream_start (stream);
+ swfdec_playback_stream_start (stream);
return;
fail:
@@ -267,10 +267,10 @@ fail:
}
static void
-swfdec_stream_close (Stream *stream)
+swfdec_playback_stream_cl...