Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc-2-2
Commits
d8ae255f
Commit
d8ae255f
authored
Feb 05, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
UDP-Lite access
This is completely untested because vlc does not link at the moment :(
parent
5237e0c5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
57 additions
and
39 deletions
+57
-39
NEWS
NEWS
+3
-0
configure.ac
configure.ac
+1
-1
include/vlc_network.h
include/vlc_network.h
+2
-2
modules/access/udp.c
modules/access/udp.c
+42
-29
src/network/udp.c
src/network/udp.c
+9
-7
No files found.
NEWS
View file @
d8ae255f
...
...
@@ -28,6 +28,9 @@ Playlist:
* Shoutcast TV listings
* Audioscrobbler/last.fm support
Input/Demuxers:
* Support for UDP-Lite (requires OS support) for UDP-Raw and RTP
Decoders:
* VP60/VP61 codecs support
...
...
configure.ac
View file @
d8ae255f
...
...
@@ -766,7 +766,7 @@ AC_EGREP_HEADER(strncasecmp,strings.h,[
dnl Check for headers
AC_CHECK_HEADERS(signal.h time.h errno.h stdint.h stdbool.h getopt.h strings.h inttypes.h sys/int_types.h wchar.h)
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h)
AC_CHECK_HEADERS(
arpa/inet.h net/if.h netinet/in.h sys/socket.h
)
AC_CHECK_HEADERS(
[arpa/inet.h net/if.h netinet/in.h sys/socket.h netinet/udplite.h]
)
if test "${SYS}" != "mingw32" -a "${SYS}" != "mingwce"; then
AC_CHECK_HEADERS(machine/param.h sys/shm.h)
AC_CHECK_HEADERS(linux/version.h)
...
...
include/vlc_network.h
View file @
d8ae255f
...
...
@@ -91,8 +91,8 @@ static inline int net_ListenUDP1 (vlc_object_t *obj, const char *host, int port)
return
net_ListenSingle
(
obj
,
host
,
port
,
AF_UNSPEC
,
SOCK_DGRAM
,
IPPROTO_UDP
);
}
#define net_Open
UDP(a, b, c, d, e ) __net_OpenUDP(VLC_OBJECT(a), b, c, d, e
)
VLC_EXPORT
(
int
,
__net_Open
UDP
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_bind
,
int
i_bind
,
const
char
*
psz_server
,
int
i_server
)
);
#define net_Open
Dgram( a, b, c, d, e, g, h ) __net_OpenDgram(VLC_OBJECT(a), b, c, d, e, g, h
)
VLC_EXPORT
(
int
,
__net_Open
Dgram
,
(
vlc_object_t
*
p_this
,
const
char
*
psz_bind
,
int
i_bind
,
const
char
*
psz_server
,
int
i_server
,
int
family
,
int
proto
)
);
VLC_EXPORT
(
void
,
net_Close
,
(
int
fd
)
);
VLC_EXPORT
(
void
,
net_ListenClose
,
(
int
*
fd
)
);
...
...
modules/access/udp.c
View file @
d8ae255f
...
...
@@ -35,6 +35,21 @@
#include <vlc_access.h>
#include <vlc_network.h>
#if defined (HAVE_NETINET_UDPLITE_H)
# include <netinet/udplite.h>
#elif defined (__linux__)
# define UDPLITE_SEND_CSCOV 10
# define UDPLITE_RECV_CSCOV 11
#endif
#ifndef IPPROTO_UDPLITE
# define IPPROTO_UDPLITE 136
/* from IANA */
#endif
#ifndef SOL_UDPLITE
# define SOL_UDPLITE IPPROTO_UDPLITE
#endif
/*****************************************************************************
* Module descriptor
*****************************************************************************/
...
...
@@ -77,6 +92,9 @@ vlc_module_begin();
add_shortcut
(
"rtp"
);
add_shortcut
(
"rtp4"
);
add_shortcut
(
"rtp6"
);
add_shortcut
(
"udplite"
);
add_shortcut
(
"rtplite"
);
set_callbacks
(
Open
,
Close
);
vlc_module_end
();
...
...
@@ -116,34 +134,25 @@ static int Open( vlc_object_t *p_this )
char
*
psz_parser
;
const
char
*
psz_server_addr
,
*
psz_bind_addr
=
""
;
int
i_bind_port
,
i_server_port
=
0
;
int
fam
=
AF_UNSPEC
,
proto
=
IPPROTO_UDP
,
cscov
=
8
;
/* First set ipv4/ipv6 */
var_Create
(
p_access
,
"ipv4"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
var_Create
(
p_access
,
"ipv6"
,
VLC_VAR_BOOL
|
VLC_VAR_DOINHERIT
);
if
(
*
p_access
->
psz_access
)
{
vlc_value_t
val
;
/* Find out which shortcut was used */
if
(
!
strncmp
(
p_access
->
psz_access
,
"udp4"
,
6
)
||
!
strncmp
(
p_access
->
psz_access
,
"rtp4"
,
6
))
if
(
strlen
(
p_access
->
psz_access
)
>=
4
)
switch
(
p_access
->
psz_access
[
3
])
{
val
.
b_bool
=
VLC_TRUE
;
var_Set
(
p_access
,
"ipv4"
,
val
);
case
'4'
:
fam
=
AF_INET
;
break
;
val
.
b_bool
=
VLC_FALSE
;
var_Set
(
p_access
,
"ipv6"
,
val
);
case
'6'
:
fam
=
AF_INET6
;
break
;
}
else
if
(
!
strncmp
(
p_access
->
psz_access
,
"udp6"
,
6
)
||
!
strncmp
(
p_access
->
psz_access
,
"rtp6"
,
6
)
)
{
val
.
b_bool
=
VLC_TRUE
;
var_Set
(
p_access
,
"ipv6"
,
val
);
val
.
b_bool
=
VLC_FALSE
;
var_Set
(
p_access
,
"ipv4"
,
val
);
}
}
if
(
strcmp
(
p_access
->
psz_access
+
3
,
"lite"
)
==
0
)
proto
=
IPPROTO_UDPLITE
;
if
(
strncmp
(
p_access
->
psz_access
,
"rtp"
,
3
)
==
0
)
/* Checksum coverage: RTP header is AT LEAST 12 bytes
* in addition to UDP header (8 bytes) */
cscov
+=
12
;
i_bind_port
=
var_CreateGetInteger
(
p_access
,
"server-port"
);
...
...
@@ -195,19 +204,23 @@ static int Open( vlc_object_t *p_this )
p_access
->
info
.
b_prebuffered
=
VLC_FALSE
;
MALLOC_ERR
(
p_access
->
p_sys
,
access_sys_t
);
p_sys
=
p_access
->
p_sys
;
p_sys
->
fd
=
net_OpenUDP
(
p_access
,
psz_bind_addr
,
i_bind_port
,
psz_server_addr
,
i_server_port
);
if
(
p_sys
->
fd
<
0
)
p_sys
->
fd
=
net_Open
(
p_access
,
psz_bind_addr
,
i_bind_port
,
psz_server_addr
,
i_server_port
,
fam
,
SOCK_DGRAM
,
proto
);
free
(
psz_name
);
if
(
p_sys
->
fd
==
-
1
)
{
msg_Err
(
p_access
,
"cannot open socket"
);
free
(
psz_name
);
free
(
p_sys
);
return
VLC_EGENERIC
;
}
free
(
psz_name
);
net_StopSend
(
p_sys
->
fd
);
#ifdef UDPLITE_RECV_CSCOV
if
(
proto
==
IPPROTO_UDPLITE
)
setsockopt
(
p_sys
->
fd
,
SOL_UDPLITE
,
UDPLITE_RECV_CSCOV
,
&
cscov
,
sizeof
(
cscov
));
#endif
/* FIXME */
p_sys
->
i_mtu
=
var_CreateGetInteger
(
p_access
,
"mtu"
);
if
(
p_sys
->
i_mtu
<=
1
)
...
...
src/network/udp.c
View file @
d8ae255f
...
...
@@ -618,25 +618,27 @@ int __net_ConnectUDP( vlc_object_t *p_this, const char *psz_host, int i_port,
/*****************************************************************************
* __net_Open
UDP
:
* __net_Open
Dgram
:
*****************************************************************************
* Open
a UDP connection
and return a handle
* Open
Dgram a datagram socket
and return a handle
*****************************************************************************/
int
__net_OpenUDP
(
vlc_object_t
*
obj
,
const
char
*
psz_bind
,
int
i_bind
,
const
char
*
psz_server
,
int
i_server
)
int
__net_OpenDgram
(
vlc_object_t
*
obj
,
const
char
*
psz_bind
,
int
i_bind
,
const
char
*
psz_server
,
int
i_server
,
int
family
,
int
protocol
)
{
struct
addrinfo
hints
,
*
loc
,
*
rem
;
int
val
;
if
(
!*
psz_server
)
return
net_ListenUDP1
(
obj
,
psz_bind
,
i_bind
);
return
net_ListenSingle
(
obj
,
psz_bind
,
i_bind
,
family
,
SOCK_DGRAM
,
protocol
);
msg_Dbg
(
obj
,
"net: connecting to [%s]:%d from [%s]:%d"
,
psz_server
,
i_server
,
psz_bind
,
i_bind
);
memset
(
&
hints
,
0
,
sizeof
(
hints
));
hints
.
ai_family
=
family
;
hints
.
ai_socktype
=
SOCK_DGRAM
;
hints
.
ai_protocol
=
IPPROTO_UDP
;
hints
.
ai_flags
=
AI_PASSIVE
;
val
=
vlc_getaddrinfo
(
obj
,
psz_server
,
i_server
,
&
hints
,
&
rem
);
...
...
@@ -659,7 +661,7 @@ int __net_OpenUDP( vlc_object_t *obj, const char *psz_bind, int i_bind,
for
(
struct
addrinfo
*
ptr
=
loc
;
ptr
!=
NULL
;
ptr
=
ptr
->
ai_next
)
{
int
fd
=
net_Socket
(
obj
,
ptr
->
ai_family
,
ptr
->
ai_socktype
,
ptr
->
ai_protocol
);
p
rotocol
?:
p
tr
->
ai_protocol
);
if
(
fd
==
-
1
)
continue
;
// usually, address family not supported
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment