blob: b159c81b5ab8e07dd3bbaff1a931a6116da8e66e [file] [log] [blame]
andrew@webrtc.orga7b57da2012-10-22 18:19:23 +00001/*
2 * Copyright (c) 2012 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_VOICE_ENGINE_VOE_NETWORK_IMPL_H
12#define WEBRTC_VOICE_ENGINE_VOE_NETWORK_IMPL_H
13
14#include "voe_network.h"
15
16#include "shared_data.h"
17
18
19namespace webrtc
20{
21
22class VoENetworkImpl: public VoENetwork
23{
24public:
25 virtual int RegisterExternalTransport(int channel, Transport& transport);
26
27 virtual int DeRegisterExternalTransport(int channel);
28
29 virtual int ReceivedRTPPacket(int channel,
30 const void* data,
31 unsigned int length);
32
33 virtual int ReceivedRTCPPacket(int channel,
34 const void* data,
35 unsigned int length);
36
37 virtual int GetSourceInfo(int channel,
38 int& rtpPort,
39 int& rtcpPort,
40 char ipAddr[64]);
41
42 virtual int GetLocalIP(char ipAddr[64], bool ipv6 = false);
43
44 virtual int EnableIPv6(int channel);
45
46 virtual bool IPv6IsEnabled(int channel);
47
48 virtual int SetSourceFilter(int channel,
49 int rtpPort,
50 int rtcpPort,
51 const char ipAddr[64] = 0);
52
53 virtual int GetSourceFilter(int channel,
54 int& rtpPort,
55 int& rtcpPort,
56 char ipAddr[64]);
57
58 virtual int SetSendTOS(int channel,
59 int DSCP,
60 int priority = -1,
61 bool useSetSockopt = false);
62
63 virtual int GetSendTOS(int channel,
64 int& DSCP,
65 int& priority,
66 bool& useSetSockopt);
67
68 virtual int SetSendGQoS(int channel,
69 bool enable,
70 int serviceType,
71 int overrideDSCP);
72
73 virtual int GetSendGQoS(int channel,
74 bool& enabled,
75 int& serviceType,
76 int& overrideDSCP);
77
78 virtual int SetPacketTimeoutNotification(int channel,
79 bool enable,
80 int timeoutSeconds = 2);
81
82 virtual int GetPacketTimeoutNotification(int channel,
83 bool& enabled,
84 int& timeoutSeconds);
85
86 virtual int RegisterDeadOrAliveObserver(int channel,
87 VoEConnectionObserver& observer);
88
89 virtual int DeRegisterDeadOrAliveObserver(int channel);
90
91 virtual int SetPeriodicDeadOrAliveStatus(int channel,
92 bool enable,
93 int sampleTimeSeconds = 2);
94
95 virtual int GetPeriodicDeadOrAliveStatus(int channel,
96 bool& enabled,
97 int& sampleTimeSeconds);
98
99 virtual int SendUDPPacket(int channel,
100 const void* data,
101 unsigned int length,
102 int& transmittedBytes,
103 bool useRtcpSocket = false);
104
105protected:
106 VoENetworkImpl(voe::SharedData* shared);
107 virtual ~VoENetworkImpl();
108private:
109 voe::SharedData* _shared;
110};
111
112} // namespace webrtc
113
114#endif // WEBRTC_VOICE_ENGINE_VOE_NETWORK_IMPL_H