From 8b2b9efab68a55beb7112a60bdb80bcb8425f2e6 Mon Sep 17 00:00:00 2001 From: terelius Date: Wed, 31 May 2017 05:45:56 -0700 Subject: [PATCH] Use oneof in event log proto to reduce memory consumption. BUG=webrtc:7732 Review-Url: https://codereview.webrtc.org/2919483002 Cr-Commit-Position: refs/heads/master@{#18350} --- .../logging/rtc_event_log/rtc_event_log.proto | 50 ++++++++++--------- 1 file changed, 26 insertions(+), 24 deletions(-) diff --git a/webrtc/logging/rtc_event_log/rtc_event_log.proto b/webrtc/logging/rtc_event_log/rtc_event_log.proto index 17a7c1146e..b9053ae87d 100644 --- a/webrtc/logging/rtc_event_log/rtc_event_log.proto +++ b/webrtc/logging/rtc_event_log/rtc_event_log.proto @@ -45,41 +45,43 @@ message Event { // required - Indicates the type of this event optional EventType type = 2; - // optional - but required if type == RTP_EVENT - optional RtpPacket rtp_packet = 3; + oneof subtype { + // required if type == RTP_EVENT + RtpPacket rtp_packet = 3; - // optional - but required if type == RTCP_EVENT - optional RtcpPacket rtcp_packet = 4; + // required if type == RTCP_EVENT + RtcpPacket rtcp_packet = 4; - // optional - but required if type == AUDIO_PLAYOUT_EVENT - optional AudioPlayoutEvent audio_playout_event = 5; + // required if type == AUDIO_PLAYOUT_EVENT + AudioPlayoutEvent audio_playout_event = 5; - // optional - but required if type == LOSS_BASED_BWE_UPDATE - optional LossBasedBweUpdate loss_based_bwe_update = 6; + // required if type == LOSS_BASED_BWE_UPDATE + LossBasedBweUpdate loss_based_bwe_update = 6; - // optional - but required if type == DELAY_BASED_BWE_UPDATE - optional DelayBasedBweUpdate delay_based_bwe_update = 7; + // required if type == DELAY_BASED_BWE_UPDATE + DelayBasedBweUpdate delay_based_bwe_update = 7; - // optional - but required if type == VIDEO_RECEIVER_CONFIG_EVENT - optional VideoReceiveConfig video_receiver_config = 8; + // required if type == VIDEO_RECEIVER_CONFIG_EVENT + VideoReceiveConfig video_receiver_config = 8; - // optional - but required if type == VIDEO_SENDER_CONFIG_EVENT - optional VideoSendConfig video_sender_config = 9; + // required if type == VIDEO_SENDER_CONFIG_EVENT + VideoSendConfig video_sender_config = 9; - // optional - but required if type == AUDIO_RECEIVER_CONFIG_EVENT - optional AudioReceiveConfig audio_receiver_config = 10; + // required if type == AUDIO_RECEIVER_CONFIG_EVENT + AudioReceiveConfig audio_receiver_config = 10; - // optional - but required if type == AUDIO_SENDER_CONFIG_EVENT - optional AudioSendConfig audio_sender_config = 11; + // required if type == AUDIO_SENDER_CONFIG_EVENT + AudioSendConfig audio_sender_config = 11; - // optional - but required if type == AUDIO_NETWORK_ADAPTATION_EVENT - optional AudioNetworkAdaptation audio_network_adaptation = 16; + // required if type == AUDIO_NETWORK_ADAPTATION_EVENT + AudioNetworkAdaptation audio_network_adaptation = 16; - // optional - but required if type == BWE_PROBE_CLUSTER_CREATED_EVENT - optional BweProbeCluster probe_cluster = 17; + // required if type == BWE_PROBE_CLUSTER_CREATED_EVENT + BweProbeCluster probe_cluster = 17; - // optional - but required if type == BWE_PROBE_RESULT_EVENT - optional BweProbeResult probe_result = 18; + // required if type == BWE_PROBE_RESULT_EVENT + BweProbeResult probe_result = 18; + } } message RtpPacket {