jrtplib
3.7.1
Main Page
Classes
Files
File List
File Members
src
rtptransmitter.h
Go to the documentation of this file.
1
/*
2
3
This file is a part of JRTPLIB
4
Copyright (c) 1999-2007 Jori Liesenborgs
5
6
Contact: jori.liesenborgs@gmail.com
7
8
This library was developed at the "Expertisecentrum Digitale Media"
9
(http://www.edm.uhasselt.be), a research center of the Hasselt University
10
(http://www.uhasselt.be). The library is based upon work done for
11
my thesis at the School for Knowledge Technology (Belgium/The Netherlands).
12
13
Permission is hereby granted, free of charge, to any person obtaining a
14
copy of this software and associated documentation files (the "Software"),
15
to deal in the Software without restriction, including without limitation
16
the rights to use, copy, modify, merge, publish, distribute, sublicense,
17
and/or sell copies of the Software, and to permit persons to whom the
18
Software is furnished to do so, subject to the following conditions:
19
20
The above copyright notice and this permission notice shall be included
21
in all copies or substantial portions of the Software.
22
23
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
29
IN THE SOFTWARE.
30
31
*/
32
37
#ifndef RTPTRANSMITTER_H
38
39
#define RTPTRANSMITTER_H
40
41
#include "rtpconfig.h"
42
#include "rtptypes.h"
43
#include "
rtpmemoryobject.h
"
44
45
class
RTPRawPacket
;
46
class
RTPAddress
;
47
class
RTPTransmissionParams
;
48
class
RTPTime
;
49
class
RTPTransmissionInfo
;
50
57
class
RTPTransmitter
:
public
RTPMemoryObject
58
{
59
public
:
65
enum
TransmissionProtocol
66
{
67
IPv4UDPProto
,
68
IPv6UDPProto
,
69
UserDefinedProto
70
};
71
73
enum
ReceiveMode
74
{
75
AcceptAll
,
76
AcceptSome
,
77
IgnoreSome
78
};
79
protected
:
81
RTPTransmitter
(
RTPMemoryManager
*mgr) : RTPMemoryObject(mgr) { }
82
public
:
83
virtual
~
RTPTransmitter
() { }
84
89
virtual
int
Init
(
bool
threadsafe) = 0;
90
99
virtual
int
Create
(
size_t
maxpacksize,
const
RTPTransmissionParams
*transparams) = 0;
100
104
virtual
void
Destroy
() = 0;
105
113
virtual
RTPTransmissionInfo
*
GetTransmissionInfo
() = 0;
114
124
virtual
int
GetLocalHostName
(uint8_t *buffer,
size_t
*bufferlength) = 0;
125
127
virtual
bool
ComesFromThisTransmitter
(
const
RTPAddress
*addr) = 0;
128
131
virtual
size_t
GetHeaderOverhead
() = 0;
132
134
virtual
int
Poll
() = 0;
135
140
virtual
int
WaitForIncomingData
(
const
RTPTime
&delay,
bool
*dataavailable = 0) = 0;
141
143
virtual
int
AbortWait
() = 0;
144
146
virtual
int
SendRTPData
(
const
void
*data,
size_t
len) = 0;
147
149
virtual
int
SendRTCPData
(
const
void
*data,
size_t
len) = 0;
150
152
virtual
int
AddDestination
(
const
RTPAddress
&addr) = 0;
153
155
virtual
int
DeleteDestination
(
const
RTPAddress
&addr) = 0;
156
158
virtual
void
ClearDestinations
() = 0;
159
161
virtual
bool
SupportsMulticasting
() = 0;
162
164
virtual
int
JoinMulticastGroup
(
const
RTPAddress
&addr) = 0;
165
167
virtual
int
LeaveMulticastGroup
(
const
RTPAddress
&addr) = 0;
168
170
virtual
void
LeaveAllMulticastGroups
() = 0;
171
177
virtual
int
SetReceiveMode
(
RTPTransmitter::ReceiveMode
m) = 0;
178
180
virtual
int
AddToIgnoreList
(
const
RTPAddress
&addr) = 0;
181
183
virtual
int
DeleteFromIgnoreList
(
const
RTPAddress
&addr)= 0;
184
186
virtual
void
ClearIgnoreList
() = 0;
187
189
virtual
int
AddToAcceptList
(
const
RTPAddress
&addr) = 0;
190
192
virtual
int
DeleteFromAcceptList
(
const
RTPAddress
&addr) = 0;
193
195
virtual
void
ClearAcceptList
() = 0;
196
198
virtual
int
SetMaximumPacketSize
(
size_t
s) = 0;
199
201
virtual
bool
NewDataAvailable
() = 0;
202
205
virtual
RTPRawPacket
*
GetNextPacket
() = 0;
206
#ifdef RTPDEBUG
207
virtual
void
Dump() = 0;
208
#endif // RTPDEBUG
209
};
210
217
class
RTPTransmissionParams
218
{
219
protected
:
220
RTPTransmissionParams
(
RTPTransmitter::TransmissionProtocol
p) { protocol = p; }
221
public
:
222
virtual
~
RTPTransmissionParams
() { }
223
225
RTPTransmitter::TransmissionProtocol
GetTransmissionProtocol
()
const
{
return
protocol; }
226
private
:
227
RTPTransmitter::TransmissionProtocol
protocol;
228
};
229
236
class
RTPTransmissionInfo
237
{
238
protected
:
239
RTPTransmissionInfo
(
RTPTransmitter::TransmissionProtocol
p) { protocol = p; }
240
public
:
241
virtual
~
RTPTransmissionInfo
() { }
243
RTPTransmitter::TransmissionProtocol
GetTransmissionProtocol
()
const
{
return
protocol; }
244
private
:
245
RTPTransmitter::TransmissionProtocol
protocol;
246
};
247
248
#endif // RTPTRANSMITTER_H
249
Generated by
1.8.1.1