summaryrefslogtreecommitdiff
path: root/libavformat/rtpdec.h
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2012-12-11 15:59:24 +0200
committerMartin Storsjö <martin@martin.st>2013-01-08 17:48:14 +0200
commit86d9181cf41edc3382bf2481f95a2fb321058689 (patch)
tree5f83f288f2ee9da82e789bc870e8410ca9b77d74 /libavformat/rtpdec.h
parent42805eda554a7fc44341282771531e7837ac72b7 (diff)
rtpdec: Support sending RTCP feedback packets
This sends NACK for missed packets and PLI (picture loss indication) if a depacketizer indicates that it needs a new keyframe, according to RFC 4585. This is only enabled if the SDP indicated that feedback is supported (via the AVPF or SAVPF profile names). The feedback packets are throttled to a certain maximum interval (currently 250 ms) to make sure the feedback packets don't eat up too much bandwidth (which might be counterproductive). The RFC specifies a more elaborate feedback packet scheduling. The feedback packets are currently sent independently from normal RTCP RR packets, which is not totally spec compliant, but works fine in the environments I've tested it in. (RFC 5506 allows this, but requires a SDP attribute for enabling it.) Signed-off-by: Martin Storsjö <martin@martin.st>
Diffstat (limited to 'libavformat/rtpdec.h')
-rw-r--r--libavformat/rtpdec.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavformat/rtpdec.h b/libavformat/rtpdec.h
index 75863b8ccb..ee085b1843 100644
--- a/libavformat/rtpdec.h
+++ b/libavformat/rtpdec.h
@@ -73,6 +73,8 @@ void ff_rtp_send_punch_packets(URLContext* rtp_handle);
*/
int ff_rtp_check_and_send_back_rr(RTPDemuxContext *s, URLContext *fd,
AVIOContext *avio, int count);
+int ff_rtp_send_rtcp_feedback(RTPDemuxContext *s, URLContext *fd,
+ AVIOContext *avio);
// these statistics are used for rtcp receiver reports...
typedef struct RTPStatistics {
@@ -130,6 +132,7 @@ struct RTPDynamicProtocolHandler {
void (*free)(PayloadContext *protocol_data);
/** Parse handler for this dynamic packet */
DynamicPayloadPacketHandlerProc parse_packet;
+ int (*need_keyframe)(PayloadContext *context);
struct RTPDynamicProtocolHandler *next;
};
@@ -180,6 +183,8 @@ struct RTPDemuxContext {
unsigned int packet_count;
unsigned int octet_count;
unsigned int last_octet_count;
+ int64_t last_feedback_time;
+
/* buffer for partially parsed packets */
uint8_t buf[RTP_MAX_PACKET_LENGTH];