diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2010-03-19 15:00:01 +0100 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2010-03-19 15:00:01 +0100 |
commit | 6e8ed14a9de9f2e8c869c2f2e5ebd7bad2f32c88 (patch) | |
tree | 9c6f268129056dfceaa9d7ca24df01d68156f535 | |
parent | 58a92964c6e4333953b33108591eb982b3237816 (diff) |
rtsp: add GType for transport flags
Make a method to register the transport flags as a GType.
-rw-r--r-- | gst-libs/gst/rtsp/gstrtspdefs.h | 1 | ||||
-rw-r--r-- | gst-libs/gst/rtsp/gstrtsptransport.c | 20 | ||||
-rw-r--r-- | gst-libs/gst/rtsp/gstrtsptransport.h | 3 |
3 files changed, 24 insertions, 0 deletions
diff --git a/gst-libs/gst/rtsp/gstrtspdefs.h b/gst-libs/gst/rtsp/gstrtspdefs.h index 4986c9047..9652f179d 100644 --- a/gst-libs/gst/rtsp/gstrtspdefs.h +++ b/gst-libs/gst/rtsp/gstrtspdefs.h @@ -44,6 +44,7 @@ #define __GST_RTSP_DEFS_H__ #include <glib.h> +#include <glib-object.h> G_BEGIN_DECLS diff --git a/gst-libs/gst/rtsp/gstrtsptransport.c b/gst-libs/gst/rtsp/gstrtsptransport.c index f509ca90e..502724360 100644 --- a/gst-libs/gst/rtsp/gstrtsptransport.c +++ b/gst-libs/gst/rtsp/gstrtsptransport.c @@ -117,6 +117,26 @@ static const RTSPLTransMap ltrans[] = { {NULL, GST_RTSP_LOWER_TRANS_UNKNOWN} }; + +GType +gst_rtsp_lower_trans_get_type (void) +{ + static GType rtsp_lower_trans_type = 0; + static const GFlagsValue rtsp_lower_trans[] = { + {GST_RTSP_LOWER_TRANS_UDP, "UDP Unicast Mode", "udp-unicast"}, + {GST_RTSP_LOWER_TRANS_UDP_MCAST, "UDP Multicast Mode", "udp-multicast"}, + {GST_RTSP_LOWER_TRANS_TCP, "TCP interleaved mode", "tcp"}, + {GST_RTSP_LOWER_TRANS_HTTP, "HTTP tunneled mode", "http"}, + {0, NULL, NULL}, + }; + + if (!rtsp_lower_trans_type) { + rtsp_lower_trans_type = + g_flags_register_static ("GstRTSPLowerTrans", rtsp_lower_trans); + } + return rtsp_lower_trans_type; +} + #define RTSP_TRANSPORT_PARAMETER_IS_UNIQUE(param) \ G_STMT_START { \ if ((transport_params & (param)) != 0) \ diff --git a/gst-libs/gst/rtsp/gstrtsptransport.h b/gst-libs/gst/rtsp/gstrtsptransport.h index 71c1c5b1a..5ceb567ff 100644 --- a/gst-libs/gst/rtsp/gstrtsptransport.h +++ b/gst-libs/gst/rtsp/gstrtsptransport.h @@ -93,6 +93,9 @@ typedef enum { GST_RTSP_LOWER_TRANS_HTTP = (1 << 4) } GstRTSPLowerTrans; +#define GST_TYPE_RTSP_LOWER_TRANS (gst_rtsp_lower_trans_get_type()) +GType gst_rtsp_lower_trans_get_type (void); + /** * GstRTSPRange: * @min: minimum value of the range |