Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
55c54ff7
Commit
55c54ff7
authored
Jun 04, 2021
by
Zhao Zhili
Committed by
Marton Balint
Jun 08, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avformat/libsrt: add tsbpd option
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
9099046c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
1 deletion
+9
-1
protocols.texi
doc/protocols.texi
+5
-0
libsrt.c
libavformat/libsrt.c
+4
-1
No files found.
doc/protocols.texi
View file @
55c54ff7
...
...
@@ -1607,6 +1607,11 @@ Default is -1. -1 means auto (off with 0 seconds in live mode, on with 180
seconds in file mode). The range for this option is integers in the
0 - @code{INT_MAX}.
@item tsbpd=@var{1|0}
When true, use Timestamp-based Packet Delivery mode. The default behavior
depends on the transmission type: enabled in live mode, disabled in file
mode.
@end table
For more information see: @url{https://github.com/Haivision/srt}.
...
...
libavformat/libsrt.c
View file @
55c54ff7
...
...
@@ -90,6 +90,7 @@ typedef struct SRTContext {
int
messageapi
;
SRT_TRANSTYPE
transtype
;
int
linger
;
int
tsbpd
;
}
SRTContext
;
#define D AV_OPT_FLAG_DECODING_PARAM
...
...
@@ -140,6 +141,7 @@ static const AVOption libsrt_options[] = {
{
"live"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SRTT_LIVE
},
INT_MIN
,
INT_MAX
,
.
flags
=
D
|
E
,
"transtype"
},
{
"file"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
SRTT_FILE
},
INT_MIN
,
INT_MAX
,
.
flags
=
D
|
E
,
"transtype"
},
{
"linger"
,
"Number of seconds that the socket waits for unsent data when closing"
,
OFFSET
(
linger
),
AV_OPT_TYPE_INT
,
{
.
i64
=
-
1
},
-
1
,
INT_MAX
,
.
flags
=
D
|
E
},
{
"tsbpd"
,
"Timestamp-based packet delivery"
,
OFFSET
(
tsbpd
),
AV_OPT_TYPE_BOOL
,
{
.
i64
=
-
1
},
-
1
,
1
,
.
flags
=
D
|
E
},
{
NULL
}
};
...
...
@@ -349,7 +351,8 @@ static int libsrt_set_options_pre(URLContext *h, int fd)
#endif
(
s
->
messageapi
>=
0
&&
libsrt_setsockopt
(
h
,
fd
,
SRTO_MESSAGEAPI
,
"SRTO_MESSAGEAPI"
,
&
s
->
messageapi
,
sizeof
(
s
->
messageapi
))
<
0
)
||
(
s
->
payload_size
>=
0
&&
libsrt_setsockopt
(
h
,
fd
,
SRTO_PAYLOADSIZE
,
"SRTO_PAYLOADSIZE"
,
&
s
->
payload_size
,
sizeof
(
s
->
payload_size
))
<
0
)
||
((
h
->
flags
&
AVIO_FLAG_WRITE
)
&&
libsrt_setsockopt
(
h
,
fd
,
SRTO_SENDER
,
"SRTO_SENDER"
,
&
yes
,
sizeof
(
yes
))
<
0
))
{
((
h
->
flags
&
AVIO_FLAG_WRITE
)
&&
libsrt_setsockopt
(
h
,
fd
,
SRTO_SENDER
,
"SRTO_SENDER"
,
&
yes
,
sizeof
(
yes
))
<
0
)
||
(
s
->
tsbpd
>=
0
&&
libsrt_setsockopt
(
h
,
fd
,
SRTO_TSBPDMODE
,
"SRTO_TSBPDMODE"
,
&
s
->
tsbpd
,
sizeof
(
s
->
tsbpd
))
<
0
))
{
return
AVERROR
(
EIO
);
}
...
...
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