| Summary: | Clarify StreamedMedia interface | ||
|---|---|---|---|
| Product: | Telepathy | Reporter: | Simon McVittie <smcv> |
| Component: | tp-spec | Assignee: | Telepathy bugs list <telepathy-bugs> |
| Status: | RESOLVED FIXED | QA Contact: | Telepathy bugs list <telepathy-bugs> |
| Severity: | normal | ||
| Priority: | medium | CC: | xclaesse |
| Version: | unspecified | Keywords: | patch |
| Hardware: | Other | ||
| OS: | All | ||
| URL: | http://people.freedesktop.org/~smcv/telepathy-spec-streaming_errata/spec.html#org.freedesktop.Telepathy.Channel.Type.StreamedMedia | ||
| Whiteboard: | |||
| i915 platform: | i915 features: | ||
|
Description
Simon McVittie
2009-03-20 10:49:14 UTC
*** Bug 15388 has been marked as a duplicate of this bug. *** Implementation note: because I specified SDC to be emitted *immediately* before SA, you only have to remember the direction that was in the last SDC signal. Something like this:
static void
my_channel_ui_init (...)
{
...
/* there is no invalid stream ID, so we can't easily distinguish between
* initial values for these, and having been given those values in the SDC
* signal - but when a stream is created, it has these values unless we're
* told otherwise, so that's no problem */
self->priv->next_stream_id = 0;
self->priv->next_stream_direction = TP_MEDIA_STREAM_DIRECTION_RECEIVE;
self->priv->next_stream_pending_send = TP_MEDIA_STREAM_PENDING_LOCAL_SEND;
}
static void
stream_direction_changed_cb (TpChannel *channel,
guint id,
guint direction,
guint pending_send,
...)
{
stream = g_hash_table_lookup (self->priv->streams, GUINT_TO_POINTER (id));
if (stream == NULL)
{
/* not created yet - we should get StreamAdded next */
self->priv->next_stream_id = id;
self->priv->next_stream_direction = direction;
self->priv->next_stream_pending_send = pending_send;
return;
}
/* else continue as before */
...
}
static void
stream_added_cb (TpChannel *channel,
guint id,
guint media_type,
...)
{
TpMediaStreamDirection direction = TP_MEDIA_STREAM_DIRECTION_RECEIVE;
TpMediaStreamPendingSend pending_send = TP_MEDIA_STREAM_PENDING_LOCAL_SEND;
if (id == self->priv->next_stream_id)
{
/* we've just been told the direction for this one */
direction = self->priv->next_stream_direction;
pending_send = self->priv->next_stream_pending_send;
}
add_stream (..., direction, pending_send,
TP_MEDIA_STREAM_STATE_DISCONNECTED, ...);
...
}
(In reply to comment #0) > * c610252ee: mandate that CMs advertise the real direction by preceding each > StreamAdded with StreamDirectionChanged I can't find this commit in gitweb on that repository. In general, sounds sane. Fixed (in a slightly different way) in telepathy-spec 0.17.22 |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.