2014-04-14 18:42:23 +00:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2014 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_SOURCE_H_
|
|
|
|
|
#define MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_SOURCE_H_
|
2014-04-14 18:42:23 +00:00
|
|
|
|
2014-06-26 19:07:04 +00:00
|
|
|
#include <bitset>
|
2016-05-24 22:50:47 -07:00
|
|
|
#include <memory>
|
2014-06-26 19:07:04 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#include "modules/audio_coding/neteq/tools/packet.h"
|
2019-01-11 09:11:00 -08:00
|
|
|
#include "rtc_base/constructor_magic.h"
|
2014-04-14 18:42:23 +00:00
|
|
|
|
|
|
|
|
namespace webrtc {
|
|
|
|
|
namespace test {
|
|
|
|
|
|
|
|
|
|
// Interface class for an object delivering RTP packets to test applications.
|
|
|
|
|
class PacketSource {
|
|
|
|
|
public:
|
2016-08-29 06:37:33 -07:00
|
|
|
PacketSource();
|
|
|
|
|
virtual ~PacketSource();
|
2014-04-14 18:42:23 +00:00
|
|
|
|
2016-05-24 22:50:47 -07:00
|
|
|
// Returns next packet. Returns nullptr if the source is depleted, or if an
|
|
|
|
|
// error occurred.
|
|
|
|
|
virtual std::unique_ptr<Packet> NextPacket() = 0;
|
2014-04-14 18:42:23 +00:00
|
|
|
|
2016-08-29 06:37:33 -07:00
|
|
|
virtual void FilterOutPayloadType(uint8_t payload_type);
|
2014-06-26 19:07:04 +00:00
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
std::bitset<128> filter_; // Payload type is 7 bits in the RFC.
|
|
|
|
|
|
2014-04-14 18:42:23 +00:00
|
|
|
private:
|
2015-09-16 05:37:44 -07:00
|
|
|
RTC_DISALLOW_COPY_AND_ASSIGN(PacketSource);
|
2014-04-14 18:42:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace test
|
|
|
|
|
} // namespace webrtc
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_SOURCE_H_
|