Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFmpeg
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
libremedia
Tethys
FFmpeg
Commits
c2d38bea
Commit
c2d38bea
authored
12 years ago
by
Samuel Pitoiset
Committed by
Martin Storsjö
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
rtmp: Handle server bandwidth packets
Signed-off-by:
Martin Storsjö
<
martin@martin.st
>
parent
9ff930aa
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libavformat/rtmpproto.c
+11
-1
11 additions, 1 deletion
libavformat/rtmpproto.c
with
11 additions
and
1 deletion
libavformat/rtmpproto.c
+
11
−
1
View file @
c2d38bea
...
...
@@ -88,6 +88,7 @@ typedef struct RTMPContext {
char
*
tcurl
;
///< url of the target stream
char
*
flashver
;
///< version of the flash plugin
char
*
swfurl
;
///< url of the swf player
int
server_bw
;
///< server bandwidth
}
RTMPContext
;
#define PLAYER_KEY_OPEN_PART_LEN 30 ///< length of partial key used for first client digest signing
...
...
@@ -523,7 +524,7 @@ static int gen_server_bw(URLContext *s, RTMPContext *rt)
return
ret
;
p
=
pkt
.
data
;
bytestream_put_be32
(
&
p
,
2500000
);
bytestream_put_be32
(
&
p
,
rt
->
server_bw
);
ret
=
ff_rtmp_packet_write
(
rt
->
stream
,
&
pkt
,
rt
->
chunk_size
,
rt
->
prev_pkt
[
1
]);
ff_rtmp_packet_destroy
(
&
pkt
);
...
...
@@ -851,6 +852,14 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt)
av_log
(
s
,
AV_LOG_DEBUG
,
"Client bandwidth = %d
\n
"
,
AV_RB32
(
pkt
->
data
));
rt
->
client_report_size
=
AV_RB32
(
pkt
->
data
)
>>
1
;
break
;
case
RTMP_PT_SERVER_BW
:
rt
->
server_bw
=
AV_RB32
(
pkt
->
data
);
if
(
rt
->
server_bw
<=
0
)
{
av_log
(
s
,
AV_LOG_ERROR
,
"Incorrect server bandwidth %d
\n
"
,
rt
->
server_bw
);
return
AVERROR
(
EINVAL
);
}
av_log
(
s
,
AV_LOG_DEBUG
,
"Server bandwidth = %d
\n
"
,
rt
->
server_bw
);
break
;
case
RTMP_PT_INVOKE
:
//TODO: check for the messages sent for wrong state?
if
(
!
memcmp
(
pkt
->
data
,
"
\002\000\006
_error"
,
9
))
{
...
...
@@ -1198,6 +1207,7 @@ static int rtmp_open(URLContext *s, const char *uri, int flags)
rt
->
client_report_size
=
1048576
;
rt
->
bytes_read
=
0
;
rt
->
last_bytes_read
=
0
;
rt
->
server_bw
=
2500000
;
av_log
(
s
,
AV_LOG_DEBUG
,
"Proto = %s, path = %s, app = %s, fname = %s
\n
"
,
proto
,
path
,
rt
->
app
,
rt
->
playpath
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment