tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

compound_packet.h (1477B)


      1 /*
      2 *  Copyright (c) 2016 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 
     12 #ifndef MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_COMPOUND_PACKET_H_
     13 #define MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_COMPOUND_PACKET_H_
     14 
     15 #include <cstddef>
     16 #include <cstdint>
     17 #include <memory>
     18 #include <vector>
     19 
     20 #include "modules/rtp_rtcp/source/rtcp_packet.h"
     21 
     22 namespace webrtc {
     23 namespace rtcp {
     24 
     25 class CompoundPacket : public RtcpPacket {
     26 public:
     27  CompoundPacket();
     28  ~CompoundPacket() override;
     29 
     30  CompoundPacket(const CompoundPacket&) = delete;
     31  CompoundPacket& operator=(const CompoundPacket&) = delete;
     32 
     33  void Append(std::unique_ptr<RtcpPacket> packet);
     34 
     35  // Size of this packet in bytes (i.e. total size of nested packets).
     36  size_t BlockLength() const override;
     37  // Returns true if all calls to Create succeeded.
     38  bool Create(uint8_t* packet,
     39              size_t* index,
     40              size_t max_length,
     41              PacketReadyCallback callback) const override;
     42 
     43 protected:
     44  std::vector<std::unique_ptr<RtcpPacket>> appended_packets_;
     45 };
     46 
     47 }  // namespace rtcp
     48 }  // namespace webrtc
     49 #endif  // MODULES_RTP_RTCP_SOURCE_RTCP_PACKET_COMPOUND_PACKET_H_