namespace newapi {
// RTCP mode to use. Compound mode is described by RFC 4585 and reduced-size
// RTCP mode is described by RFC 5506.
-enum RtcpMode {
- kRtcpCompound,
- kRtcpReducedSize
-};
+enum RtcpMode { kRtcpCompound, kRtcpReducedSize };
} // namespace newapi
class VideoDecoder;
class VideoReceiveStream {
public:
- struct Stats {
+ struct Stats : public StreamStats {
Stats()
: network_frame_rate(0),
decode_frame_rate(0),
render_frame_rate(0),
- key_frames(0),
- delta_frames(0),
- video_packets(0),
- retransmitted_packets(0),
- fec_packets(0),
- padding_packets(0),
+ avg_delay_ms(0),
discarded_packets(0),
- received_bitrate_bps(0),
- receive_side_delay_ms(0) {}
- RtpStatistics rtp_stats;
+ ssrc(0) {}
+
int network_frame_rate;
int decode_frame_rate;
int render_frame_rate;
- uint32_t key_frames;
- uint32_t delta_frames;
- uint32_t video_packets;
- uint32_t retransmitted_packets;
- uint32_t fec_packets;
- uint32_t padding_packets;
+ int avg_delay_ms;
uint32_t discarded_packets;
- int32_t received_bitrate_bps;
- int receive_side_delay_ms;
- };
-
- class StatsCallback {
- public:
- virtual ~StatsCallback() {}
- virtual void ReceiveStats(const Stats& stats) = 0;
+ uint32_t ssrc;
+ std::string c_name;
};
struct Config {
// See FecConfig for description.
FecConfig fec;
- // RTX settings for video payloads that may be received. RTX is disabled
- // if there's no config present.
- std::map<int, RtxConfig> rtx;
+ // RTX settings for incoming video payloads that may be received. RTX is
+ // disabled if there's no config present.
+ struct Rtx {
+ Rtx() : ssrc(0), payload_type(0) {}
+
+ // SSRCs to use for the RTX streams.
+ uint32_t ssrc;
+
+ // Payload type to use for the RTX stream.
+ int payload_type;
+ };
+
+ // Map from video RTP payload type -> RTX config.
+ typedef std::map<int, Rtx> RtxMap;
+ RtxMap rtx;
// RTP header extensions used for the received stream.
std::vector<RtpExtension> extensions;
// Target delay in milliseconds. A positive value indicates this stream is
// used for streaming instead of a real-time call.
int target_delay_ms;
-
- // Callback for periodically receiving receiver stats.
- StatsCallback* stats_callback;
};
virtual void StartReceiving() = 0;
virtual void StopReceiving() = 0;
+ virtual Stats GetStats() const = 0;
// TODO(mflodman) Replace this with callback.
virtual void GetCurrentReceiveCodec(VideoCodec* receive_codec) = 0;