aboutsummaryrefslogtreecommitdiff
path: root/webrtc/test/channel_transport/channel_transport.h
blob: bab7c591813b37de1d3bfe93e862bb7fdea0c791 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
 *  Copyright (c) 2013 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.
 */

#ifndef WEBRTC_TEST_CHANNEL_TRANSPORT_CHANNEL_TRANSPORT_H_
#define WEBRTC_TEST_CHANNEL_TRANSPORT_CHANNEL_TRANSPORT_H_

#include "webrtc/test/channel_transport/udp_transport.h"

namespace webrtc {

class VoENetwork;

namespace test {

// Helper class for VoiceEngine tests.
class VoiceChannelTransport : public UdpTransportData {
 public:
  VoiceChannelTransport(VoENetwork* voe_network, int channel);

  virtual ~VoiceChannelTransport();

  // Start implementation of UdpTransportData.
  void IncomingRTPPacket(const int8_t* incoming_rtp_packet,
                         const size_t packet_length,
                         const char* /*from_ip*/,
                         const uint16_t /*from_port*/) override;

  void IncomingRTCPPacket(const int8_t* incoming_rtcp_packet,
                          const size_t packet_length,
                          const char* /*from_ip*/,
                          const uint16_t /*from_port*/) override;
  // End implementation of UdpTransportData.

  // Specifies the ports to receive RTP packets on.
  int SetLocalReceiver(uint16_t rtp_port);

  // Specifies the destination port and IP address for a specified channel.
  int SetSendDestination(const char* ip_address, uint16_t rtp_port);

 private:
  int channel_;
  VoENetwork* voe_network_;
  UdpTransport* socket_transport_;
};

}  // namespace test
}  // namespace webrtc

#endif  // WEBRTC_TEST_CHANNEL_TRANSPORT_CHANNEL_TRANSPORT_H_