diff options
author | Will Thompson <will.thompson@collabora.co.uk> | 2012-02-17 12:07:07 +0000 |
---|---|---|
committer | Will Thompson <will.thompson@collabora.co.uk> | 2012-02-23 12:46:24 +0000 |
commit | f40f6c4db3079aa7b4befe70c8a709d49144cc6f (patch) | |
tree | a64bd9dfa4e6fafd448ccc789202bd4fd8e5a0eb /src | |
parent | 51ec259c494d42c30adfb982646eda2805b2ec3d (diff) |
Split Telepathy<->Jingle enum mapping out of Jingle code
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/base-call-channel.c | 1 | ||||
-rw-r--r-- | src/call-channel.c | 1 | ||||
-rw-r--r-- | src/call-content.c | 1 | ||||
-rw-r--r-- | src/call-muc-channel.c | 1 | ||||
-rw-r--r-- | src/jingle-content.c | 29 | ||||
-rw-r--r-- | src/jingle-content.h | 3 | ||||
-rw-r--r-- | src/jingle-tp-util.c | 48 | ||||
-rw-r--r-- | src/jingle-tp-util.h | 29 |
9 files changed, 83 insertions, 32 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index c221b4ca0..35f6a29a3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -103,6 +103,8 @@ libgabble_convenience_la_SOURCES = \ jingle-media-rtp.c \ jingle-session.h \ jingle-session.c \ + jingle-tp-util.h \ + jingle-tp-util.c \ jingle-transport-google.h \ jingle-transport-google.c \ jingle-transport-rawudp.h \ diff --git a/src/base-call-channel.c b/src/base-call-channel.c index 4647a79ef..321e3da4d 100644 --- a/src/base-call-channel.c +++ b/src/base-call-channel.c @@ -41,6 +41,7 @@ #include "base-call-channel.h" #include "connection.h" #include "jingle-session.h" +#include "jingle-tp-util.h" #define DEBUG_FLAG GABBLE_DEBUG_MEDIA #include "debug.h" diff --git a/src/call-channel.c b/src/call-channel.c index 20847f528..affa8390c 100644 --- a/src/call-channel.c +++ b/src/call-channel.c @@ -39,6 +39,7 @@ #include "connection.h" #include "jingle-session.h" +#include "jingle-tp-util.h" #include "presence-cache.h" #define DEBUG_FLAG GABBLE_DEBUG_MEDIA diff --git a/src/call-content.c b/src/call-content.c index 862d10457..8ca94be97 100644 --- a/src/call-content.c +++ b/src/call-content.c @@ -34,6 +34,7 @@ #include "jingle-content.h" #include "jingle-session.h" #include "jingle-media-rtp.h" +#include "jingle-tp-util.h" #include "connection.h" #include "util.h" diff --git a/src/call-muc-channel.c b/src/call-muc-channel.c index 90e949a67..fdd5e7107 100644 --- a/src/call-muc-channel.c +++ b/src/call-muc-channel.c @@ -33,6 +33,7 @@ #include "call-muc-channel.h" #include "util.h" #include "namespaces.h" +#include "jingle-tp-util.h" #define DEBUG_FLAG GABBLE_DEBUG_MEDIA diff --git a/src/jingle-content.c b/src/jingle-content.c index fee3a645a..7d701e066 100644 --- a/src/jingle-content.c +++ b/src/jingle-content.c @@ -1407,32 +1407,3 @@ gabble_jingle_content_request_receiving (GabbleJingleContent *self, else gabble_jingle_content_change_direction (self, senders); } - - -JingleMediaType -jingle_media_type_from_tp (TpMediaStreamType type) -{ - switch (type) - { - case TP_MEDIA_STREAM_TYPE_AUDIO: - return JINGLE_MEDIA_TYPE_AUDIO; - case TP_MEDIA_STREAM_TYPE_VIDEO: - return JINGLE_MEDIA_TYPE_VIDEO; - default: - g_return_val_if_reached (JINGLE_MEDIA_TYPE_NONE); - } -} - -TpMediaStreamType -jingle_media_type_to_tp (JingleMediaType type) -{ - switch (type) - { - case JINGLE_MEDIA_TYPE_AUDIO: - return TP_MEDIA_STREAM_TYPE_AUDIO; - case JINGLE_MEDIA_TYPE_VIDEO: - return TP_MEDIA_STREAM_TYPE_VIDEO; - default: - g_return_val_if_reached (TP_MEDIA_STREAM_TYPE_AUDIO); - } -} diff --git a/src/jingle-content.h b/src/jingle-content.h index 955243c45..d85eb7e67 100644 --- a/src/jingle-content.h +++ b/src/jingle-content.h @@ -158,8 +158,5 @@ void gabble_jingle_content_request_receiving (GabbleJingleContent *self, void gabble_jingle_content_send_complete (GabbleJingleContent *self); -JingleMediaType jingle_media_type_from_tp (TpMediaStreamType type); -TpMediaStreamType jingle_media_type_to_tp (JingleMediaType type); - #endif /* __JINGLE_CONTENT_H__ */ diff --git a/src/jingle-tp-util.c b/src/jingle-tp-util.c new file mode 100644 index 000000000..a4a87c726 --- /dev/null +++ b/src/jingle-tp-util.c @@ -0,0 +1,48 @@ +/* + * jingle-tp-util.c - Telepathy-flavoured Jingle utility functions + * Copyright © 2008–2012 Collabora Ltd. + * + * 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 "jingle-tp-util.h" + +JingleMediaType +jingle_media_type_from_tp (TpMediaStreamType type) +{ + switch (type) + { + case TP_MEDIA_STREAM_TYPE_AUDIO: + return JINGLE_MEDIA_TYPE_AUDIO; + case TP_MEDIA_STREAM_TYPE_VIDEO: + return JINGLE_MEDIA_TYPE_VIDEO; + default: + g_return_val_if_reached (JINGLE_MEDIA_TYPE_NONE); + } +} + +TpMediaStreamType +jingle_media_type_to_tp (JingleMediaType type) +{ + switch (type) + { + case JINGLE_MEDIA_TYPE_AUDIO: + return TP_MEDIA_STREAM_TYPE_AUDIO; + case JINGLE_MEDIA_TYPE_VIDEO: + return TP_MEDIA_STREAM_TYPE_VIDEO; + default: + g_return_val_if_reached (TP_MEDIA_STREAM_TYPE_AUDIO); + } +} diff --git a/src/jingle-tp-util.h b/src/jingle-tp-util.h new file mode 100644 index 000000000..45261f6ad --- /dev/null +++ b/src/jingle-tp-util.h @@ -0,0 +1,29 @@ +/* + * jingle-tp-util.h - Header for Telepathy-flavoured Jingle utility functions + * Copyright © 2008–2012 Collabora Ltd. + * + * 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 + */ + +#ifndef GABBLE_JINGLE_TP_UTIL_H +#define GABBLE_JINGLE_TP_UTIL_H + +#include <telepathy-glib/telepathy-glib.h> +#include "jingle-content.h" + +JingleMediaType jingle_media_type_from_tp (TpMediaStreamType type); +TpMediaStreamType jingle_media_type_to_tp (JingleMediaType type); + +#endif /* GABBLE_JINGLE_TP_UTIL_H */ |