JRTPLIB  3.10.0
rtptransmitter.h
Go to the documentation of this file.
1 /*
2 
3  This file is a part of JRTPLIB
4  Copyright (c) 1999-2016 Jori Liesenborgs
5 
6  Contact: jori.liesenborgs@gmail.com
7 
8  This library was developed at the Expertise Centre for Digital 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 #include "rtptimeutilities.h"
45 
46 namespace jrtplib
47 {
48 
49 class RTPRawPacket;
50 class RTPAddress;
51 class RTPTransmissionParams;
52 class RTPTime;
53 class RTPTransmissionInfo;
54 
62 class JRTPLIB_IMPORTEXPORT RTPTransmitter : public RTPMemoryObject
63 {
64 public:
71  {
75  UserDefinedProto
76  };
77 
80  {
83  IgnoreSome
84  };
85 protected:
87  RTPTransmitter(RTPMemoryManager *mgr) : RTPMemoryObject(mgr) { timeinit.Dummy(); }
88 public:
89  virtual ~RTPTransmitter() { }
90 
95  virtual int Init(bool threadsafe) = 0;
96 
105  virtual int Create(size_t maxpacksize,const RTPTransmissionParams *transparams) = 0;
106 
110  virtual void Destroy() = 0;
111 
119  virtual RTPTransmissionInfo *GetTransmissionInfo() = 0;
120 
124  virtual void DeleteTransmissionInfo(RTPTransmissionInfo *inf) = 0;
125 
135  virtual int GetLocalHostName(uint8_t *buffer,size_t *bufferlength) = 0;
136 
138  virtual bool ComesFromThisTransmitter(const RTPAddress *addr) = 0;
139 
142  virtual size_t GetHeaderOverhead() = 0;
143 
145  virtual int Poll() = 0;
146 
151  virtual int WaitForIncomingData(const RTPTime &delay,bool *dataavailable = 0) = 0;
152 
154  virtual int AbortWait() = 0;
155 
157  virtual int SendRTPData(const void *data,size_t len) = 0;
158 
160  virtual int SendRTCPData(const void *data,size_t len) = 0;
161 
163  virtual int AddDestination(const RTPAddress &addr) = 0;
164 
166  virtual int DeleteDestination(const RTPAddress &addr) = 0;
167 
169  virtual void ClearDestinations() = 0;
170 
172  virtual bool SupportsMulticasting() = 0;
173 
175  virtual int JoinMulticastGroup(const RTPAddress &addr) = 0;
176 
178  virtual int LeaveMulticastGroup(const RTPAddress &addr) = 0;
179 
181  virtual void LeaveAllMulticastGroups() = 0;
182 
188  virtual int SetReceiveMode(RTPTransmitter::ReceiveMode m) = 0;
189 
191  virtual int AddToIgnoreList(const RTPAddress &addr) = 0;
192 
194  virtual int DeleteFromIgnoreList(const RTPAddress &addr)= 0;
195 
197  virtual void ClearIgnoreList() = 0;
198 
200  virtual int AddToAcceptList(const RTPAddress &addr) = 0;
201 
203  virtual int DeleteFromAcceptList(const RTPAddress &addr) = 0;
204 
206  virtual void ClearAcceptList() = 0;
207 
209  virtual int SetMaximumPacketSize(size_t s) = 0;
210 
212  virtual bool NewDataAvailable() = 0;
213 
216  virtual RTPRawPacket *GetNextPacket() = 0;
217 #ifdef RTPDEBUG
218  virtual void Dump() = 0;
219 #endif // RTPDEBUG
220 };
221 
228 class JRTPLIB_IMPORTEXPORT RTPTransmissionParams
229 {
230 protected:
232 public:
233  virtual ~RTPTransmissionParams() { }
234 
237 private:
239 };
240 
247 class JRTPLIB_IMPORTEXPORT RTPTransmissionInfo
248 {
249 protected:
251 public:
252  virtual ~RTPTransmissionInfo() { }
255 private:
257 };
258 
259 } // end namespace
260 
261 #endif // RTPTRANSMITTER_H
262 
Specifies the internal UDP over IPv4 transmitter.
Definition: rtptransmitter.h:72
Base class for transmission parameters.
Definition: rtptransmitter.h:228
RTPTransmitter::TransmissionProtocol GetTransmissionProtocol() const
Returns the transmitter type for which these parameters are valid.
Definition: rtptransmitter.h:254
RTPTransmitter(RTPMemoryManager *mgr)
Constructor in which you can specify a memory manager to use.
Definition: rtptransmitter.h:87
All incoming data is accepted, no matter where it originated from.
Definition: rtptransmitter.h:81
Abstract class from which actual transmission components should be derived.
Definition: rtptransmitter.h:62
ReceiveMode
Three kind of receive modes can be specified.
Definition: rtptransmitter.h:79
A memory manager.
Definition: rtpmemorymanager.h:150
Specifies the transmitter which can send packets using an external mechanism, and which can have rece...
Definition: rtptransmitter.h:74
Specifies the internal UDP over IPv6 transmitter.
Definition: rtptransmitter.h:73
Base class for additional information about the transmitter.
Definition: rtptransmitter.h:247
RTPTransmitter::TransmissionProtocol GetTransmissionProtocol() const
Returns the transmitter type for which these parameters are valid.
Definition: rtptransmitter.h:236
Only data coming from specific sources will be accepted.
Definition: rtptransmitter.h:82
TransmissionProtocol
Used to identify a specific transmitter.
Definition: rtptransmitter.h:70