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
8bf0f969
Commit
8bf0f969
authored
Oct 21, 2010
by
Martin Storsjö
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtsp: Reorder functions
Originally committed as revision 25534 to
svn://svn.ffmpeg.org/ffmpeg/trunk
parent
b4a6c8fb
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
38 deletions
+38
-38
rtsp.c
libavformat/rtsp.c
+38
-38
No files found.
libavformat/rtsp.c
View file @
8bf0f969
...
...
@@ -87,6 +87,44 @@ static void get_word(char *buf, int buf_size, const char **pp)
get_word_until_chars
(
buf
,
buf_size
,
SPACE_CHARS
,
pp
);
}
/** Parse a string p in the form of Range:npt=xx-xx, and determine the start
* and end time.
* Used for seeking in the rtp stream.
*/
static
void
rtsp_parse_range_npt
(
const
char
*
p
,
int64_t
*
start
,
int64_t
*
end
)
{
char
buf
[
256
];
p
+=
strspn
(
p
,
SPACE_CHARS
);
if
(
!
av_stristart
(
p
,
"npt="
,
&
p
))
return
;
*
start
=
AV_NOPTS_VALUE
;
*
end
=
AV_NOPTS_VALUE
;
get_word_sep
(
buf
,
sizeof
(
buf
),
"-"
,
&
p
);
*
start
=
parse_date
(
buf
,
1
);
if
(
*
p
==
'-'
)
{
p
++
;
get_word_sep
(
buf
,
sizeof
(
buf
),
"-"
,
&
p
);
*
end
=
parse_date
(
buf
,
1
);
}
// av_log(NULL, AV_LOG_DEBUG, "Range Start: %lld\n", *start);
// av_log(NULL, AV_LOG_DEBUG, "Range End: %lld\n", *end);
}
static
int
get_sockaddr
(
const
char
*
buf
,
struct
sockaddr_storage
*
sock
)
{
struct
addrinfo
hints
,
*
ai
=
NULL
;
memset
(
&
hints
,
0
,
sizeof
(
hints
));
hints
.
ai_flags
=
AI_NUMERICHOST
;
if
(
getaddrinfo
(
buf
,
NULL
,
&
hints
,
&
ai
))
return
-
1
;
memcpy
(
sock
,
ai
->
ai_addr
,
FFMIN
(
sizeof
(
*
sock
),
ai
->
ai_addrlen
));
freeaddrinfo
(
ai
);
return
0
;
}
/* parse the rtpmap description: <codec_name>/<clock_rate>[/<other params>] */
static
int
sdp_parse_rtpmap
(
AVFormatContext
*
s
,
AVCodecContext
*
codec
,
RTSPStream
*
rtsp_st
,
...
...
@@ -186,44 +224,6 @@ int ff_rtsp_next_attr_and_value(const char **p, char *attr, int attr_size,
return
0
;
}
/** Parse a string p in the form of Range:npt=xx-xx, and determine the start
* and end time.
* Used for seeking in the rtp stream.
*/
static
void
rtsp_parse_range_npt
(
const
char
*
p
,
int64_t
*
start
,
int64_t
*
end
)
{
char
buf
[
256
];
p
+=
strspn
(
p
,
SPACE_CHARS
);
if
(
!
av_stristart
(
p
,
"npt="
,
&
p
))
return
;
*
start
=
AV_NOPTS_VALUE
;
*
end
=
AV_NOPTS_VALUE
;
get_word_sep
(
buf
,
sizeof
(
buf
),
"-"
,
&
p
);
*
start
=
parse_date
(
buf
,
1
);
if
(
*
p
==
'-'
)
{
p
++
;
get_word_sep
(
buf
,
sizeof
(
buf
),
"-"
,
&
p
);
*
end
=
parse_date
(
buf
,
1
);
}
// av_log(NULL, AV_LOG_DEBUG, "Range Start: %lld\n", *start);
// av_log(NULL, AV_LOG_DEBUG, "Range End: %lld\n", *end);
}
static
int
get_sockaddr
(
const
char
*
buf
,
struct
sockaddr_storage
*
sock
)
{
struct
addrinfo
hints
,
*
ai
=
NULL
;
memset
(
&
hints
,
0
,
sizeof
(
hints
));
hints
.
ai_flags
=
AI_NUMERICHOST
;
if
(
getaddrinfo
(
buf
,
NULL
,
&
hints
,
&
ai
))
return
-
1
;
memcpy
(
sock
,
ai
->
ai_addr
,
FFMIN
(
sizeof
(
*
sock
),
ai
->
ai_addrlen
));
freeaddrinfo
(
ai
);
return
0
;
}
typedef
struct
SDPParseState
{
/* SDP only */
struct
sockaddr_storage
default_ip
;
...
...
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