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_INCLUDE_CHANNEL_TRANSPORT_H_ 12 #define WEBRTC_TEST_CHANNEL_TRANSPORT_INCLUDE_CHANNEL_TRANSPORT_H_ 13 14 #include "webrtc/test/channel_transport/udp_transport.h" 15 16 namespace webrtc { 17 18 class ViENetwork; 19 class VoENetwork; 20 21 namespace test { 22 23 // Helper class for VoiceEngine tests. 24 class VoiceChannelTransport : public UdpTransportData { 25 public: 26 VoiceChannelTransport(VoENetwork* voe_network, int channel); 27 28 virtual ~VoiceChannelTransport(); 29 30 // Start implementation of UdpTransportData. 31 virtual void IncomingRTPPacket(const int8_t* incoming_rtp_packet, 32 const int32_t packet_length, 33 const char* /*from_ip*/, 34 const uint16_t /*from_port*/) OVERRIDE; 35 36 virtual void IncomingRTCPPacket(const int8_t* incoming_rtcp_packet, 37 const int32_t packet_length, 38 const char* /*from_ip*/, 39 const uint16_t /*from_port*/) OVERRIDE; 40 // End implementation of UdpTransportData. 41 42 // Specifies the ports to receive RTP packets on. 43 int SetLocalReceiver(uint16_t rtp_port); 44 45 // Specifies the destination port and IP address for a specified channel. 46 int SetSendDestination(const char* ip_address, uint16_t rtp_port); 47 48 private: 49 int channel_; 50 VoENetwork* voe_network_; 51 UdpTransport* socket_transport_; 52 }; 53 54 // Helper class for VideoEngine tests. 55 class VideoChannelTransport : public UdpTransportData { 56 public: 57 VideoChannelTransport(ViENetwork* vie_network, int channel); 58 59 virtual ~VideoChannelTransport(); 60 61 // Start implementation of UdpTransportData. 62 virtual void IncomingRTPPacket(const int8_t* incoming_rtp_packet, 63 const int32_t packet_length, 64 const char* /*from_ip*/, 65 const uint16_t /*from_port*/) OVERRIDE; 66 67 virtual void IncomingRTCPPacket(const int8_t* incoming_rtcp_packet, 68 const int32_t packet_length, 69 const char* /*from_ip*/, 70 const uint16_t /*from_port*/) OVERRIDE; 71 // End implementation of UdpTransportData. 72 73 // Specifies the ports to receive RTP packets on. 74 int SetLocalReceiver(uint16_t rtp_port); 75 76 // Specifies the destination port and IP address for a specified channel. 77 int SetSendDestination(const char* ip_address, uint16_t rtp_port); 78 79 private: 80 int channel_; 81 ViENetwork* vie_network_; 82 UdpTransport* socket_transport_; 83 }; 84 85 } // namespace test 86 } // namespace webrtc 87 88 #endif // WEBRTC_TEST_CHANNEL_TRANSPORT_INCLUDE_CHANNEL_TRANSPORT_H_ 89