1 /* 2 * Copyright (c) 2017 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_RTP_PACKET_OUTGOING_H_ 12 #define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_RTP_PACKET_OUTGOING_H_ 13 14 #include <memory> 15 16 #include "api/rtc_event_log/rtc_event.h" 17 #include "modules/rtp_rtcp/source/rtp_packet.h" 18 19 namespace webrtc { 20 21 class RtpPacketToSend; 22 23 class RtcEventRtpPacketOutgoing final : public RtcEvent { 24 public: 25 RtcEventRtpPacketOutgoing(const RtpPacketToSend& packet, 26 int probe_cluster_id); 27 ~RtcEventRtpPacketOutgoing() override; 28 29 Type GetType() const override; 30 31 bool IsConfigEvent() const override; 32 33 std::unique_ptr<RtcEventRtpPacketOutgoing> Copy() const; 34 packet_length()35 size_t packet_length() const { 36 return payload_length_ + header_length_ + padding_length_; 37 } 38 header()39 const RtpPacket& header() const { return header_; } payload_length()40 size_t payload_length() const { return payload_length_; } header_length()41 size_t header_length() const { return header_length_; } padding_length()42 size_t padding_length() const { return padding_length_; } probe_cluster_id()43 int probe_cluster_id() const { return probe_cluster_id_; } 44 45 private: 46 RtcEventRtpPacketOutgoing(const RtcEventRtpPacketOutgoing& other); 47 48 RtpPacket header_; // Only the packet's header will be stored here. 49 const size_t payload_length_; // Media payload, excluding header and padding. 50 const size_t header_length_; // RTP header. 51 const size_t padding_length_; // RTP padding. 52 // TODO(eladalon): Delete |probe_cluster_id_| along with legacy encoding. 53 const int probe_cluster_id_; 54 }; 55 56 } // namespace webrtc 57 58 #endif // LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_RTP_PACKET_OUTGOING_H_ 59