xref: /aosp_15_r20/external/webrtc/logging/rtc_event_log/events/rtc_event_rtcp_packet_incoming.h (revision d9f758449e529ab9291ac668be2861e7a55c2422)
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_RTCP_PACKET_INCOMING_H_
12 #define LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_RTCP_PACKET_INCOMING_H_
13 
14 #include <stdint.h>
15 
16 #include <memory>
17 #include <string>
18 #include <vector>
19 
20 #include "absl/strings/string_view.h"
21 #include "api/array_view.h"
22 #include "api/rtc_event_log/rtc_event.h"
23 #include "logging/rtc_event_log/events/logged_rtp_rtcp.h"
24 #include "logging/rtc_event_log/events/rtc_event_field_encoding_parser.h"
25 #include "rtc_base/buffer.h"
26 
27 namespace webrtc {
28 
29 class RtcEventRtcpPacketIncoming final : public RtcEvent {
30  public:
31   static constexpr Type kType = Type::RtcpPacketIncoming;
32 
33   explicit RtcEventRtcpPacketIncoming(rtc::ArrayView<const uint8_t> packet);
34   ~RtcEventRtcpPacketIncoming() override;
35 
GetType()36   Type GetType() const override { return kType; }
IsConfigEvent()37   bool IsConfigEvent() const override { return false; }
38 
39   std::unique_ptr<RtcEventRtcpPacketIncoming> Copy() const;
40 
packet()41   const rtc::Buffer& packet() const { return packet_; }
42 
Encode(rtc::ArrayView<const RtcEvent * > batch)43   static std::string Encode(rtc::ArrayView<const RtcEvent*> batch) {
44     // TODO(terelius): Implement
45     return "";
46   }
47 
Parse(absl::string_view encoded_bytes,bool batched,std::vector<LoggedRtcpPacketIncoming> & output)48   static RtcEventLogParseStatus Parse(
49       absl::string_view encoded_bytes,
50       bool batched,
51       std::vector<LoggedRtcpPacketIncoming>& output) {
52     // TODO(terelius): Implement
53     return RtcEventLogParseStatus::Error("Not Implemented", __FILE__, __LINE__);
54   }
55 
56  private:
57   RtcEventRtcpPacketIncoming(const RtcEventRtcpPacketIncoming& other);
58 
59   rtc::Buffer packet_;
60 };
61 
62 }  // namespace webrtc
63 
64 #endif  // LOGGING_RTC_EVENT_LOG_EVENTS_RTC_EVENT_RTCP_PACKET_INCOMING_H_
65