1/*
2 *  Copyright (c) 2013 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 WEBRTC_TEST_CHANNEL_TRANSPORT_CHANNEL_TRANSPORT_H_
12#define WEBRTC_TEST_CHANNEL_TRANSPORT_CHANNEL_TRANSPORT_H_
13
14#include "webrtc/test/channel_transport/udp_transport.h"
15
16namespace webrtc {
17
18class VoENetwork;
19
20namespace test {
21
22// Helper class for VoiceEngine tests.
23class VoiceChannelTransport : public UdpTransportData {
24 public:
25  VoiceChannelTransport(VoENetwork* voe_network, int channel);
26
27  virtual ~VoiceChannelTransport();
28
29  // Start implementation of UdpTransportData.
30  void IncomingRTPPacket(const int8_t* incoming_rtp_packet,
31                         const size_t packet_length,
32                         const char* /*from_ip*/,
33                         const uint16_t /*from_port*/) override;
34
35  void IncomingRTCPPacket(const int8_t* incoming_rtcp_packet,
36                          const size_t packet_length,
37                          const char* /*from_ip*/,
38                          const uint16_t /*from_port*/) override;
39  // End implementation of UdpTransportData.
40
41  // Specifies the ports to receive RTP packets on.
42  int SetLocalReceiver(uint16_t rtp_port);
43
44  // Specifies the destination port and IP address for a specified channel.
45  int SetSendDestination(const char* ip_address, uint16_t rtp_port);
46
47 private:
48  int channel_;
49  VoENetwork* voe_network_;
50  UdpTransport* socket_transport_;
51};
52
53}  // namespace test
54}  // namespace webrtc
55
56#endif  // WEBRTC_TEST_CHANNEL_TRANSPORT_CHANNEL_TRANSPORT_H_
57