tor-browser

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

rtp_packet_to_send.cc (1522B)


      1 /*
      2 *  Copyright (c) 2018 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 #include "modules/rtp_rtcp/source/rtp_packet_to_send.h"
     12 
     13 #include <cstddef>
     14 
     15 #include "modules/rtp_rtcp/include/rtp_rtcp_defines.h"
     16 
     17 namespace webrtc {
     18 
     19 RtpPacketToSend::RtpPacketToSend(const ExtensionManager* extensions)
     20    : RtpPacket(extensions) {}
     21 RtpPacketToSend::RtpPacketToSend(const ExtensionManager* extensions,
     22                                 size_t capacity)
     23    : RtpPacket(extensions, capacity) {}
     24 RtpPacketToSend::RtpPacketToSend(const RtpPacketToSend& packet) = default;
     25 RtpPacketToSend::RtpPacketToSend(RtpPacketToSend&& packet) = default;
     26 
     27 RtpPacketToSend& RtpPacketToSend::operator=(const RtpPacketToSend& packet) =
     28    default;
     29 RtpPacketToSend& RtpPacketToSend::operator=(RtpPacketToSend&& packet) = default;
     30 
     31 RtpPacketToSend::~RtpPacketToSend() = default;
     32 
     33 void RtpPacketToSend::set_packet_type(RtpPacketMediaType type) {
     34  if (packet_type_ == RtpPacketMediaType::kAudio) {
     35    original_packet_type_ = OriginalType::kAudio;
     36  } else if (packet_type_ == RtpPacketMediaType::kVideo) {
     37    original_packet_type_ = OriginalType::kVideo;
     38  }
     39  packet_type_ = type;
     40 }
     41 
     42 }  // namespace webrtc