comparison rtp.c @ 2705:cc693f9e80ee libavformat

Use a symbolic name for the payload size of an RTCP Sender Report packet
author lucabe
date Mon, 05 Nov 2007 10:15:20 +0000
parents d751acab2622
children b1723b8da595
comparison
equal deleted inserted replaced
2704:5ab595d4eb2f 2705:cc693f9e80ee
30 #include "rtp_mpv.h" 30 #include "rtp_mpv.h"
31 #include "rtp_aac.h" 31 #include "rtp_aac.h"
32 32
33 //#define DEBUG 33 //#define DEBUG
34 34
35 #define RTCP_SR_SIZE 28
35 36
36 /* TODO: - add RTCP statistics reporting (should be optional). 37 /* TODO: - add RTCP statistics reporting (should be optional).
37 38
38 - add support for h263/mpeg4 packetized output : IDEA: send a 39 - add support for h263/mpeg4 packetized output : IDEA: send a
39 buffer to 'rtp_write_packet' contains all the packets for ONE 40 buffer to 'rtp_write_packet' contains all the packets for ONE
981 #endif 982 #endif
982 983
983 /* XXX: mpeg pts hardcoded. RTCP send every 0.5 seconds */ 984 /* XXX: mpeg pts hardcoded. RTCP send every 0.5 seconds */
984 rtcp_bytes = ((s->octet_count - s->last_octet_count) * RTCP_TX_RATIO_NUM) / 985 rtcp_bytes = ((s->octet_count - s->last_octet_count) * RTCP_TX_RATIO_NUM) /
985 RTCP_TX_RATIO_DEN; 986 RTCP_TX_RATIO_DEN;
986 if (s->first_packet || rtcp_bytes >= 28) { 987 if (s->first_packet || rtcp_bytes >= RTCP_SR_SIZE) {
987 rtcp_send_sr(s1, av_gettime()); 988 rtcp_send_sr(s1, av_gettime());
988 s->last_octet_count = s->octet_count; 989 s->last_octet_count = s->octet_count;
989 s->first_packet = 0; 990 s->first_packet = 0;
990 } 991 }
991 s->cur_timestamp = s->base_timestamp + pkt->pts; 992 s->cur_timestamp = s->base_timestamp + pkt->pts;