rtsp: add GType for transport flags

Make a method to register the transport flags as a GType.
This commit is contained in:
Wim Taymans 2010-03-19 15:00:01 +01:00
parent 58a92964c6
commit 6e8ed14a9d
3 changed files with 24 additions and 0 deletions

View file

@ -44,6 +44,7 @@
#define __GST_RTSP_DEFS_H__
#include <glib.h>
#include <glib-object.h>
G_BEGIN_DECLS

View file

@ -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) \

View file

@ -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