mainloop: add threaded mainloop

Add a mainloop wrapper that runs the mainloop in a separate thread and
has some synchronization primitives.
Use new mainloop in gstreamer source and sink elements
This commit is contained in:
Wim Taymans 2015-07-08 12:11:55 +02:00
parent a3505fb880
commit cbeee04809
9 changed files with 710 additions and 195 deletions

View file

@ -23,9 +23,7 @@
#include <gst/gst.h>
#include <gst/base/gstbasesink.h>
#include <client/context.h>
#include <client/stream.h>
#include <client/introspect.h>
#include <client/pinos.h>
G_BEGIN_DECLS
@ -59,15 +57,10 @@ struct _GstPinosSink {
gboolean negotiated;
GMainContext *context;
GMainLoop *loop;
GThread *thread;
PinosMainLoop *loop;
PinosContext *ctx;
PinosStream *stream;
GstAllocator *allocator;
GPollFunc poll_func;
GMutex lock;
GCond cond;
};
struct _GstPinosSinkClass {