1 /*
2  *  Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
3  *
4  *  Use of this source code is governed by a BSD-style license
5  *  that can be found in the LICENSE file in the root of the source
6  *  tree. An additional intellectual property rights grant can be found
7  *  in the file PATENTS.  All contributing project authors may
8  *  be found in the AUTHORS file in the root of the source tree.
9  */
10 
11 #ifndef LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_GENERIC_PACKET_RECEIVED_H_
12 #define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_GENERIC_PACKET_RECEIVED_H_
13 
14 #include <memory>
15 
16 #include "api/rtc_event_log/rtc_event.h"
17 
18 namespace webrtc {
19 
20 class RtcEventGenericPacketReceived final : public RtcEvent {
21  public:
22   RtcEventGenericPacketReceived(int64_t packet_number, size_t packet_length);
23   ~RtcEventGenericPacketReceived() override;
24 
25   std::unique_ptr<RtcEventGenericPacketReceived> Copy() const;
26 
27   Type GetType() const override;
28 
29   bool IsConfigEvent() const override;
30 
31   // An identifier of the packet.
packet_number()32   int64_t packet_number() const { return packet_number_; }
33 
34   // Total packet length, including all packetization overheads, but not
35   // including ICE/TURN/IP overheads.
packet_length()36   size_t packet_length() const { return packet_length_; }
37 
38  private:
39   RtcEventGenericPacketReceived(const RtcEventGenericPacketReceived& packet);
40 
41   const int64_t packet_number_;
42   const size_t packet_length_;
43 };
44 
45 }  // namespace webrtc
46 
47 #endif  // LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_GENERIC_PACKET_RECEIVED_H_
48