From 6e8ed14a9de9f2e8c869c2f2e5ebd7bad2f32c88 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Fri, 19 Mar 2010 15:00:01 +0100 Subject: [PATCH] rtsp: add GType for transport flags Make a method to register the transport flags as a GType. --- gst-libs/gst/rtsp/gstrtspdefs.h | 1 + gst-libs/gst/rtsp/gstrtsptransport.c | 20 ++++++++++++++++++++ gst-libs/gst/rtsp/gstrtsptransport.h | 3 +++ 3 files changed, 24 insertions(+) diff --git a/gst-libs/gst/rtsp/gstrtspdefs.h b/gst-libs/gst/rtsp/gstrtspdefs.h index 4986c90477..9652f179df 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 +#include G_BEGIN_DECLS diff --git a/gst-libs/gst/rtsp/gstrtsptransport.c b/gst-libs/gst/rtsp/gstrtsptransport.c index f509ca90e5..5027243608 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 71c1c5b1a7..5ceb567ff9 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