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
b2e495af
Commit
b2e495af
authored
May 05, 2012
by
Samuel Pitoiset
Committed by
Martin Storsjö
May 08, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtmp: Support 'rtmp_live', an option which specifies if the media is a live stream.
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
ce473de9
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
rtmpproto.c
libavformat/rtmpproto.c
+7
-1
No files found.
libavformat/rtmpproto.c
View file @
b2e495af
...
...
@@ -66,6 +66,7 @@ typedef struct RTMPContext {
int
chunk_size
;
///< size of the chunks RTMP packets are divided into
int
is_input
;
///< input/output flag
char
*
playpath
;
///< stream identifier to play (with possible "mp4:" prefix)
int
live
;
///< 0: recorded, -1: live, -2: both
char
*
app
;
///< name of application
ClientState
state
;
///< current state
int
main_channel_id
;
///< an additional channel ID which is used for some invocations
...
...
@@ -287,7 +288,7 @@ static void gen_play(URLContext *s, RTMPContext *rt)
av_log
(
s
,
AV_LOG_DEBUG
,
"Sending play command for '%s'
\n
"
,
rt
->
playpath
);
ff_rtmp_packet_create
(
&
pkt
,
RTMP_VIDEO_CHANNEL
,
RTMP_PT_INVOKE
,
0
,
2
0
+
strlen
(
rt
->
playpath
));
2
9
+
strlen
(
rt
->
playpath
));
pkt
.
extra
=
rt
->
main_channel_id
;
p
=
pkt
.
data
;
...
...
@@ -295,6 +296,7 @@ static void gen_play(URLContext *s, RTMPContext *rt)
ff_amf_write_number
(
&
p
,
++
rt
->
nb_invokes
);
ff_amf_write_null
(
&
p
);
ff_amf_write_string
(
&
p
,
rt
->
playpath
);
ff_amf_write_number
(
&
p
,
rt
->
live
);
ff_rtmp_packet_write
(
rt
->
stream
,
&
pkt
,
rt
->
chunk_size
,
rt
->
prev_pkt
[
1
]);
ff_rtmp_packet_destroy
(
&
pkt
);
...
...
@@ -1050,6 +1052,10 @@ static int rtmp_write(URLContext *s, const uint8_t *buf, int size)
static
const
AVOption
rtmp_options
[]
=
{
{
"rtmp_app"
,
"Name of application to connect to on the RTMP server"
,
OFFSET
(
app
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
|
ENC
},
{
"rtmp_live"
,
"Specify that the media is a live stream."
,
OFFSET
(
live
),
AV_OPT_TYPE_INT
,
{
-
2
},
INT_MIN
,
INT_MAX
,
DEC
,
"rtmp_live"
},
{
"any"
,
"both"
,
0
,
AV_OPT_TYPE_CONST
,
{
-
2
},
0
,
0
,
DEC
,
"rtmp_live"
},
{
"live"
,
"live stream"
,
0
,
AV_OPT_TYPE_CONST
,
{
-
1
},
0
,
0
,
DEC
,
"rtmp_live"
},
{
"recorded"
,
"recorded stream"
,
0
,
AV_OPT_TYPE_CONST
,
{
0
},
0
,
0
,
DEC
,
"rtmp_live"
},
{
"rtmp_playpath"
,
"Stream identifier to play or to publish"
,
OFFSET
(
playpath
),
AV_OPT_TYPE_STRING
,
{.
str
=
NULL
},
0
,
0
,
DEC
|
ENC
},
{
NULL
},
};
...
...
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