From 79ea72e16d3eada53c66c681c718621ec6b3dfe8 Mon Sep 17 00:00:00 2001 From: Sjoerd Simons Date: Mon, 14 Feb 2011 14:31:47 +0000 Subject: example: Use one notifier per conference with default property setting --- examples/call-handler.c | 20 ++++++++------- examples/element-properties | 62 --------------------------------------------- 2 files changed, 11 insertions(+), 71 deletions(-) delete mode 100644 examples/element-properties (limited to 'examples') diff --git a/examples/call-handler.c b/examples/call-handler.c index 4f9a636..dca6aa4 100644 --- a/examples/call-handler.c +++ b/examples/call-handler.c @@ -28,7 +28,7 @@ typedef struct { guint buswatch; TpChannel *proxy; TfChannel *channel; - FsElementAddedNotifier *notifier; + GList *notifiers; } ChannelContext; GMainLoop *loop; @@ -149,9 +149,18 @@ conference_added_cb (TfChannel *channel, gpointer user_data) { ChannelContext *context = user_data; + FsElementAddedNotifier *notifier; g_debug ("Conference added"); + /* Add notifier to set the various element properties as needed */ + notifier = fs_element_added_notifier_new (); + fs_element_added_notifier_set_properties_from_keyfile (notifier, + fs_utils_get_default_element_properties (conference)); + fs_element_added_notifier_add (notifier, GST_BIN (context->pipeline)); + + context->notifiers = g_list_prepend (context->notifiers, notifier); + gst_bin_add (GST_BIN (context->pipeline), conference); gst_element_set_state (conference, GST_STATE_PLAYING); } @@ -216,8 +225,7 @@ proxy_invalidated_cb (TpProxy *proxy, if (context->channel != NULL) g_object_unref (context->channel); - if (context->notifier != NULL) - g_object_unref (context->notifier); + g_list_free_full (context->notifiers, g_object_unref); g_object_unref (context->proxy); @@ -248,12 +256,6 @@ new_call_channel_cb (TpSimpleHandler *handler, gst_pipeline_get_bus (GST_PIPELINE (context->pipeline)), bus_watch_cb, context); - context->notifier = fs_element_added_notifier_new (); - - fs_element_added_notifier_set_properties_from_file (context->notifier, - "element-properties", NULL); - fs_element_added_notifier_add (context->notifier, - GST_BIN (context->pipeline)); gst_element_set_state (context->pipeline, GST_STATE_PLAYING); diff --git a/examples/element-properties b/examples/element-properties deleted file mode 100644 index 40f706d..0000000 --- a/examples/element-properties +++ /dev/null @@ -1,62 +0,0 @@ -# Put the desired properties in the style of -# -# [element name] -# prop1=val1 - -[gstrtpbin] -latency=100 - -[x264enc] -byte-stream=1 -bframes=0 -b-adapt=0 -cabac=0 -dct8x8=0 -bitrate=256 -# tuned for zero latency -tune=0x4 -profile=1 -speed-preset=3 -sliced-threads=false - -[ffenc_h263] -rtp-payload-size=1 - -[theoraenc] -bitrate=256 - -[vp8enc] -bitrate=256000 -max-latency=1 -speed=2 -error-resilient=true - -# Work around bug in the re-timestamp slaving method in -# GStreamer (2 is skew) -[alsasrc] -slave-method=2 - -[osssrc] -slave-method=2 - -[oss4src] -slave-method=2 - -[sunaudiosrc] -slave-method=2 - -[rtph264pay] -config-interval=5 - -[rtppcmupay] -ptime-multiple=20000000 - -[rtppcmapay] -ptime-multiple=20000000 - -[gstrtpjitterbuffer] -do-lost=1 - -[ewh264enc] -profile=baseline -quality=5 -- cgit v1.2.1