blob: cb86a98999de06bfee85c568fe98cb6ff23e2082 [file] [log] [blame]
henrik.lundin@webrtc.org810acbc2014-04-14 18:42:23 +00001/*
2 * Copyright (c) 2014 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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_SOURCE_H_
12#define MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_SOURCE_H_
henrik.lundin@webrtc.org810acbc2014-04-14 18:42:23 +000013
henrik.lundin@webrtc.orgc8e98182014-06-26 19:07:04 +000014#include <bitset>
henrik.lundin46ba49c2016-05-24 22:50:47 -070015#include <memory>
henrik.lundin@webrtc.orgc8e98182014-06-26 19:07:04 +000016
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "modules/audio_coding/neteq/tools/packet.h"
18#include "rtc_base/constructormagic.h"
henrik.lundin@webrtc.org810acbc2014-04-14 18:42:23 +000019
20namespace webrtc {
21namespace test {
22
henrik.lundin@webrtc.org810acbc2014-04-14 18:42:23 +000023// Interface class for an object delivering RTP packets to test applications.
24class PacketSource {
25 public:
kwibergb8e56ee2016-08-29 06:37:33 -070026 PacketSource();
27 virtual ~PacketSource();
henrik.lundin@webrtc.org810acbc2014-04-14 18:42:23 +000028
henrik.lundin46ba49c2016-05-24 22:50:47 -070029 // Returns next packet. Returns nullptr if the source is depleted, or if an
30 // error occurred.
31 virtual std::unique_ptr<Packet> NextPacket() = 0;
henrik.lundin@webrtc.org810acbc2014-04-14 18:42:23 +000032
kwibergb8e56ee2016-08-29 06:37:33 -070033 virtual void FilterOutPayloadType(uint8_t payload_type);
henrik.lundin@webrtc.orgc8e98182014-06-26 19:07:04 +000034
35 protected:
36 std::bitset<128> filter_; // Payload type is 7 bits in the RFC.
37
henrik.lundin@webrtc.org810acbc2014-04-14 18:42:23 +000038 private:
henrikg3c089d72015-09-16 05:37:44 -070039 RTC_DISALLOW_COPY_AND_ASSIGN(PacketSource);
henrik.lundin@webrtc.org810acbc2014-04-14 18:42:23 +000040};
41
42} // namespace test
43} // namespace webrtc
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020044#endif // MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_SOURCE_H_