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
ffb7669e
Commit
ffb7669e
authored
Sep 15, 2013
by
Luca Barbato
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rtmp: Support play method in listen mode
parent
97d35fa8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
rtmpproto.c
libavformat/rtmpproto.c
+10
-1
No files found.
libavformat/rtmpproto.c
View file @
ffb7669e
...
...
@@ -63,6 +63,7 @@ typedef enum {
STATE_SEEKING
,
///< client has started the seek operation. Back on STATE_PLAYING when the time comes
STATE_PUBLISHING
,
///< client has started sending multimedia data to server (for output)
STATE_RECEIVING
,
///< received a publish command (for input)
STATE_SENDING
,
///< received a play command (for output)
STATE_STOPPED
,
///< the broadcast has been stopped
}
ClientState
;
...
...
@@ -1901,6 +1902,13 @@ static int send_invoke_response(URLContext *s, RTMPPacket *pkt)
// Send onStatus(NetStream.Publish.Start)
return
write_status
(
s
,
pkt
,
"NetStream.Publish.Start"
,
filename
);
}
else
if
(
!
strcmp
(
command
,
"play"
))
{
ret
=
write_begin
(
s
);
if
(
ret
<
0
)
return
ret
;
rt
->
state
=
STATE_SENDING
;
return
write_status
(
s
,
pkt
,
"NetStream.Play.Start"
,
filename
);
}
else
{
if
((
ret
=
ff_rtmp_packet_create
(
&
spkt
,
RTMP_SYSTEM_CHANNEL
,
RTMP_PT_INVOKE
,
0
,
...
...
@@ -2047,6 +2055,7 @@ static int handle_invoke(URLContext *s, RTMPPacket *pkt)
}
else
if
(
ff_amf_match_string
(
pkt
->
data
,
pkt
->
size
,
"releaseStream"
)
||
ff_amf_match_string
(
pkt
->
data
,
pkt
->
size
,
"FCPublish"
)
||
ff_amf_match_string
(
pkt
->
data
,
pkt
->
size
,
"publish"
)
||
ff_amf_match_string
(
pkt
->
data
,
pkt
->
size
,
"play"
)
||
ff_amf_match_string
(
pkt
->
data
,
pkt
->
size
,
"_checkbw"
)
||
ff_amf_match_string
(
pkt
->
data
,
pkt
->
size
,
"createStream"
))
{
if
((
ret
=
send_invoke_response
(
s
,
pkt
))
<
0
)
...
...
@@ -2235,6 +2244,7 @@ static int get_packet(URLContext *s, int for_header)
}
if
(
for_header
&&
(
rt
->
state
==
STATE_PLAYING
||
rt
->
state
==
STATE_PUBLISHING
||
rt
->
state
==
STATE_SENDING
||
rt
->
state
==
STATE_RECEIVING
))
{
ff_rtmp_packet_destroy
(
&
rpkt
);
return
0
;
...
...
@@ -2520,7 +2530,6 @@ reconnect:
}
else
{
if
(
read_connect
(
s
,
s
->
priv_data
)
<
0
)
goto
fail
;
rt
->
is_input
=
1
;
}
do
{
...
...
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