#include <vlc_network.h>
#include <vlc_plugin.h>
-#include <vlc_codecs.h>
-
#include "rtp.h"
#ifdef HAVE_SRTP
# include <srtp.h>
RTP_MAX_MISORDER_LONGTEXT, true)
change_integer_range (0, 32767)
- add_shortcut ("dccp")
/*add_shortcut ("sctp")*/
- add_shortcut ("rtptcp") /* "tcp" is already taken :( */
- add_shortcut ("rtp")
- add_shortcut ("udplite")
+ add_shortcut ("dccp", "rtptcp", /* "tcp" is already taken :( */
+ "rtp", "udplite")
vlc_module_end ()
/*
else
return VLC_EGENERIC;
- char *tmp = strdup (demux->psz_path);
- char *shost = tmp;
- if (shost == NULL)
+ char *tmp = strdup (demux->psz_location);
+ if (tmp == NULL)
return VLC_ENOMEM;
- char *dhost = strchr (shost, '@');
- if (dhost)
- *dhost++ = '\0';
+ char *shost;
+ char *dhost = strchr (tmp, '@');
+ if (dhost != NULL)
+ {
+ *(dhost++) = '\0';
+ shost = tmp;
+ }
+ else
+ {
+ dhost = tmp;
+ shost = NULL;
+ }
/* Parses the port numbers */
int sport = 0, dport = 0;
- sport = extract_port (&shost);
+ if (shost != NULL)
+ sport = extract_port (&shost);
if (dhost != NULL)
dport = extract_port (&dhost);
if (dport == 0)
#ifdef SOCK_DCCP
var_Create (obj, "dccp-service", VLC_VAR_STRING);
var_SetString (obj, "dccp-service", "RTPV"); /* FIXME: RTPA? */
- fd = net_Connect (obj, shost, sport, SOCK_DCCP, tp);
+ fd = net_Connect (obj, dhost, dport, SOCK_DCCP, tp);
#else
msg_Err (obj, "DCCP support not included");
#endif
break;
case IPPROTO_TCP:
- fd = net_Connect (obj, shost, sport, SOCK_STREAM, tp);
+ fd = net_Connect (obj, dhost, dport, SOCK_STREAM, tp);
break;
}
p_sys->rtcp_fd = rtcp_fd;
p_sys->caching = var_CreateGetInteger (obj, "rtp-caching");
p_sys->max_src = var_CreateGetInteger (obj, "rtp-max-src");
- p_sys->timeout = var_CreateGetInteger (obj, "rtp-timeout");
+ p_sys->timeout = var_CreateGetInteger (obj, "rtp-timeout")
+ * CLOCK_FREQ;
p_sys->max_dropout = var_CreateGetInteger (obj, "rtp-max-dropout");
p_sys->max_misorder = var_CreateGetInteger (obj, "rtp-max-misorder");
p_sys->framed_rtp = (tp == IPPROTO_TCP);
block_Release (block);
}
-
static void *stream_init (demux_t *demux, const char *name)
{
return stream_DemuxNew (demux, name, demux->out);
(void)demux;
}
+static void *demux_init (demux_t *demux)
+{
+ return stream_init (demux, demux->psz_demux);
+}
+
/*
* Static payload types handler
*/
break;
default:
- return -1;
+ /*
+ * If the rtp payload type is unknown then check demux if it is specified
+ */
+ if ((strcmp(demux->psz_demux, "h264") == 0) || (strcmp(demux->psz_demux, "ts") == 0))
+ {
+ msg_Dbg (demux, "rtp autodetect specified demux=%s", demux->psz_demux);
+ pt.init = demux_init;
+ pt.destroy = stream_destroy;
+ pt.decode = stream_decode;
+ pt.frequency = 90000;
+ break;
+ }
+ else
+ {
+ return -1;
+ }
}
rtp_add_type (demux, session, &pt);
return 0;