MillicastSDK 2.2.0
Loading...
Searching...
No Matches
rts_stats.h
Go to the documentation of this file.
1#pragma once
2
3#include <cstdint>
4#include <optional>
5#include <string>
6#include <vector>
7
9
10namespace millicast {
11
19 enum class Type { AUDIO = 0, VIDEO };
21
22 int64_t timestamp;
23
24 // Service information
25 std::optional<std::string> source_id;
26
27 // WebRTC identification information
28 std::string mid;
29 std::string track_identifier;
30
31 // packet/retransmission information
32 std::optional<uint64_t> bytes_received;
33 std::optional<uint64_t> retransmitted_bytes_received;
34 std::optional<uint64_t> packets_received;
35 std::optional<uint64_t> retransmitted_packets_received;
36 std::optional<uint64_t> packets_lost;
37 std::optional<uint32_t> nack_count;
38 std::optional<uint64_t> bitrate_bps;
39
40 // jitter information
41 std::optional<double> jitter;
42 // Those are already normalized based on the emitted count.
43 std::optional<double> jitter_buffer_delay;
44 std::optional<double> jitter_buffer_minimum_delay;
45
46 // This is normalized against the number of frames decoded.
47 std::optional<double> processing_delay;
48
49 std::string mime_type;
50 uint32_t payload_type;
51
52 // The rest is video information (not available when it's an audio track)
53 std::optional<std::string> decoder_implementation;
54 std::optional<uint32_t> frame_width;
55 std::optional<uint32_t> frame_height;
56 std::optional<uint32_t> frames_per_second;
57
58 std::optional<uint32_t> frames_received;
59 std::optional<uint32_t> frames_decoded;
60 std::optional<uint32_t> key_frames_decoded;
61 std::optional<uint32_t> frames_dropped;
62
63 // This is normalized against the number of frames decoded (video only).
64 std::optional<double> decode_time;
65
66 std::optional<uint32_t> pause_count;
67 std::optional<uint32_t> freeze_count;
68
69 std::optional<double> total_pauses_duration;
70 std::optional<double> total_freezes_duration;
71
72 std::optional<uint32_t> fir_count;
73 std::optional<uint32_t> pli_count;
74};
75
82 public:
86 enum class Level { FULL, SIMPLIFIED };
87
88 std::string cluster_id;
89 std::string stream_view_id;
90 std::string subscriber_id;
91 std::string stream_id;
92
93 int64_t timestamp;
94 std::optional<double> total_round_trip_time;
95 std::optional<double> current_round_trip_time;
96
97 /*
98 * @brief statistics of all the enabled tracks.
99 * */
100 std::vector<std::shared_ptr<const RtsTrackStats>> track_stats;
101
102 RtsViewerStats() = default;
103
112 [[nodiscard]] virtual std::string to_json(Level level) const = 0;
113
114 virtual ~RtsViewerStats() = default;
115
116 protected:
117 RtsViewerStats(const RtsViewerStats&) noexcept = default;
118 RtsViewerStats(RtsViewerStats&&) noexcept = default;
119 RtsViewerStats& operator=(RtsViewerStats&&) noexcept = default;
120 RtsViewerStats& operator=(const RtsViewerStats&) noexcept = default;
121};
122} // namespace millicast
viewer level RTS statistics. Combines information from different areas to provide useful information ...
Definition rts_stats.h:81
std::string stream_view_id
Definition rts_stats.h:89
std::string cluster_id
Definition rts_stats.h:88
int64_t timestamp
Definition rts_stats.h:93
virtual std::string to_json(Level level) const =0
get a json string of the viewer statistics. the keys are the same as the fields in this class and
std::string subscriber_id
Definition rts_stats.h:90
std::optional< double > total_round_trip_time
Definition rts_stats.h:94
std::string stream_id
Definition rts_stats.h:91
std::optional< double > current_round_trip_time
Definition rts_stats.h:95
RtsViewerStats(const RtsViewerStats &) noexcept=default
Level
Definition rts_stats.h:86
virtual ~RtsViewerStats()=default
RtsViewerStats(RtsViewerStats &&) noexcept=default
std::vector< std::shared_ptr< const RtsTrackStats > > track_stats
Definition rts_stats.h:100
#define MILLICAST_API
Definition exports.h:51
Definition capabilities.h:15
track level RTS statistics. Combines information from different areas to provide a complete picture a...
Definition rts_stats.h:18
std::optional< double > processing_delay
Definition rts_stats.h:47
std::optional< double > jitter
Definition rts_stats.h:41
std::string track_identifier
Definition rts_stats.h:29
std::optional< std::string > source_id
Definition rts_stats.h:25
std::optional< uint64_t > bitrate_bps
Definition rts_stats.h:38
std::optional< uint64_t > packets_received
Definition rts_stats.h:34
Type
Definition rts_stats.h:19
std::optional< uint32_t > frames_per_second
Definition rts_stats.h:56
std::optional< std::string > decoder_implementation
Definition rts_stats.h:53
std::optional< uint32_t > frames_dropped
Definition rts_stats.h:61
std::optional< double > jitter_buffer_delay
Definition rts_stats.h:43
std::optional< double > decode_time
Definition rts_stats.h:64
std::optional< uint64_t > packets_lost
Definition rts_stats.h:36
std::optional< uint64_t > retransmitted_packets_received
Definition rts_stats.h:35
std::optional< double > jitter_buffer_minimum_delay
Definition rts_stats.h:44
std::optional< uint32_t > frames_decoded
Definition rts_stats.h:59
std::optional< uint32_t > pause_count
Definition rts_stats.h:66
std::optional< uint32_t > frame_height
Definition rts_stats.h:55
std::optional< uint64_t > retransmitted_bytes_received
Definition rts_stats.h:33
Type type
Definition rts_stats.h:20
int64_t timestamp
Definition rts_stats.h:22
std::optional< double > total_freezes_duration
Definition rts_stats.h:70
std::optional< double > total_pauses_duration
Definition rts_stats.h:69
std::optional< uint32_t > nack_count
Definition rts_stats.h:37
uint32_t payload_type
Definition rts_stats.h:50
std::string mime_type
Definition rts_stats.h:49
std::optional< uint32_t > fir_count
Definition rts_stats.h:72
std::optional< uint32_t > frame_width
Definition rts_stats.h:54
std::optional< uint32_t > key_frames_decoded
Definition rts_stats.h:60
std::string mid
Definition rts_stats.h:28
std::optional< uint32_t > frames_received
Definition rts_stats.h:58
std::optional< uint64_t > bytes_received
Definition rts_stats.h:32
std::optional< uint32_t > freeze_count
Definition rts_stats.h:67
std::optional< uint32_t > pli_count
Definition rts_stats.h:73