mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 22:00:47 +01:00

RegisterReceivedPacketCallback is used instead of sigslot::SignalReadPacket. The callback use a new data class ReceivedPacket that combine meta data and packet payload from a received packet. This is the first step in an attempt to cleanup the data types used in the packet receive pipeline. Eventually, the ReceivedPacket class can contain more meta data such as ECN information. Bug: webrtc:11943,webrtc:15368 Change-Id: I984c561b9262fe4aa00176529bd8d901adf66640 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/325060 Reviewed-by: Jonas Oreland <jonaso@webrtc.org> Commit-Queue: Per Kjellander <perkj@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#41021}
23 lines
765 B
C++
23 lines
765 B
C++
/*
|
|
* Copyright 2023 The WebRTC Project Authors. All rights reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#include "rtc_base/network/received_packet.h"
|
|
|
|
#include <utility>
|
|
|
|
#include "absl/types/optional.h"
|
|
|
|
namespace rtc {
|
|
|
|
ReceivedPacket::ReceivedPacket(rtc::ArrayView<const uint8_t> payload,
|
|
absl::optional<webrtc::Timestamp> arrival_time)
|
|
: payload_(payload), arrival_time_(std::move(arrival_time)) {}
|
|
|
|
} // namespace rtc
|