diff options
author | sprang@webrtc.org <sprang@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-11-20 16:47:07 +0000 |
---|---|---|
committer | sprang@webrtc.org <sprang@webrtc.org@4adac7df-926f-26a2-2b94-8c16560cd09d> | 2013-11-20 16:47:07 +0000 |
commit | 4673674e7fc7768f78bfc90f698ccf14a874fce1 (patch) | |
tree | 40914fdd5d8fd9de8932295993c3146d2f395514 /common_types.h | |
parent | 4747585bba09508c7475bf1e5f70a0b981175d9f (diff) | |
download | webrtc-4673674e7fc7768f78bfc90f698ccf14a874fce1.tar.gz |
Interface changes to old api, for use by new api transition.
BUG=2589
R=mflodman@webrtc.org, pbos@webrtc.org, stefan@webrtc.org
Review URL: https://webrtc-codereview.appspot.com/3209004
git-svn-id: http://webrtc.googlecode.com/svn/trunk/webrtc@5142 4adac7df-926f-26a2-2b94-8c16560cd09d
Diffstat (limited to 'common_types.h')
-rw-r--r-- | common_types.h | 66 |
1 files changed, 66 insertions, 0 deletions
diff --git a/common_types.h b/common_types.h index b736a2fd..33f872de 100644 --- a/common_types.h +++ b/common_types.h @@ -225,6 +225,7 @@ protected: Transport() {} }; +// Statistics for an RTCP channel struct RtcpStatistics { public: RtcpStatistics() @@ -241,6 +242,71 @@ struct RtcpStatistics { uint32_t max_jitter; }; +// Callback, called whenever a new rtcp report block is transmitted. +class RtcpStatisticsCallback { + public: + virtual ~RtcpStatisticsCallback() {} + + virtual void StatisticsUpdated(const RtcpStatistics& statistics, + uint32_t ssrc) = 0; +}; + +// Data usage statistics for a (rtp) stream +struct StreamDataCounters { + public: + StreamDataCounters() + : bytes(0), + padding_bytes(0), + packets(0), + retransmitted_packets(0), + fec_packets(0) {} + + uint32_t bytes; + uint32_t padding_bytes; + uint32_t packets; + uint32_t retransmitted_packets; + uint32_t fec_packets; +}; + +// Callback, called whenever byte/packet counts have been updated. +class StreamDataCountersCallback { + public: + virtual ~StreamDataCountersCallback() {} + + virtual void DataCountersUpdated(const StreamDataCounters& counters, + uint32_t ssrc) = 0; +}; + +// Rate statistics for a stream +struct BitrateStatistics { + public: + BitrateStatistics() + : bitrate_(0), + packet_rate(0), + now(0) {} + + uint32_t bitrate_; + uint32_t packet_rate; + uint64_t now; +}; + +// Callback, used to notify an observer whenever new rates have been estimated. +class BitrateStatisticsObserver { + public: + virtual ~BitrateStatisticsObserver() {} + + virtual void Notify(const BitrateStatistics& stats, uint32_t ssrc) = 0; +}; + +// Callback, used to notify an observer whenever frame counts have been updated +class FrameCountObserver { + public: + ~FrameCountObserver() {} + virtual void Notify(const unsigned int key_frames, + const unsigned int delta_frames, + const unsigned int ssrc) = 0; +}; + // ================================================================== // Voice specific types // ================================================================== |