maiku.vv: fbed2ea1: Add purple_media_manager_get_element.
maiku at soc.pidgin.im
maiku at soc.pidgin.im
Wed Nov 5 21:15:45 EST 2008
-----------------------------------------------------------------
Revision: fbed2ea188bd9ae48534251b5d3e5b6cd694fe2f
Ancestor: f846f6d1666fd01c7635eac6c3bf876b2946e93a
Author: maiku at soc.pidgin.im
Date: 2008-11-06T01:32:58
Branch: im.pidgin.maiku.vv
URL: http://d.pidgin.im/viewmtn/revision/info/fbed2ea188bd9ae48534251b5d3e5b6cd694fe2f
Modified files:
libpurple/mediamanager.c libpurple/mediamanager.h
ChangeLog:
Add purple_media_manager_get_element.
-------------- next part --------------
============================================================
--- libpurple/mediamanager.c 96dc0d6b82d566b9efe7818a915f5babd0a24fff
+++ libpurple/mediamanager.c f2401deae588a60270f3bacf0b7b2578edeacf38
@@ -199,4 +199,29 @@ purple_media_manager_remove_media(Purple
g_list_delete_link(manager->priv->medias, list);
}
+GstElement *
+purple_media_manager_get_element(PurpleMediaManager *manager,
+ PurpleMediaSessionType type)
+{
+ GstElement *ret = NULL;
+ GstElement *level = NULL;
+
+ /* TODO: If src, retrieve current src */
+ /* TODO: Send a signal here to allow for overriding the source/sink */
+
+ if (type & PURPLE_MEDIA_SEND_AUDIO)
+ purple_media_audio_init_src(&ret, &level);
+ else if (type & PURPLE_MEDIA_RECV_AUDIO)
+ purple_media_audio_init_recv(&ret, &level);
+ else if (type & PURPLE_MEDIA_SEND_VIDEO)
+ purple_media_video_init_src(&ret);
+ else if (type & PURPLE_MEDIA_RECV_VIDEO)
+ purple_media_video_init_recv(&ret);
+
+ if (ret == NULL)
+ purple_debug_error("media", "Error creating source or sink\n");
+
+ return ret;
+}
+
#endif /* USE_VV */
============================================================
--- libpurple/mediamanager.h be079e183348622c80191c6bc685a7f356c69179
+++ libpurple/mediamanager.h d9f2864b11a4039f0cd102fb25337171a1573ea2
@@ -123,6 +123,15 @@ purple_media_manager_remove_media(Purple
purple_media_manager_remove_media(PurpleMediaManager *manager,
PurpleMedia *media);
+/**
+ * Returns a GStreamer source or sink for audio or video.
+ *
+ * @param manager The media manager to use to obtain the source/sink.
+ * @param type The type of source/sink to get.
+ */
+GstElement *purple_media_manager_get_element(PurpleMediaManager *manager,
+ PurpleMediaSessionType type);
+
/*}@*/
#ifdef __cplusplus
More information about the Commits
mailing list