• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
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 
11 #ifndef MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_SOURCE_H_
12 #define MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_SOURCE_H_
13 
14 #include <bitset>
15 #include <memory>
16 
17 #include "modules/audio_coding/neteq/tools/packet.h"
18 #include "rtc_base/constructor_magic.h"
19 
20 namespace webrtc {
21 namespace test {
22 
23 // Interface class for an object delivering RTP packets to test applications.
24 class PacketSource {
25  public:
26   PacketSource();
27   virtual ~PacketSource();
28 
29   // Returns next packet. Returns nullptr if the source is depleted, or if an
30   // error occurred.
31   virtual std::unique_ptr<Packet> NextPacket() = 0;
32 
33   virtual void FilterOutPayloadType(uint8_t payload_type);
34 
35  protected:
36   std::bitset<128> filter_;  // Payload type is 7 bits in the RFC.
37 
38  private:
39   RTC_DISALLOW_COPY_AND_ASSIGN(PacketSource);
40 };
41 
42 }  // namespace test
43 }  // namespace webrtc
44 #endif  // MODULES_AUDIO_CODING_NETEQ_TOOLS_PACKET_SOURCE_H_
45