blob: 2a0e3ef7b3b7a94902b0464ef8d404731fa963cc [file] [log] [blame]
Niels Möller70082872018-08-07 11:03:12 +02001/*
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#ifndef CALL_PACKET_RECEIVER_H_
11#define CALL_PACKET_RECEIVER_H_
12
13#include <algorithm>
14#include <memory>
15#include <string>
16#include <vector>
17
18#include "api/mediatypes.h"
19#include "common_types.h" // NOLINT(build/include)
20#include "rtc_base/copyonwritebuffer.h"
21
22namespace webrtc {
23
24class PacketReceiver {
25 public:
26 enum DeliveryStatus {
27 DELIVERY_OK,
28 DELIVERY_UNKNOWN_SSRC,
29 DELIVERY_PACKET_ERROR,
30 };
31
32 virtual DeliveryStatus DeliverPacket(MediaType media_type,
33 rtc::CopyOnWriteBuffer packet,
34 int64_t packet_time_us);
35
36 // TODO(bugs.webrtc.org/9584): Deprecated. Over the transition, default
37 // implementations are used, and subclasses must override one or the other.
38 virtual DeliveryStatus DeliverPacket(MediaType media_type,
39 rtc::CopyOnWriteBuffer packet,
40 const PacketTime& packet_time);
41
42 protected:
43 virtual ~PacketReceiver() {}
44};
45
46} // namespace webrtc
47
48#endif // CALL_PACKET_RECEIVER_H_