Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-1.1
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-1.1
Commits
51a5b2be
Commit
51a5b2be
authored
Jun 07, 2008
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RTP: add Framed RTP over TCP support
(untested as I have no software capable of sending this)
parent
1b441157
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
1 deletion
+53
-1
modules/demux/rtp.c
modules/demux/rtp.c
+52
-1
modules/demux/rtp.h
modules/demux/rtp.h
+1
-0
No files found.
modules/demux/rtp.c
View file @
51a5b2be
...
@@ -92,6 +92,8 @@ vlc_module_begin ();
...
@@ -92,6 +92,8 @@ vlc_module_begin ();
change_integer_range
(
0
,
32767
);
change_integer_range
(
0
,
32767
);
add_shortcut
(
"dccp"
);
add_shortcut
(
"dccp"
);
/*add_shortcut ("sctp");*/
add_shortcut
(
"rtptcp"
);
/* "tcp" is already taken :( */
add_shortcut
(
"rtp"
);
add_shortcut
(
"rtp"
);
add_shortcut
(
"udplite"
);
add_shortcut
(
"udplite"
);
vlc_module_end
();
vlc_module_end
();
...
@@ -131,6 +133,9 @@ static int Open (vlc_object_t *obj)
...
@@ -131,6 +133,9 @@ static int Open (vlc_object_t *obj)
if
(
!
strcmp
(
demux
->
psz_access
,
"dccp"
))
if
(
!
strcmp
(
demux
->
psz_access
,
"dccp"
))
tp
=
IPPROTO_DCCP
;
tp
=
IPPROTO_DCCP
;
else
else
if
(
!
strcmp
(
demux
->
psz_access
,
"rtptcp"
))
tp
=
IPPROTO_TCP
;
else
if
(
!
strcmp
(
demux
->
psz_access
,
"rtp"
))
if
(
!
strcmp
(
demux
->
psz_access
,
"rtp"
))
tp
=
IPPROTO_UDP
;
tp
=
IPPROTO_UDP
;
else
else
...
@@ -181,6 +186,10 @@ static int Open (vlc_object_t *obj)
...
@@ -181,6 +186,10 @@ static int Open (vlc_object_t *obj)
msg_Err
(
obj
,
"DCCP support not included"
);
msg_Err
(
obj
,
"DCCP support not included"
);
#endif
#endif
break
;
break
;
case
IPPROTO_TCP
:
fd
=
net_Connect
(
obj
,
shost
,
sport
,
SOCK_STREAM
,
tp
);
break
;
}
}
free
(
tmp
);
free
(
tmp
);
...
@@ -199,6 +208,7 @@ static int Open (vlc_object_t *obj)
...
@@ -199,6 +208,7 @@ static int Open (vlc_object_t *obj)
p_sys
->
max_dropout
=
var_CreateGetInteger
(
obj
,
"rtp-max-dropout"
);
p_sys
->
max_dropout
=
var_CreateGetInteger
(
obj
,
"rtp-max-dropout"
);
p_sys
->
max_misorder
=
var_CreateGetInteger
(
obj
,
"rtp-max-misorder"
);
p_sys
->
max_misorder
=
var_CreateGetInteger
(
obj
,
"rtp-max-misorder"
);
p_sys
->
autodetect
=
true
;
p_sys
->
autodetect
=
true
;
p_sys
->
framed_rtp
=
(
tp
==
IPPROTO_TCP
);
demux
->
pf_demux
=
Demux
;
demux
->
pf_demux
=
Demux
;
demux
->
pf_control
=
Control
;
demux
->
pf_control
=
Control
;
...
@@ -331,6 +341,45 @@ static block_t *rtp_dgram_recv (demux_t *demux, int fd)
...
@@ -331,6 +341,45 @@ static block_t *rtp_dgram_recv (demux_t *demux, int fd)
return
block_Realloc
(
block
,
0
,
len
);
return
block_Realloc
(
block
,
0
,
len
);
}
}
/**
* Gets a framed RTP packet, or NULL in case of fatal error.
*/
static
block_t
*
rtp_stream_recv
(
demux_t
*
demux
,
int
fd
)
{
ssize_t
len
=
0
;
uint8_t
hdr
[
2
];
/* frame header */
/* Receives the RTP frame header */
do
{
ssize_t
val
=
net_Read
(
VLC_OBJECT
(
demux
),
fd
,
NULL
,
hdr
+
len
,
2
-
len
,
false
);
if
(
val
<=
0
)
return
NULL
;
len
+=
val
;
}
while
(
len
<
2
);
block_t
*
block
=
block_Alloc
(
GetWBE
(
hdr
));
/* Receives the RTP packet */
for
(
ssize_t
i
=
0
;
i
<
len
;)
{
ssize_t
val
;
val
=
net_Read
(
VLC_OBJECT
(
demux
),
fd
,
NULL
,
block
->
p_buffer
+
i
,
block
->
i_buffer
-
i
,
false
);
if
(
val
<=
0
)
{
block_Release
(
block
);
return
NULL
;
}
i
+=
val
;
}
return
block
;
}
/*
/*
* Generic packet handlers
* Generic packet handlers
...
@@ -518,7 +567,9 @@ static int Demux (demux_t *demux)
...
@@ -518,7 +567,9 @@ static int Demux (demux_t *demux)
demux_sys_t
*
p_sys
=
demux
->
p_sys
;
demux_sys_t
*
p_sys
=
demux
->
p_sys
;
block_t
*
block
;
block_t
*
block
;
block
=
rtp_dgram_recv
(
demux
,
p_sys
->
fd
);
block
=
p_sys
->
framed_rtp
?
rtp_dgram_recv
(
demux
,
p_sys
->
fd
)
:
rtp_stream_recv
(
demux
,
p_sys
->
fd
);
if
(
!
block
)
if
(
!
block
)
return
0
;
return
0
;
...
...
modules/demux/rtp.h
View file @
51a5b2be
...
@@ -51,5 +51,6 @@ struct demux_sys_t
...
@@ -51,5 +51,6 @@ struct demux_sys_t
uint16_t
max_dropout
;
uint16_t
max_dropout
;
uint16_t
max_misorder
;
uint16_t
max_misorder
;
bool
autodetect
;
bool
autodetect
;
bool
framed_rtp
;
};
};
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