Chromium Code Reviews| Index: webrtc/tools/event_log_visualizer/analyzer.h |
| diff --git a/webrtc/tools/event_log_visualizer/analyzer.h b/webrtc/tools/event_log_visualizer/analyzer.h |
| index bb4db2b824825240c7738b224aff5acf15993fea..310475020b312c2087f833427e07eb02d1b7a77c 100644 |
| --- a/webrtc/tools/event_log_visualizer/analyzer.h |
| +++ b/webrtc/tools/event_log_visualizer/analyzer.h |
| @@ -14,6 +14,7 @@ |
| #include <vector> |
| #include <map> |
| #include <memory> |
| +#include <set> |
| #include <utility> |
| #include "webrtc/call/rtc_event_log_parser.h" |
| @@ -24,6 +25,20 @@ |
| namespace webrtc { |
| namespace plotting { |
| +class StreamId { |
| + public: |
| + StreamId(uint32_t ssrc, webrtc::PacketDirection direction) |
| + : ssrc_(ssrc), direction_(direction) {} |
|
philipel
2016/08/04 12:56:02
Move implementation to .cc file.
terelius
2016/08/05 12:24:57
I prefer to keep trivial constructors in the class
philipel
2016/08/05 12:43:21
I was thinking of moving the full implementation t
terelius
2016/08/05 13:00:17
It makes it easier to verify that all members are
|
| + bool operator<(const StreamId& other) const; |
| + bool operator==(const StreamId& other) const; |
| + uint32_t GetSsrc() const { return ssrc_; } |
| + webrtc::PacketDirection GetDirection() const { return direction_; } |
| + |
| + private: |
| + uint32_t ssrc_; |
| + webrtc::PacketDirection direction_; |
| +}; |
| + |
| class EventLogAnalyzer { |
| public: |
| // The EventLogAnalyzer keeps a reference to the ParsedRtcEventLog for the |
| @@ -31,6 +46,12 @@ class EventLogAnalyzer { |
| // modified while the EventLogAnalyzer is being used. |
| explicit EventLogAnalyzer(const ParsedRtcEventLog& log); |
| + bool IsRtxSsrc(StreamId stream_id); |
| + |
| + bool IsVideoSsrc(StreamId stream_id); |
| + |
| + bool IsAudioSsrc(StreamId stream_id); |
| + |
| void CreatePacketGraph(PacketDirection desired_direction, Plot* plot); |
| void CreatePlayoutGraph(Plot* plot); |
| @@ -48,20 +69,6 @@ class EventLogAnalyzer { |
| void CreateBweGraph(Plot* plot); |
| private: |
| - class StreamId { |
| - public: |
| - StreamId(uint32_t ssrc, webrtc::PacketDirection direction) |
| - : ssrc_(ssrc), direction_(direction) {} |
| - bool operator<(const StreamId& other) const; |
| - bool operator==(const StreamId& other) const; |
| - uint32_t GetSsrc() const { return ssrc_; } |
| - webrtc::PacketDirection GetDirection() const { return direction_; } |
| - |
| - private: |
| - uint32_t ssrc_; |
| - webrtc::PacketDirection direction_; |
| - }; |
| - |
| struct LoggedRtpPacket { |
| LoggedRtpPacket(uint64_t timestamp, RTPHeader header, size_t total_length) |
| : timestamp(timestamp), header(header), total_length(total_length) {} |
| @@ -95,9 +102,18 @@ class EventLogAnalyzer { |
| // If left empty, all SSRCs will be considered relevant. |
| std::vector<uint32_t> desired_ssrc_; |
| - // Maps a stream identifier consisting of ssrc, direction and MediaType |
| - // to the parsed RTP headers in that stream. Header extensions are parsed |
| - // if the stream has been configured. |
| + // Tracks what each stream is configured for. Note that a single SSRC can be |
| + // in several sets. For example, the SSRC used for sending video over RTX |
| + // will appear in both video_ssrcs_ and rtx_ssrcs_. In the unlikely case that |
| + // an SSRC is reconfigured to a different media type mid-call, it will also |
| + // appear in multiple sets. |
| + std::set<StreamId> rtx_ssrcs_; |
| + std::set<StreamId> video_ssrcs_; |
| + std::set<StreamId> audio_ssrcs_; |
| + |
| + // Maps a stream identifier consisting of ssrc and direction to the parsed |
| + // RTP headers in that stream. Header extensions are parsed if the stream |
| + // has been configured. |
| std::map<StreamId, std::vector<LoggedRtpPacket>> rtp_packets_; |
| std::map<StreamId, std::vector<LoggedRtcpPacket>> rtcp_packets_; |