1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
|
/*
* call-stream.c - a stream in a call.
*
* Copyright © 2007-2009 Collabora Ltd. <http://www.collabora.co.uk/>
* Copyright © 2007-2009 Nokia Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "call-stream.h"
#include <telepathy-glib/base-connection.h>
#include <telepathy-glib/gtypes.h>
#include "extensions/extensions.h"
static void stream_iface_init (gpointer, gpointer);
G_DEFINE_TYPE_WITH_CODE (ExampleCallStream,
example_call_stream,
G_TYPE_OBJECT,
G_IMPLEMENT_INTERFACE (TP_TYPE_SVC_DBUS_PROPERTIES,
tp_dbus_properties_mixin_iface_init);
G_IMPLEMENT_INTERFACE (FUTURE_TYPE_SVC_CALL_STREAM, stream_iface_init))
enum
{
PROP_OBJECT_PATH = 1,
PROP_CONNECTION,
PROP_HANDLE,
PROP_SIMULATION_DELAY,
PROP_LOCALLY_REQUESTED,
PROP_SENDERS,
N_PROPS
};
enum
{
SIGNAL_REMOVED,
N_SIGNALS
};
static guint signals[N_SIGNALS] = { 0 };
struct _ExampleCallStreamPrivate
{
gchar *object_path;
TpBaseConnection *conn;
TpHandle handle;
FutureSendingState local_sending_state;
FutureSendingState remote_sending_state;
guint simulation_delay;
guint connected_event_id;
gboolean locally_requested;
gboolean removed;
};
static void
example_call_stream_init (ExampleCallStream *self)
{
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
EXAMPLE_TYPE_CALL_STREAM,
ExampleCallStreamPrivate);
/* start off directionless */
self->priv->local_sending_state = FUTURE_SENDING_STATE_NONE;
self->priv->remote_sending_state = FUTURE_SENDING_STATE_NONE;
}
static void example_call_stream_receive_direction_request (
ExampleCallStream *self, gboolean local_send, gboolean remote_send);
static void example_call_stream_change_direction (ExampleCallStream *self,
gboolean want_to_send, gboolean want_to_receive);
static void
constructed (GObject *object)
{
ExampleCallStream *self = EXAMPLE_CALL_STREAM (object);
void (*chain_up) (GObject *) =
((GObjectClass *) example_call_stream_parent_class)->constructed;
if (chain_up != NULL)
chain_up (object);
tp_dbus_daemon_register_object (
tp_base_connection_get_dbus_daemon (self->priv->conn),
self->priv->object_path, self);
if (self->priv->locally_requested)
{
example_call_stream_change_direction (self, TRUE, TRUE);
}
else
{
example_call_stream_receive_direction_request (self, TRUE, TRUE);
}
if (self->priv->handle != 0)
{
TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
self->priv->conn, TP_HANDLE_TYPE_CONTACT);
tp_handle_ref (contact_repo, self->priv->handle);
}
}
static void
get_property (GObject *object,
guint property_id,
GValue *value,
GParamSpec *pspec)
{
ExampleCallStream *self = EXAMPLE_CALL_STREAM (object);
switch (property_id)
{
case PROP_OBJECT_PATH:
g_value_set_string (value, self->priv->object_path);
break;
case PROP_HANDLE:
g_value_set_uint (value, self->priv->handle);
break;
case PROP_CONNECTION:
g_value_set_object (value, self->priv->conn);
break;
case PROP_SIMULATION_DELAY:
g_value_set_uint (value, self->priv->simulation_delay);
break;
case PROP_LOCALLY_REQUESTED:
g_value_set_boolean (value, self->priv->locally_requested);
break;
case PROP_SENDERS:
{
GHashTable *senders = g_hash_table_new (NULL, NULL);
g_hash_table_insert (senders, GUINT_TO_POINTER (self->priv->handle),
GUINT_TO_POINTER (self->priv->remote_sending_state));
g_hash_table_insert (senders,
GUINT_TO_POINTER (tp_base_connection_get_self_handle (
self->priv->conn)),
GUINT_TO_POINTER (self->priv->local_sending_state));
g_value_take_boxed (value, senders);
}
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
set_property (GObject *object,
guint property_id,
const GValue *value,
GParamSpec *pspec)
{
ExampleCallStream *self = EXAMPLE_CALL_STREAM (object);
switch (property_id)
{
case PROP_OBJECT_PATH:
g_assert (self->priv->object_path == NULL); /* construct-only */
self->priv->object_path = g_value_dup_string (value);
break;
case PROP_HANDLE:
self->priv->handle = g_value_get_uint (value);
break;
case PROP_CONNECTION:
g_assert (self->priv->conn == NULL);
self->priv->conn = g_value_dup_object (value);
break;
case PROP_SIMULATION_DELAY:
self->priv->simulation_delay = g_value_get_uint (value);
break;
case PROP_LOCALLY_REQUESTED:
self->priv->locally_requested = g_value_get_boolean (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
break;
}
}
static void
dispose (GObject *object)
{
ExampleCallStream *self = EXAMPLE_CALL_STREAM (object);
TpHandleRepoIface *contact_repo = tp_base_connection_get_handles (
self->priv->conn, TP_HANDLE_TYPE_CONTACT);
example_call_stream_close (self);
if (self->priv->handle != 0)
{
tp_handle_unref (contact_repo, self->priv->handle);
self->priv->handle = 0;
}
if (self->priv->conn != NULL)
{
g_object_unref (self->priv->conn);
self->priv->conn = NULL;
}
((GObjectClass *) example_call_stream_parent_class)->dispose (object);
}
static void
finalize (GObject *object)
{
ExampleCallStream *self = EXAMPLE_CALL_STREAM (object);
void (*chain_up) (GObject *) =
((GObjectClass *) example_call_stream_parent_class)->finalize;
g_free (self->priv->object_path);
if (chain_up != NULL)
chain_up (object);
}
static void
example_call_stream_class_init (ExampleCallStreamClass *klass)
{
static TpDBusPropertiesMixinPropImpl stream_props[] = {
{ "Senders", "senders", NULL },
{ NULL }
};
static TpDBusPropertiesMixinIfaceImpl prop_interfaces[] = {
{ FUTURE_IFACE_CALL_STREAM,
tp_dbus_properties_mixin_getter_gobject_properties,
NULL,
stream_props,
},
{ NULL }
};
GObjectClass *object_class = (GObjectClass *) klass;
GParamSpec *param_spec;
g_type_class_add_private (klass,
sizeof (ExampleCallStreamPrivate));
object_class->constructed = constructed;
object_class->set_property = set_property;
object_class->get_property = get_property;
object_class->dispose = dispose;
object_class->finalize = finalize;
param_spec = g_param_spec_string ("object-path", "D-Bus object path",
"The D-Bus object path used for this object on the bus.", NULL,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_OBJECT_PATH, param_spec);
param_spec = g_param_spec_object ("connection", "TpBaseConnection",
"Connection that (indirectly) owns this stream",
TP_TYPE_BASE_CONNECTION,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_CONNECTION, param_spec);
param_spec = g_param_spec_uint ("handle", "Peer's TpHandle",
"The handle with which this stream communicates or 0 if not applicable",
0, G_MAXUINT32, 0,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_HANDLE, param_spec);
param_spec = g_param_spec_uint ("simulation-delay", "Simulation delay",
"Delay between simulated network events",
0, G_MAXUINT32, 1000,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_SIMULATION_DELAY,
param_spec);
param_spec = g_param_spec_boolean ("locally-requested", "Locally requested?",
"True if this channel was requested by the local user",
FALSE,
G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_LOCALLY_REQUESTED,
param_spec);
param_spec = g_param_spec_boxed ("senders", "Senders",
"Map from contact handles to their sending states",
FUTURE_HASH_TYPE_CONTACT_SENDING_STATE_MAP,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
g_object_class_install_property (object_class, PROP_SENDERS, param_spec);
signals[SIGNAL_REMOVED] = g_signal_new ("removed",
G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, 0, NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
klass->dbus_properties_class.interfaces = prop_interfaces;
tp_dbus_properties_mixin_class_init (object_class,
G_STRUCT_OFFSET (ExampleCallStreamClass,
dbus_properties_class));
}
void
example_call_stream_close (ExampleCallStream *self)
{
if (!self->priv->removed)
{
self->priv->removed = TRUE;
g_message ("%s: Sending to server: Closing stream",
self->priv->object_path);
if (self->priv->connected_event_id != 0)
{
g_source_remove (self->priv->connected_event_id);
}
/* this has to come last, because the MediaChannel may unref us in
* response to the removed signal */
g_signal_emit (self, signals[SIGNAL_REMOVED], 0);
}
}
void
example_call_stream_accept_proposed_direction (ExampleCallStream *self)
{
GHashTable *updated_senders;
GArray *removed_senders;
if (self->priv->removed ||
self->priv->local_sending_state != FUTURE_SENDING_STATE_PENDING_SEND)
return;
g_message ("%s: SIGNALLING: Sending to server: OK, I'll send you media",
self->priv->object_path);
self->priv->local_sending_state = FUTURE_SENDING_STATE_SENDING;
updated_senders = g_hash_table_new (NULL, NULL);
removed_senders = g_array_sized_new (FALSE, FALSE, sizeof (guint), 0);
g_hash_table_insert (updated_senders,
GUINT_TO_POINTER (tp_base_connection_get_self_handle (self->priv->conn)),
GUINT_TO_POINTER (FUTURE_SENDING_STATE_SENDING));
future_svc_call_stream_emit_senders_changed (self, updated_senders,
removed_senders);
g_hash_table_unref (updated_senders);
g_array_free (removed_senders, TRUE);
}
void
example_call_stream_simulate_contact_agreed_to_send (ExampleCallStream *self)
{
GHashTable *updated_senders;
GArray *removed_senders;
if (self->priv->removed ||
self->priv->remote_sending_state != FUTURE_SENDING_STATE_PENDING_SEND)
return;
g_message ("%s: SIGNALLING: received: OK, I'll send you media",
self->priv->object_path);
self->priv->remote_sending_state = FUTURE_SENDING_STATE_SENDING;
updated_senders = g_hash_table_new (NULL, NULL);
removed_senders = g_array_sized_new (FALSE, FALSE, sizeof (guint), 0);
g_hash_table_insert (updated_senders, GUINT_TO_POINTER (self->priv->handle),
GUINT_TO_POINTER (FUTURE_SENDING_STATE_SENDING));
future_svc_call_stream_emit_senders_changed (self, updated_senders,
removed_senders);
g_hash_table_unref (updated_senders);
g_array_free (removed_senders, TRUE);
}
static gboolean
simulate_contact_agreed_to_send_cb (gpointer p)
{
example_call_stream_simulate_contact_agreed_to_send (p);
return FALSE;
}
static void
example_call_stream_change_direction (ExampleCallStream *self,
gboolean want_to_send, gboolean want_to_receive)
{
GHashTable *updated_senders = g_hash_table_new (NULL, NULL);
if (want_to_send)
{
if (self->priv->local_sending_state != FUTURE_SENDING_STATE_SENDING)
{
if (self->priv->local_sending_state ==
FUTURE_SENDING_STATE_PENDING_SEND)
{
g_message ("%s: SIGNALLING: send: I will now send you media",
self->priv->object_path);
}
g_message ("%s: MEDIA: sending media to peer",
self->priv->object_path);
self->priv->local_sending_state = FUTURE_SENDING_STATE_SENDING;
g_hash_table_insert (updated_senders,
GUINT_TO_POINTER (tp_base_connection_get_self_handle (
self->priv->conn)),
GUINT_TO_POINTER (FUTURE_SENDING_STATE_SENDING));
}
}
else
{
if (self->priv->local_sending_state == FUTURE_SENDING_STATE_SENDING)
{
g_message ("%s: SIGNALLING: send: I will no longer send you media",
self->priv->object_path);
g_message ("%s: MEDIA: no longer sending media to peer",
self->priv->object_path);
self->priv->local_sending_state = FUTURE_SENDING_STATE_NONE;
g_hash_table_insert (updated_senders,
GUINT_TO_POINTER (tp_base_connection_get_self_handle (
self->priv->conn)),
GUINT_TO_POINTER (FUTURE_SENDING_STATE_NONE));
}
else if (self->priv->local_sending_state ==
FUTURE_SENDING_STATE_PENDING_SEND)
{
g_message ("%s: SIGNALLING: send: refusing to send you media",
self->priv->object_path);
self->priv->local_sending_state = FUTURE_SENDING_STATE_NONE;
g_hash_table_insert (updated_senders,
GUINT_TO_POINTER (tp_base_connection_get_self_handle (
self->priv->conn)),
GUINT_TO_POINTER (FUTURE_SENDING_STATE_NONE));
}
}
if (want_to_receive)
{
if (self->priv->remote_sending_state == FUTURE_SENDING_STATE_NONE)
{
g_message ("%s: SIGNALLING: send: send me media, please?",
self->priv->object_path);
self->priv->remote_sending_state = FUTURE_SENDING_STATE_PENDING_SEND;
g_timeout_add_full (G_PRIORITY_DEFAULT, self->priv->simulation_delay,
simulate_contact_agreed_to_send_cb, g_object_ref (self),
g_object_unref);
g_hash_table_insert (updated_senders,
GUINT_TO_POINTER (self->priv->handle),
GUINT_TO_POINTER (FUTURE_SENDING_STATE_PENDING_SEND));
}
}
else
{
if (self->priv->remote_sending_state != FUTURE_SENDING_STATE_NONE)
{
g_message ("%s: SIGNALLING: send: Please stop sending me media",
self->priv->object_path);
g_message ("%s: MEDIA: suppressing output of stream",
self->priv->object_path);
self->priv->remote_sending_state = FUTURE_SENDING_STATE_NONE;
g_hash_table_insert (updated_senders,
GUINT_TO_POINTER (self->priv->handle),
GUINT_TO_POINTER (FUTURE_SENDING_STATE_NONE));
}
}
if (g_hash_table_size (updated_senders) != 0)
{
GArray *removed_senders = g_array_sized_new (FALSE, FALSE,
sizeof (guint), 0);
future_svc_call_stream_emit_senders_changed (self, updated_senders,
removed_senders);
g_array_free (removed_senders, TRUE);
}
g_hash_table_unref (updated_senders);
}
/* The remote user wants to change the direction of this stream according
* to @local_send and @remote_send. Shall we let him? */
static void
example_call_stream_receive_direction_request (ExampleCallStream *self,
gboolean local_send,
gboolean remote_send)
{
GHashTable *updated_senders = g_hash_table_new (NULL, NULL);
/* In some protocols, streams cannot be neither sending nor receiving, so
* if a stream is set to TP_MEDIA_STREAM_DIRECTION_NONE, this is equivalent
* to removing it. (This is true in XMPP, for instance.)
*
* However, for this example we'll emulate a protocol where streams can be
* directionless.
*/
if (local_send)
{
g_message ("%s: SIGNALLING: send: Please start sending me media",
self->priv->object_path);
if (self->priv->local_sending_state == FUTURE_SENDING_STATE_NONE)
{
/* ask the user for permission */
self->priv->local_sending_state = FUTURE_SENDING_STATE_PENDING_SEND;
g_hash_table_insert (updated_senders,
GUINT_TO_POINTER (tp_base_connection_get_self_handle (
self->priv->conn)),
GUINT_TO_POINTER (FUTURE_SENDING_STATE_PENDING_SEND));
}
else
{
/* nothing to do, we're already sending (or asking the user for
* permission to do so) on that stream */
}
}
else
{
g_message ("%s: SIGNALLING: receive: Please stop sending me media",
self->priv->object_path);
g_message ("%s: SIGNALLING: reply: OK!",
self->priv->object_path);
if (self->priv->local_sending_state == FUTURE_SENDING_STATE_SENDING)
{
g_message ("%s: MEDIA: no longer sending media to peer",
self->priv->object_path);
self->priv->local_sending_state = FUTURE_SENDING_STATE_NONE;
g_hash_table_insert (updated_senders,
GUINT_TO_POINTER (tp_base_connection_get_self_handle (
self->priv->conn)),
GUINT_TO_POINTER (FUTURE_SENDING_STATE_NONE));
}
else if (self->priv->local_sending_state ==
FUTURE_SENDING_STATE_PENDING_SEND)
{
self->priv->local_sending_state = FUTURE_SENDING_STATE_NONE;
g_hash_table_insert (updated_senders,
GUINT_TO_POINTER (tp_base_connection_get_self_handle (
self->priv->conn)),
GUINT_TO_POINTER (FUTURE_SENDING_STATE_NONE));
}
else
{
/* nothing to do, we're not sending on that stream anyway */
}
}
if (remote_send)
{
g_message ("%s: SIGNALLING: receive: I will now send you media",
self->priv->object_path);
if (self->priv->remote_sending_state != FUTURE_SENDING_STATE_SENDING)
{
self->priv->remote_sending_state = FUTURE_SENDING_STATE_SENDING;
g_hash_table_insert (updated_senders,
GUINT_TO_POINTER (self->priv->handle),
GUINT_TO_POINTER (FUTURE_SENDING_STATE_SENDING));
}
}
else
{
if (self->priv->remote_sending_state ==
FUTURE_SENDING_STATE_PENDING_SEND)
{
g_message ("%s: SIGNALLING: receive: No, I refuse to send you media",
self->priv->object_path);
self->priv->remote_sending_state = FUTURE_SENDING_STATE_NONE;
g_hash_table_insert (updated_senders,
GUINT_TO_POINTER (self->priv->handle),
GUINT_TO_POINTER (FUTURE_SENDING_STATE_NONE));
}
else if (self->priv->remote_sending_state ==
FUTURE_SENDING_STATE_SENDING)
{
g_message ("%s: SIGNALLING: receive: I will no longer send media",
self->priv->object_path);
self->priv->remote_sending_state = FUTURE_SENDING_STATE_NONE;
g_hash_table_insert (updated_senders,
GUINT_TO_POINTER (self->priv->handle),
GUINT_TO_POINTER (FUTURE_SENDING_STATE_NONE));
}
}
if (g_hash_table_size (updated_senders) != 0)
{
GArray *removed_senders = g_array_sized_new (FALSE, FALSE,
sizeof (guint), 0);
future_svc_call_stream_emit_senders_changed (self, updated_senders,
removed_senders);
g_array_free (removed_senders, TRUE);
}
g_hash_table_unref (updated_senders);
}
static void
stream_set_sending (FutureSvcCallStream *iface G_GNUC_UNUSED,
gboolean sending,
DBusGMethodInvocation *context)
{
ExampleCallStream *self = EXAMPLE_CALL_STREAM (iface);
example_call_stream_change_direction (self, sending,
(self->priv->remote_sending_state == FUTURE_SENDING_STATE_SENDING));
future_svc_call_stream_return_from_set_sending (context);
}
static void
stream_request_receiving (FutureSvcCallStream *iface,
TpHandle contact,
gboolean receive,
DBusGMethodInvocation *context)
{
ExampleCallStream *self = EXAMPLE_CALL_STREAM (iface);
TpHandleRepoIface *contact_repo = tp_base_connection_get_handles
(self->priv->conn, TP_HANDLE_TYPE_CONTACT);
GError *error = NULL;
if (!tp_handle_is_valid (contact_repo, contact, &error))
{
goto finally;
}
if (contact != self->priv->handle)
{
g_set_error (&error, TP_ERRORS, TP_ERROR_INVALID_ARGUMENT,
"Can't receive from contact #%u: this stream only contains #%u",
contact, self->priv->handle);
goto finally;
}
example_call_stream_change_direction (self,
(self->priv->local_sending_state == FUTURE_SENDING_STATE_SENDING),
receive);
finally:
if (error == NULL)
{
future_svc_call_stream_return_from_request_receiving (context);
}
else
{
dbus_g_method_return_error (context, error);
g_error_free (error);
}
}
static void
stream_iface_init (gpointer iface,
gpointer data)
{
FutureSvcCallStreamClass *klass = iface;
#define IMPLEMENT(x) \
future_svc_call_stream_implement_##x (klass, stream_##x)
IMPLEMENT (set_sending);
IMPLEMENT (request_receiving);
#undef IMPLEMENT
}
|