diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-04 21:17:52 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-04 21:17:52 +0200 |
commit | 4480edcf312b8d4350201eca047ccdd2c27f8517 (patch) | |
tree | dbca26f831a32c9638f0aab77daaee0eda3caf86 /libavformat | |
parent | 6cecb8915aa8fa8b55f494f9dd05cce1a4c36093 (diff) | |
parent | 91dffb4c1dfc7232e74ab86536afe39a777fc12d (diff) | |
download | ffmpeg-4480edcf312b8d4350201eca047ccdd2c27f8517.tar.gz |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
w32threads: Make pthread_cond_wait follow POSIX
cosmetics: Consistently place static, inline and av_cold attributes/keywords.
sbrdsp: Use standard multiple inclusion guards.
pcm: K&R formatting cosmetics
rawdec: Support fourccs YV16 and YV24
rtmp: implement bandwidth notification
rtmp: update supported audio codecs value
Conflicts:
libavcodec/pcm.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/rtmpproto.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/libavformat/rtmpproto.c b/libavformat/rtmpproto.c index a2c7b5da88..7a47ad2e68 100644 --- a/libavformat/rtmpproto.c +++ b/libavformat/rtmpproto.c @@ -138,8 +138,12 @@ static void gen_connect(URLContext *s, RTMPContext *rt, const char *proto, ff_amf_write_bool(&p, 0); ff_amf_write_field_name(&p, "capabilities"); ff_amf_write_number(&p, 15.0); + + /* Tell the server we support all the audio codecs except + * SUPPORT_SND_INTEL (0x0008) and SUPPORT_SND_UNUSED (0x0010) + * which are unused in the RTMP protocol implementation. */ ff_amf_write_field_name(&p, "audioCodecs"); - ff_amf_write_number(&p, 1639.0); + ff_amf_write_number(&p, 4071.0); ff_amf_write_field_name(&p, "videoCodecs"); ff_amf_write_number(&p, 252.0); ff_amf_write_field_name(&p, "videoFunction"); @@ -343,6 +347,21 @@ static void gen_pong(URLContext *s, RTMPContext *rt, RTMPPacket *ppkt) } /** + * Generate server bandwidth message and send it to the server. + */ +static void gen_server_bw(URLContext *s, RTMPContext *rt) +{ + RTMPPacket pkt; + uint8_t *p; + + ff_rtmp_packet_create(&pkt, RTMP_NETWORK_CHANNEL, RTMP_PT_SERVER_BW, 0, 4); + p = pkt.data; + bytestream_put_be32(&p, 2500000); + ff_rtmp_packet_write(rt->stream, &pkt, rt->chunk_size, rt->prev_pkt[1]); + ff_rtmp_packet_destroy(&pkt); +} + +/** * Generate report on bytes read so far and send it to the server. */ static void gen_bytes_read(URLContext *s, RTMPContext *rt, uint32_t ts) @@ -603,6 +622,7 @@ static int rtmp_parse_result(URLContext *s, RTMPContext *rt, RTMPPacket *pkt) gen_fcpublish_stream(s, rt); rt->state = STATE_RELEASING; } else { + gen_server_bw(s, rt); rt->state = STATE_CONNECTING; } gen_create_stream(s, rt); |