summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert McQueen <robert.mcqueen@collabora.co.uk>2006-10-10 10:28:16 +0000
committerRobert McQueen <robert.mcqueen@collabora.co.uk>2006-10-10 10:28:16 +0000
commitfcaa2e7a42aec5246a13a08294cc904d1c163f72 (patch)
treec27567ee3fd5f0f36f1c34a43c3f76e093f23541
parent6f1a212b73520c53013bb099b8196ff8f1b9badb (diff)
GabbleMediaStream: add a SetLocalCodecs which can be used to provide codecs after Ready, so that you can go ready for an incoming call and exchange candidates/codecs without knowing your local codecs
-rw-r--r--generate/src/gabble-media-stream.c21
-rw-r--r--generate/src/gabble-media-stream.h5
-rw-r--r--generate/xml-modified/gabble-media-stream.xml3
-rw-r--r--generate/xml-pristine/gabble-media-stream.xml3
-rw-r--r--src/gabble-media-stream.c50
-rw-r--r--src/gabble-media-stream.h5
6 files changed, 72 insertions, 15 deletions
diff --git a/generate/src/gabble-media-stream.c b/generate/src/gabble-media-stream.c
index f892d56fc..46adbec60 100644
--- a/generate/src/gabble-media-stream.c
+++ b/generate/src/gabble-media-stream.c
@@ -314,6 +314,27 @@ gabble_media_stream_ready (GabbleMediaStream *self,
/**
+ * gabble_media_stream_set_local_codecs
+ *
+ * Implements D-Bus method SetLocalCodecs
+ * on interface org.freedesktop.Telepathy.Media.StreamHandler
+ *
+ * @error: Used to return a pointer to a GError detailing any error
+ * that occurred, D-Bus will throw the error only if this
+ * function returns FALSE.
+ *
+ * Returns: TRUE if successful, FALSE if an error was thrown.
+ */
+gboolean
+gabble_media_stream_set_local_codecs (GabbleMediaStream *self,
+ const GPtrArray *codecs,
+ GError **error)
+{
+ return TRUE;
+}
+
+
+/**
* gabble_media_stream_stream_state
*
* Implements D-Bus method StreamState
diff --git a/generate/src/gabble-media-stream.h b/generate/src/gabble-media-stream.h
index 2555d0935..862ee76f7 100644
--- a/generate/src/gabble-media-stream.h
+++ b/generate/src/gabble-media-stream.h
@@ -88,6 +88,11 @@ gabble_media_stream_ready (GabbleMediaStream *self,
GError **error);
gboolean
+gabble_media_stream_set_local_codecs (GabbleMediaStream *self,
+ const GPtrArray *codecs,
+ GError **error);
+
+gboolean
gabble_media_stream_stream_state (GabbleMediaStream *self,
guint state,
GError **error);
diff --git a/generate/xml-modified/gabble-media-stream.xml b/generate/xml-modified/gabble-media-stream.xml
index f28d3ba26..103c1e810 100644
--- a/generate/xml-modified/gabble-media-stream.xml
+++ b/generate/xml-modified/gabble-media-stream.xml
@@ -32,6 +32,9 @@
<arg name="native_candidate_id" type="s"/>
<arg name="remote_candidate_id" type="s"/>
</signal>
+ <method name="SetLocalCodecs">
+ <arg direction="in" name="codecs" type="a(usuuua{ss})"/>
+ </method>
<signal name="SetRemoteCandidateList">
<arg name="remote_candidates" type="a(sa(usuussduss))"/>
</signal>
diff --git a/generate/xml-pristine/gabble-media-stream.xml b/generate/xml-pristine/gabble-media-stream.xml
index f28d3ba26..103c1e810 100644
--- a/generate/xml-pristine/gabble-media-stream.xml
+++ b/generate/xml-pristine/gabble-media-stream.xml
@@ -32,6 +32,9 @@
<arg name="native_candidate_id" type="s"/>
<arg name="remote_candidate_id" type="s"/>
</signal>
+ <method name="SetLocalCodecs">
+ <arg direction="in" name="codecs" type="a(usuuua{ss})"/>
+ </method>
<signal name="SetRemoteCandidateList">
<arg name="remote_candidates" type="a(sa(usuussduss))"/>
</signal>
diff --git a/src/gabble-media-stream.c b/src/gabble-media-stream.c
index 4ea9b8562..609b109e2 100644
--- a/src/gabble-media-stream.c
+++ b/src/gabble-media-stream.c
@@ -855,6 +855,41 @@ gabble_media_stream_ready (GabbleMediaStream *self,
priv = GABBLE_MEDIA_STREAM_GET_PRIVATE (self);
+ GMS_DEBUG_INFO (priv->session, "ready called");
+
+ g_object_set (self, "ready", TRUE, NULL);
+
+ push_remote_codecs (self);
+ push_remote_candidates (self);
+ push_playing (self);
+
+ return gabble_media_stream_set_local_codecs (self, codecs, error);
+}
+
+
+/**
+ * gabble_media_stream_set_local_codecs
+ *
+ * Implements D-Bus method SetLocalCodecs
+ * on interface org.freedesktop.Telepathy.Media.StreamHandler
+ *
+ * @error: Used to return a pointer to a GError detailing any error
+ * that occurred, D-Bus will throw the error only if this
+ * function returns FALSE.
+ *
+ * Returns: TRUE if successful, FALSE if an error was thrown.
+ */
+gboolean
+gabble_media_stream_set_local_codecs (GabbleMediaStream *self,
+ const GPtrArray *codecs,
+ GError **error)
+{
+ GabbleMediaStreamPrivate *priv;
+
+ g_assert (GABBLE_IS_MEDIA_STREAM (self));
+
+ priv = GABBLE_MEDIA_STREAM_GET_PRIVATE (self);
+
GMS_DEBUG_INFO (priv->session, "putting list of all %d locally supported "
"codecs from stream-engine into cache", codecs->len);
@@ -862,21 +897,6 @@ gabble_media_stream_ready (GabbleMediaStream *self,
g_object_set (self, "got-local-codecs", TRUE, NULL);
- push_remote_codecs (self);
- push_remote_candidates (self);
-
- if (priv->playing)
- {
- GMS_DEBUG_INFO (priv->session, "Media.StreamHandler::Ready called -- "
- "emitting playing now");
- g_signal_emit (self, signals[SET_STREAM_PLAYING], 0, TRUE);
- }
- else
- {
- GMS_DEBUG_INFO (priv->session, "Media.StreamHandler::Ready called -- "
- "emitting playing later");
- }
-
return TRUE;
}
diff --git a/src/gabble-media-stream.h b/src/gabble-media-stream.h
index fa04483dc..2d0333346 100644
--- a/src/gabble-media-stream.h
+++ b/src/gabble-media-stream.h
@@ -129,6 +129,11 @@ gabble_media_stream_ready (GabbleMediaStream *self,
GError **error);
gboolean
+gabble_media_stream_set_local_codecs (GabbleMediaStream *self,
+ const GPtrArray *codecs,
+ GError **error);
+
+gboolean
gabble_media_stream_stream_state (GabbleMediaStream *self,
guint state,
GError **error);