Create RtcEventLogEncoderLegacy

We're moving to an RtcEventLog interface that accepts std::unique_ptr<EventLog> and stores the event for encoding when encoding becomes necessary, rather than before. This will be useful while we maintain the legacy (current) encoding alongside the new encoding on which we're working.

This CL introduces RtcEventLogEncoderLegacy, which takes provides the encoding currently done by RtcEventLogImpl. After this, we can modify RtcEventLogImpl to use a dynamically chosen encoding, allowing us to easily choose between the current encoding and the new one on which we're working.

BUG=webrtc:8111
TBR=stefan@webrtc.org

Change-Id: I3dde7e222a40a117549a094a59b04219467f490a
Reviewed-on: https://webrtc-review.googlesource.com/1364
Commit-Queue: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Elad Alon <eladalon@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#20116}
diff --git a/rtc_tools/event_log_visualizer/analyzer.cc b/rtc_tools/event_log_visualizer/analyzer.cc
index bd8cb99..9447483 100644
--- a/rtc_tools/event_log_visualizer/analyzer.cc
+++ b/rtc_tools/event_log_visualizer/analyzer.cc
@@ -373,7 +373,7 @@
       }
       case ParsedRtcEventLog::RTP_EVENT: {
         RtpHeaderExtensionMap* extension_map = parsed_log_.GetRtpHeader(
-            i, &direction, header, &header_length, &total_length);
+            i, &direction, header, &header_length, &total_length, nullptr);
         RtpUtility::RtpHeaderParser rtp_parser(header, header_length);
         RTPHeader parsed_header;
         if (extension_map != nullptr) {
@@ -923,7 +923,8 @@
   for (size_t i = 0; i < parsed_log_.GetNumberOfEvents(); i++) {
     ParsedRtcEventLog::EventType event_type = parsed_log_.GetEventType(i);
     if (event_type == ParsedRtcEventLog::RTP_EVENT) {
-      parsed_log_.GetRtpHeader(i, &direction, nullptr, nullptr, &total_length);
+      parsed_log_.GetRtpHeader(i, &direction, nullptr, nullptr, &total_length,
+                               nullptr);
       if (direction == desired_direction) {
         uint64_t timestamp = parsed_log_.GetTimestamp(i);
         packets.push_back(TimestampSize(timestamp, total_length));
@@ -999,6 +1000,8 @@
           case BandwidthUsage::kBwOverusing:
             last_series = &overusing_series;
             break;
+          case BandwidthUsage::kLast:
+            RTC_NOTREACHED();
         }
       }