aboutsummaryrefslogtreecommitdiff
path: root/webrtc/test/channel_transport/channel_transport.h
diff options
context:
space:
mode:
Diffstat (limited to 'webrtc/test/channel_transport/channel_transport.h')
-rw-r--r--webrtc/test/channel_transport/channel_transport.h56
1 files changed, 56 insertions, 0 deletions
diff --git a/webrtc/test/channel_transport/channel_transport.h b/webrtc/test/channel_transport/channel_transport.h
new file mode 100644
index 0000000000..bab7c59181
--- /dev/null
+++ b/webrtc/test/channel_transport/channel_transport.h
@@ -0,0 +1,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_