pidgin.vv: a617f86b: Make FsStreamDirection and FsMediaType c...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Fri Jan 9 20:36:05 EST 2009


-----------------------------------------------------------------
Revision: a617f86bc9f9f151daef5b0980c124f94f277f9a
Ancestor: e00715f97e9c1357a19cfc29c634097b37561020
Author: maiku at soc.pidgin.im
Date: 2009-01-10T01:24:49
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/a617f86bc9f9f151daef5b0980c124f94f277f9a

Modified files:
        libpurple/media.c libpurple/media.h
        libpurple/protocols/jabber/jingle/rtp.c

ChangeLog: 

Make FsStreamDirection and FsMediaType conversion functions static.

-------------- next part --------------
============================================================
--- libpurple/media.c	ace1525a6274e3b80cffb467edbc664aecc4bf78
+++ libpurple/media.c	b3536ede0827a166dd8d007a403fb99028089c0c
@@ -413,7 +413,7 @@ purple_media_get_property (GObject *obje
 
 }
 
-FsMediaType
+static FsMediaType
 purple_media_to_fs_media_type(PurpleMediaSessionType type)
 {
 	if (type & PURPLE_MEDIA_AUDIO)
@@ -424,7 +424,7 @@ purple_media_to_fs_media_type(PurpleMedi
 		return 0;
 }
 
-FsStreamDirection
+static FsStreamDirection
 purple_media_to_fs_stream_direction(PurpleMediaSessionType type)
 {
 	if ((type & PURPLE_MEDIA_AUDIO) == PURPLE_MEDIA_AUDIO ||
@@ -440,7 +440,7 @@ purple_media_to_fs_stream_direction(Purp
 		return FS_DIRECTION_NONE;
 }
 
-PurpleMediaSessionType
+static PurpleMediaSessionType
 purple_media_from_fs(FsMediaType type, FsStreamDirection direction)
 {
 	PurpleMediaSessionType result = PURPLE_MEDIA_NONE;
============================================================
--- libpurple/media.h	2170d6e00a7595eff91696efd40fea7b133570dd
+++ libpurple/media.h	7ddd44c1985454931380ffd564f51304910803c4
@@ -109,42 +109,7 @@ GType purple_media_state_changed_get_typ
  */
 GType purple_media_state_changed_get_type(void);
 
-/**************************************************************************/
-/** @name Media Utility Functions                                         */
-/**************************************************************************/
-/*@{*/
-
 /**
- * Converts a PurpleMediaSessionType to an FsMediaType.
- *
- * @param type The type to derive FsMediaType from
- *
- * @return The FsMediaType derived from type
- */
-FsMediaType purple_media_to_fs_media_type(PurpleMediaSessionType type);
-
-/**
- * Converts a PurpleMediaSessionType to an FsStreamDirection.
- *
- * @param type The type to derive FsMediaType from
- *
- * @return The FsMediaDirection derived from type
- */
-FsStreamDirection purple_media_to_fs_stream_direction(PurpleMediaSessionType type);
-
-/**
- * Converts an FsMediaType and FsStreamDirection into a PurpleMediaSessionType.
- *
- * @param type The type used to construct PurpleMediaSessionType
- * @param direction The direction used to construct PurpleMediaSessionType
- *
- * @return The PurpleMediaSessionType constructed
- */
-PurpleMediaSessionType purple_media_from_fs(FsMediaType type, FsStreamDirection direction);
-
-/*@}*/
-
-/**
  * Combines all the separate session types into a single PurpleMediaSessionType.
  *
  * @param media The media session to retrieve session types from.
============================================================
--- libpurple/protocols/jabber/jingle/rtp.c	1124fe18fae919593202cb553e7b535e7b65e1a6
+++ libpurple/protocols/jabber/jingle/rtp.c	7b6ede10e55267142adb56c5f898221be57f3f8d
@@ -372,8 +372,8 @@ jingle_rtp_init_media(JingleContent *con
 	gchar *senders;
 	gchar *name;
 	const gchar *transmitter;
-	FsMediaType type;
-	FsStreamDirection direction;
+	gboolean is_audio;
+	PurpleMediaSessionType type;
 	JingleTransport *transport;
 
 	/* maybe this create ought to just be in initiate and handle initiate */
@@ -396,24 +396,22 @@ jingle_rtp_init_media(JingleContent *con
 	else
 		transmitter = "notransmitter";
 
-	if (!strcmp(media_type, "audio"))
-		type = FS_MEDIA_TYPE_AUDIO;
-	else
-		type = FS_MEDIA_TYPE_VIDEO;
+	is_audio = !strcmp(media_type, "audio");
 
 	if (!strcmp(senders, "both"))
-		direction = FS_DIRECTION_BOTH;
+		type = is_audio == TRUE ? PURPLE_MEDIA_AUDIO
+				: PURPLE_MEDIA_VIDEO;
 	else if (!strcmp(senders, "initiator")
 			&& jingle_session_is_initiator(session))
-		direction = FS_DIRECTION_SEND;
+		type = is_audio == TRUE ? PURPLE_MEDIA_SEND_AUDIO
+				: PURPLE_MEDIA_SEND_VIDEO;
 	else
-		direction = FS_DIRECTION_RECV;
+		type = is_audio == TRUE ? PURPLE_MEDIA_RECV_AUDIO
+				: PURPLE_MEDIA_RECV_VIDEO;
 
 	purple_media_add_stream(media, name, remote_jid,
-			purple_media_from_fs(type, direction),
-			transmitter, 0, NULL);
+			type, transmitter, 0, NULL);
 
-
 	g_free(name);
 	g_free(media_type);
 	g_free(remote_jid);


More information about the Commits mailing list