Prepare for new event log parser.

Minor clean up of BUILD file.
Add explicit events for begin and end of log.
Add a helper function to populate timestamps.
Add a GroupKey method that will be used for grouping events by for example SSRC in additon to event type.

Bug: webrtc:11933
Change-Id: Ie3c5f5a5582c89805a0273f4b27978f47ed0fb4f
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/234260
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Reviewed-by: Per Kjellander <perkj@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#35725}
This commit is contained in:
Björn Terelius
2022-01-18 16:03:42 +01:00
committed by WebRTC LUCI CQ
parent 1d99f49cda
commit c15bced118
14 changed files with 347 additions and 75 deletions

View File

@ -27,7 +27,7 @@ class RtcEvent {
// of Type. This leaks the information of existing subclasses into the
// superclass, but the *actual* information - rtclog::StreamConfig, etc. -
// is kept separate.
enum class Type {
enum class Type : uint32_t {
AlrStateEvent,
RouteChangeEvent,
RemoteEstimateEvent,
@ -53,7 +53,9 @@ class RtcEvent {
GenericPacketSent,
GenericPacketReceived,
GenericAckReceived,
FrameDecoded
FrameDecoded,
BeginV3Log = 0x2501580,
EndV3Log = 0x2501581
};
RtcEvent();
@ -63,6 +65,13 @@ class RtcEvent {
virtual bool IsConfigEvent() const = 0;
// Events are grouped by Type before being encoded.
// Optionally, `GetGroupKey` can be overloaded to group the
// events by a secondary key (in addition to the event type.)
// This can, in some cases, improve compression efficiency
// e.g. by grouping events by SSRC.
virtual uint32_t GetGroupKey() const { return 0; }
int64_t timestamp_ms() const { return timestamp_us_ / 1000; }
int64_t timestamp_us() const { return timestamp_us_; }

View File

@ -29,7 +29,7 @@ class RtcEventLog {
// TODO(eladalon): Get rid of the legacy encoding and this enum once all
// clients have migrated to the new format.
enum class EncodingType { Legacy, NewFormat };
enum class EncodingType { Legacy, NewFormat, ProtoFree };
virtual ~RtcEventLog() = default;