[vlc-devel] commit: RTP: add UDP-Lite support ( Rémi Denis-Courmont )
git version control
git at videolan.org
Wed Jun 4 21:29:03 CEST 2008
vlc | branch: master | Rémi Denis-Courmont <rdenis at simphalempin.com> | Wed Jun 4 22:30:13 2008 +0300| [7636aceaee9cff1ec11710848d0822132189a46f]
RTP: add UDP-Lite support
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7636aceaee9cff1ec11710848d0822132189a46f
---
modules/demux/rtp.c | 22 +++++++++++++++++++---
1 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/modules/demux/rtp.c b/modules/demux/rtp.c
index 2652dc7..4254796 100644
--- a/modules/demux/rtp.c
+++ b/modules/demux/rtp.c
@@ -89,6 +89,7 @@ vlc_module_begin ();
change_integer_range (0, 32767);
add_shortcut ("rtp");
+ add_shortcut ("udplite");
vlc_module_end ();
/*
@@ -99,6 +100,15 @@ vlc_module_end ();
* - support for access_filter in case of stream_Demux (MPEG-TS)
*/
+#ifndef IPPROTO_DCCP
+# define IPPROTO_DCCP 33 /* IANA */
+#endif
+
+#ifndef IPPROTO_UDPLITE
+# define IPPROTO_UDPLITE 136 /* from IANA */
+#endif
+
+
/*
* Local prototypes
*/
@@ -112,8 +122,14 @@ static int extract_port (char **phost);
static int Open (vlc_object_t *obj)
{
demux_t *demux = (demux_t *)obj;
+ int tp; /* transport protocol */
- if (strcmp (demux->psz_access, "rtp"))
+ if (!strcmp (demux->psz_access, "rtp"))
+ tp = IPPROTO_UDP;
+ else
+ if (!strcmp (demux->psz_access, "udplite"))
+ tp = IPPROTO_UDPLITE;
+ else
return VLC_EGENERIC;
char *tmp = strdup (demux->psz_path);
@@ -134,11 +150,11 @@ static int Open (vlc_object_t *obj)
dport = 5004; /* avt-profile-1 port */
/* Try to connect */
- int fd = net_OpenDgram (obj, dhost, dport, shost, sport,
- AF_UNSPEC, IPPROTO_UDP);
+ int fd = net_OpenDgram (obj, dhost, dport, shost, sport, AF_UNSPEC, tp);
free (tmp);
if (fd == -1)
return VLC_EGENERIC;
+ net_SetCSCov (fd, -1, 12);
/* Initializes demux */
demux_sys_t *p_sys = malloc (sizeof (*p_sys));
More information about the vlc-devel
mailing list