diff options
author | Sjoerd Simons <sjoerd.simons@collabora.co.uk> | 2009-05-07 22:18:32 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2009-05-18 23:17:27 +0800 |
commit | d16f5ff7b8ab7b3325401e13987cebeba87044d8 (patch) | |
tree | e65f3b75ca3c5da01e4f15f69189e15096837c83 /libempathy/empathy-call-handler.c | |
parent | a3e15eb1121dc577551934374fc5274aa49da607 (diff) | |
download | gsoc2013-empathy-d16f5ff7b8ab7b3325401e13987cebeba87044d8.tar gsoc2013-empathy-d16f5ff7b8ab7b3325401e13987cebeba87044d8.tar.gz gsoc2013-empathy-d16f5ff7b8ab7b3325401e13987cebeba87044d8.tar.bz2 gsoc2013-empathy-d16f5ff7b8ab7b3325401e13987cebeba87044d8.tar.lz gsoc2013-empathy-d16f5ff7b8ab7b3325401e13987cebeba87044d8.tar.xz gsoc2013-empathy-d16f5ff7b8ab7b3325401e13987cebeba87044d8.tar.zst gsoc2013-empathy-d16f5ff7b8ab7b3325401e13987cebeba87044d8.zip |
Allow handlers to be created for streams with initial audio and video
Diffstat (limited to 'libempathy/empathy-call-handler.c')
-rw-r--r-- | libempathy/empathy-call-handler.c | 46 |
1 files changed, 44 insertions, 2 deletions
diff --git a/libempathy/empathy-call-handler.c b/libempathy/empathy-call-handler.c index 336052654..0c84595d5 100644 --- a/libempathy/empathy-call-handler.c +++ b/libempathy/empathy-call-handler.c @@ -51,7 +51,9 @@ static guint signals[LAST_SIGNAL] = {0}; enum { PROP_TP_CALL = 1, PROP_GST_BUS, - PROP_CONTACT + PROP_CONTACT, + PROP_INITIAL_AUDIO, + PROP_INITIAL_VIDEO }; /* private structure */ @@ -61,6 +63,8 @@ typedef struct { EmpathyTpCall *call; EmpathyContact *contact; TfChannel *tfchannel; + gboolean initial_audio; + gboolean initial_video; FsElementAddedNotifier *fsnotifier; } EmpathyCallHandlerPriv; @@ -147,6 +151,12 @@ empathy_call_handler_set_property (GObject *object, case PROP_TP_CALL: priv->call = g_value_dup_object (value); break; + case PROP_INITIAL_AUDIO: + priv->initial_audio = g_value_get_boolean (value); + break; + case PROP_INITIAL_VIDEO: + priv->initial_video = g_value_get_boolean (value); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } @@ -166,6 +176,12 @@ empathy_call_handler_get_property (GObject *object, case PROP_TP_CALL: g_value_set_object (value, priv->call); break; + case PROP_INITIAL_AUDIO: + g_value_set_boolean (value, priv->initial_audio); + break; + case PROP_INITIAL_VIDEO: + g_value_set_boolean (value, priv->initial_video); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); } @@ -198,6 +214,20 @@ empathy_call_handler_class_init (EmpathyCallHandlerClass *klass) G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); g_object_class_install_property (object_class, PROP_TP_CALL, param_spec); + param_spec = g_param_spec_boolean ("initial-audio", + "initial-audio", "Whether the call should start with audio", + TRUE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); + g_object_class_install_property (object_class, PROP_INITIAL_AUDIO, + param_spec); + + param_spec = g_param_spec_boolean ("initial-video", + "initial-video", "Whether the call should start with video", + FALSE, + G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | G_PARAM_STATIC_STRINGS); + g_object_class_install_property (object_class, PROP_INITIAL_VIDEO, + param_spec); + signals[CONFERENCE_ADDED] = g_signal_new ("conference-added", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL, @@ -242,6 +272,17 @@ empathy_call_handler_new_for_contact (EmpathyContact *contact) } EmpathyCallHandler * +empathy_call_handler_new_for_contact_with_streams (EmpathyContact *contact, + gboolean audio, gboolean video) +{ + return EMPATHY_CALL_HANDLER (g_object_new (EMPATHY_TYPE_CALL_HANDLER, + "contact", contact, + "initial-audio", audio, + "initial-video", video, + NULL)); +} + +EmpathyCallHandler * empathy_call_handler_new_for_channel (EmpathyTpCall *call) { return EMPATHY_CALL_HANDLER (g_object_new (EMPATHY_TYPE_CALL_HANDLER, @@ -457,7 +498,8 @@ empathy_call_handler_request_cb (EmpathyDispatchOperation *operation, empathy_call_handler_start_tpfs (self); - empathy_tp_call_to (priv->call, priv->contact); + empathy_tp_call_to (priv->call, priv->contact, + priv->initial_audio, priv->initial_video); empathy_dispatch_operation_claim (operation); } |