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
6a604066
Commit
6a604066
authored
Sep 17, 2007
by
Rémi Denis-Courmont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Attempt to fix today's RTP access changes
parent
ed8d5bcb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
50 additions
and
33 deletions
+50
-33
modules/access/udp.c
modules/access/udp.c
+50
-33
No files found.
modules/access/udp.c
View file @
6a604066
...
...
@@ -100,7 +100,7 @@ vlc_module_end();
#define RTP_HEADER_LEN 12
static
block_t
*
BlockUDP
(
access_t
*
);
static
block_t
*
Block
PrebufferRTP
(
access_t
*
p_access
,
block_t
*
p_block
);
static
block_t
*
Block
StartRTP
(
access_t
*
);
static
block_t
*
BlockRTP
(
access_t
*
);
static
block_t
*
BlockChoose
(
access_t
*
);
static
int
Control
(
access_t
*
,
int
,
va_list
);
...
...
@@ -135,7 +135,7 @@ static int Open( vlc_object_t *p_this )
/* Set up p_access */
access_InitFields
(
p_access
);
ACCESS_SET_CALLBACKS
(
NULL
,
Block
Prebuffer
RTP
,
Control
,
NULL
);
ACCESS_SET_CALLBACKS
(
NULL
,
Block
Start
RTP
,
Control
,
NULL
);
p_access
->
info
.
b_prebuffered
=
VLC_FALSE
;
MALLOC_ERR
(
p_access
->
p_sys
,
access_sys_t
);
p_sys
=
p_access
->
p_sys
;
memset
(
p_sys
,
0
,
sizeof
(
*
p_sys
));
...
...
@@ -526,10 +526,13 @@ static block_t *BlockParseRTP( access_t *p_access, block_t *p_block )
p_block
->
i_dts
=
(
mtime_t
)
GetWBE
(
p_block
->
p_buffer
+
2
);
/* FIXME: use rtpmap */
const
char
*
psz_demux
=
NULL
;
switch
(
i_payload_type
)
{
case
14
:
// MPA: MPEG Audio (RFC2250, §3.4)
i_skip
+=
4
;
// 32 bits RTP/MPA header
psz_demux
=
"mpga"
;
break
;
case
32
:
// MPV: MPEG Video (RFC2250, §3.5)
...
...
@@ -541,10 +544,12 @@ static block_t *BlockParseRTP( access_t *p_access, block_t *p_block )
/* MPEG2 Video extension header */
/* TODO: shouldn't we skip this too ? */
}
psz_demux
=
"mpgv"
;
break
;
case
33
:
// MP2: MPEG TS (RFC2250, §2)
/* plain TS over RTP */
psz_demux
=
"ts"
;
break
;
case
72
:
/* muxed SR */
...
...
@@ -581,6 +586,12 @@ static block_t *BlockParseRTP( access_t *p_access, block_t *p_block )
}
#endif
if
(
!
p_access
->
psz_demux
||
!*
p_access
->
psz_demux
)
{
free
(
p_access
->
psz_demux
);
p_access
->
psz_demux
=
strdup
(
psz_demux
);
}
return
p_block
;
trash:
...
...
@@ -588,6 +599,40 @@ trash:
return
NULL
;
}
/*****************************************************************************
* BlockRTP: receives an RTP packet, parses it, queues it queue,
* then dequeues the oldest packet and returns it to input/demux.
****************************************************************************/
static
block_t
*
BlockRTP
(
access_t
*
p_access
)
{
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
block_t
*
p
;
while
(
!
p_sys
->
p_list
||
(
mdate
()
-
p_sys
->
p_list
->
i_pts
)
<
p_sys
->
i_rtp_late
)
{
p
=
BlockParseRTP
(
p_access
,
p_sys
->
b_framed_rtp
?
BlockTCP
(
p_access
)
:
BlockUDP
(
p_access
)
);
if
(
!
p
)
return
NULL
;
rtp_ChainInsert
(
p_access
,
p
);
}
p
=
p_sys
->
p_list
;
p_sys
->
p_list
=
p_sys
->
p_list
->
p_next
;
p_sys
->
i_last_seqno
++
;
if
(
p_sys
->
i_last_seqno
!=
(
uint16_t
)
p
->
i_dts
)
{
msg_Dbg
(
p_access
,
"RTP: packet(s) lost, expected %d, got %d"
,
p_sys
->
i_last_seqno
,
(
uint16_t
)
p
->
i_dts
);
p_sys
->
i_last_seqno
=
(
uint16_t
)
p
->
i_dts
;
}
p
->
p_next
=
NULL
;
return
p
;
}
/*****************************************************************************
* BlockPrebufferRTP: waits until we have at least two RTP datagrams,
* so that we can synchronize the RTP sequence number.
...
...
@@ -631,40 +676,12 @@ static block_t *BlockPrebufferRTP( access_t *p_access, block_t *p_block )
return
p
;
}
/*****************************************************************************
* BlockRTP: receives an RTP packet, parses it, queues it queue,
* then dequeues the oldest packet and returns it to input/demux.
****************************************************************************/
static
block_t
*
BlockRTP
(
access_t
*
p_access
)
static
block_t
*
BlockStartRTP
(
access_t
*
p_access
)
{
access_sys_t
*
p_sys
=
p_access
->
p_sys
;
block_t
*
p
;
while
(
!
p_sys
->
p_list
||
(
mdate
()
-
p_sys
->
p_list
->
i_pts
)
<
p_sys
->
i_rtp_late
)
{
p
=
BlockParseRTP
(
p_access
,
p_sys
->
b_framed_rtp
?
BlockTCP
(
p_access
)
:
BlockUDP
(
p_access
)
);
if
(
!
p
)
return
NULL
;
rtp_ChainInsert
(
p_access
,
p
);
}
p
=
p_sys
->
p_list
;
p_sys
->
p_list
=
p_sys
->
p_list
->
p_next
;
p_sys
->
i_last_seqno
++
;
if
(
p_sys
->
i_last_seqno
!=
(
uint16_t
)
p
->
i_dts
)
{
msg_Dbg
(
p_access
,
"RTP: packet(s) lost, expected %d, got %d"
,
p_sys
->
i_last_seqno
,
(
uint16_t
)
p
->
i_dts
);
p_sys
->
i_last_seqno
=
(
uint16_t
)
p
->
i_dts
;
}
p
->
p_next
=
NULL
;
return
p
;
return
BlockPrebufferRTP
(
p_access
,
BlockUDP
(
p_access
)
);
}
/*****************************************************************************
* BlockChoose: decide between RTP and UDP
*****************************************************************************/
...
...
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