Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
29db7c3a
Commit
29db7c3a
authored
Jan 05, 2011
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtsp: Parse RTP-Info headers
Originally committed as revision 26236 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
4cb06874
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
59 additions
and
0 deletions
+59
-0
rtsp.c
libavformat/rtsp.c
+59
-0
No files found.
libavformat/rtsp.c
View file @
29db7c3a
...
...
@@ -684,6 +684,61 @@ static void rtsp_parse_transport(RTSPMessageHeader *reply, const char *p)
}
}
static
void
handle_rtp_info
(
RTSPState
*
rt
,
const
char
*
url
,
uint32_t
seq
,
uint32_t
rtptime
)
{
int
i
;
if
(
!
rtptime
||
!
url
[
0
])
return
;
if
(
rt
->
transport
!=
RTSP_TRANSPORT_RTP
)
return
;
for
(
i
=
0
;
i
<
rt
->
nb_rtsp_streams
;
i
++
)
{
RTSPStream
*
rtsp_st
=
rt
->
rtsp_streams
[
i
];
RTPDemuxContext
*
rtpctx
=
rtsp_st
->
transport_priv
;
if
(
!
rtpctx
)
continue
;
if
(
!
strcmp
(
rtsp_st
->
control_url
,
url
))
{
rtpctx
->
base_timestamp
=
rtptime
;
break
;
}
}
}
static
void
rtsp_parse_rtp_info
(
RTSPState
*
rt
,
const
char
*
p
)
{
int
read
=
0
;
char
key
[
20
],
value
[
1024
],
url
[
1024
]
=
""
;
uint32_t
seq
=
0
,
rtptime
=
0
;
for
(;;)
{
p
+=
strspn
(
p
,
SPACE_CHARS
);
if
(
!*
p
)
break
;
get_word_sep
(
key
,
sizeof
(
key
),
"="
,
&
p
);
if
(
*
p
!=
'='
)
break
;
p
++
;
get_word_sep
(
value
,
sizeof
(
value
),
";, "
,
&
p
);
read
++
;
if
(
!
strcmp
(
key
,
"url"
))
av_strlcpy
(
url
,
value
,
sizeof
(
url
));
else
if
(
!
strcmp
(
key
,
"seq"
))
seq
=
strtol
(
value
,
NULL
,
10
);
else
if
(
!
strcmp
(
key
,
"rtptime"
))
rtptime
=
strtol
(
value
,
NULL
,
10
);
if
(
*
p
==
','
)
{
handle_rtp_info
(
rt
,
url
,
seq
,
rtptime
);
url
[
0
]
=
'\0'
;
seq
=
rtptime
=
0
;
read
=
0
;
}
if
(
*
p
)
p
++
;
}
if
(
read
>
0
)
handle_rtp_info
(
rt
,
url
,
seq
,
rtptime
);
}
void
ff_rtsp_parse_line
(
RTSPMessageHeader
*
reply
,
const
char
*
buf
,
RTSPState
*
rt
,
const
char
*
method
)
{
...
...
@@ -728,6 +783,10 @@ void ff_rtsp_parse_line(RTSPMessageHeader *reply, const char *buf,
p
+=
strspn
(
p
,
SPACE_CHARS
);
if
(
method
&&
!
strcmp
(
method
,
"DESCRIBE"
))
av_strlcpy
(
rt
->
control_uri
,
p
,
sizeof
(
rt
->
control_uri
));
}
else
if
(
av_stristart
(
p
,
"RTP-Info:"
,
&
p
)
&&
rt
)
{
p
+=
strspn
(
p
,
SPACE_CHARS
);
if
(
method
&&
!
strcmp
(
method
,
"PLAY"
))
rtsp_parse_rtp_info
(
rt
,
p
);
}
}
...
...
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