OPAL
Version 3.10.10
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
localep.h
Go to the documentation of this file.
1
/*
2
* localep.h
3
*
4
* Local EndPoint/Connection.
5
*
6
* Open Phone Abstraction Library (OPAL)
7
* Formally known as the Open H323 project.
8
*
9
* Copyright (c) 2008 Vox Lucida Pty. Ltd.
10
*
11
* The contents of this file are subject to the Mozilla Public License
12
* Version 1.0 (the "License"); you may not use this file except in
13
* compliance with the License. You may obtain a copy of the License at
14
* http://www.mozilla.org/MPL/
15
*
16
* Software distributed under the License is distributed on an "AS IS"
17
* basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
18
* the License for the specific language governing rights and limitations
19
* under the License.
20
*
21
* The Original Code is Open Phone Abstraction Library.
22
*
23
* The Initial Developer of the Original Code is Equivalence Pty. Ltd.
24
*
25
* Contributor(s): ______________________________________.
26
*
27
* $Revision: 28040 $
28
* $Author: rjongbloed $
29
* $Date: 2012-07-16 01:23:59 -0500 (Mon, 16 Jul 2012) $
30
*/
31
32
#ifndef OPAL_OPAL_LOCALEP_H
33
#define OPAL_OPAL_LOCALEP_H
34
35
#ifdef P_USE_PRAGMA
36
#pragma interface
37
#endif
38
39
#include <
opal/buildopts.h
>
40
41
#include <
opal/endpoint.h
>
42
43
class
OpalLocalConnection
;
44
45
50
class
OpalLocalEndPoint
:
public
OpalEndPoint
51
{
52
PCLASSINFO(
OpalLocalEndPoint
,
OpalEndPoint
);
53
public
:
58
OpalLocalEndPoint
(
59
OpalManager
&
manager
,
60
const
char
* prefix =
"local"
61
);
62
65
~OpalLocalEndPoint
();
67
80
virtual
OpalMediaFormatList
GetMediaFormats
()
const
;
81
111
virtual
PSafePtr<OpalConnection>
MakeConnection
(
112
OpalCall
& call,
113
const
PString & party,
114
void
* userData = NULL,
115
unsigned
int
options = 0,
116
OpalConnection::StringOptions
* stringOptions = NULL
117
);
119
128
PSafePtr<OpalLocalConnection>
GetLocalConnectionWithLock
(
129
const
PString & token,
130
PSafetyMode mode = PSafeReadWrite
131
) {
return
GetConnectionWithLockAs<OpalLocalConnection>(token, mode); }
132
136
virtual
OpalLocalConnection
*
CreateConnection
(
137
OpalCall
& call,
138
void
* userData,
139
unsigned
options,
140
OpalConnection::StringOptions
* stringOptions
141
);
142
148
virtual
bool
OnOutgoingSetUp
(
149
const
OpalLocalConnection
& connection
150
);
151
157
virtual
bool
OnOutgoingCall
(
158
const
OpalLocalConnection
& connection
159
);
160
169
virtual
bool
OnIncomingCall
(
170
OpalLocalConnection
& connection
171
);
172
177
virtual
bool
AlertingIncomingCall
(
178
const
PString & token,
179
OpalConnection::StringOptions
* options = NULL
180
);
181
186
virtual
bool
AcceptIncomingCall
(
187
const
PString & token,
188
OpalConnection::StringOptions
* options = NULL
189
);
190
195
virtual
bool
RejectIncomingCall
(
196
const
PString & token,
197
const
OpalConnection::CallEndReason
& reason =
OpalConnection::EndedByAnswerDenied
198
);
199
205
virtual
bool
OnUserInput
(
206
const
OpalLocalConnection
& connection,
207
const
PString & indication
208
);
209
218
virtual
bool
OnReadMediaFrame
(
219
const
OpalLocalConnection
& connection,
220
const
OpalMediaStream
& mediaStream,
221
RTP_DataFrame
& frame
222
);
223
232
virtual
bool
OnWriteMediaFrame
(
233
const
OpalLocalConnection
& connection,
234
const
OpalMediaStream
& mediaStream,
235
RTP_DataFrame
& frame
236
);
237
246
virtual
bool
OnReadMediaData
(
247
const
OpalLocalConnection
& connection,
248
const
OpalMediaStream
& mediaStream,
249
void
* data,
250
PINDEX size,
251
PINDEX & length
252
);
253
262
virtual
bool
OnWriteMediaData
(
263
const
OpalLocalConnection
& connection,
264
const
OpalMediaStream
& mediaStream,
265
const
void
* data,
266
PINDEX length,
267
PINDEX & written
268
);
269
291
enum
Synchronicity
{
292
e_Synchronous
,
293
e_Asynchronous
,
294
e_SimulateSyncronous
295
};
296
305
virtual
Synchronicity
GetSynchronicity
(
306
const
OpalMediaFormat
& mediaFormat,
307
bool
isSource
308
)
const
;
309
312
Synchronicity
GetDefaultAudioSynchronicity
()
const
{
return
m_defaultAudioSynchronicity
; }
313
316
void
SetDefaultAudioSynchronicity
(
Synchronicity
sync) {
m_defaultAudioSynchronicity
= sync; }
317
320
Synchronicity
GetDefaultVideoSourceSynchronicity
()
const
{
return
m_defaultVideoSourceSynchronicity
; }
321
324
void
SetDefaultVideoSourceSynchronicity
(
Synchronicity
sync) {
m_defaultVideoSourceSynchronicity
= sync; }
325
328
bool
IsDeferredAlerting
()
const
{
return
m_deferredAlerting
; }
329
332
void
SetDeferredAlerting
(
bool
defer) {
m_deferredAlerting
= defer; }
333
336
bool
IsDeferredAnswer
()
const
{
return
m_deferredAnswer
; }
337
340
void
SetDeferredAnswer
(
bool
defer) {
m_deferredAnswer
= defer; }
342
343
protected
:
344
bool
m_deferredAlerting
;
345
bool
m_deferredAnswer
;
346
347
Synchronicity
m_defaultAudioSynchronicity
;
348
Synchronicity
m_defaultVideoSourceSynchronicity
;
349
350
private
:
351
P_REMOVE_VIRTUAL(
OpalLocalConnection
*,
CreateConnection
(
OpalCall
&,
void
*), 0);
352
P_REMOVE_VIRTUAL(
bool
, IsSynchronous()
const
,
false
);
353
};
354
355
360
class
OpalLocalConnection
:
public
OpalConnection
361
{
362
PCLASSINFO(
OpalLocalConnection
,
OpalConnection
);
363
public
:
368
OpalLocalConnection
(
369
OpalCall
& call,
370
OpalLocalEndPoint
&
endpoint
,
371
void
* userData,
372
unsigned
options,
373
OpalConnection::StringOptions
* stringOptions,
374
char
tokenPrefix =
'L'
375
);
376
379
~OpalLocalConnection
();
381
392
virtual
PBoolean
IsNetworkConnection
()
const
{
return
false
; }
393
395
virtual
void
OnApplyStringOptions
();
396
406
virtual
PBoolean
SetUpConnection
();
407
418
virtual
PBoolean
SetAlerting
(
419
const
PString & calleeName,
420
PBoolean withMedia
421
);
422
433
virtual
PBoolean
SetConnected
();
434
449
virtual
OpalMediaStream
*
CreateMediaStream
(
450
const
OpalMediaFormat
& mediaFormat,
451
unsigned
sessionID,
452
PBoolean isSource
453
);
454
457
virtual
OpalMediaStreamPtr
OpenMediaStream
(
458
const
OpalMediaFormat
& mediaFormat,
459
unsigned
sessionID,
460
bool
isSource
461
);
462
470
virtual
PBoolean
SendUserInputString
(
471
const
PString & value
472
);
474
483
virtual
bool
OnOutgoingSetUp
();
484
491
virtual
bool
OnOutgoing
();
492
501
virtual
bool
OnIncoming
();
502
505
virtual
void
AlertingIncoming
();
506
509
virtual
void
AcceptIncoming
();
511
514
void
*
GetUserData
()
const
{
return
m_userData
; }
516
518
void
SetUserData
(
void
* v) {
m_userData
= v; }
520
521
protected
:
522
OpalLocalEndPoint
&
endpoint
;
523
void
*
m_userData
;
524
};
525
526
531
class
OpalLocalMediaStream
:
public
OpalMediaStream
,
public
OpalMediaStreamPacing
532
{
533
PCLASSINFO(
OpalLocalMediaStream
,
OpalMediaStream
);
534
public
:
539
OpalLocalMediaStream
(
540
OpalLocalConnection
& conn,
541
const
OpalMediaFormat
&
mediaFormat
,
542
unsigned
sessionID
,
543
bool
isSource
,
544
OpalLocalEndPoint::Synchronicity
synchronicity
545
);
547
555
virtual
PBoolean
ReadPacket
(
556
RTP_DataFrame
& packet
557
);
558
564
virtual
PBoolean
WritePacket
(
565
RTP_DataFrame
& packet
566
);
567
571
virtual
PBoolean
ReadData
(
572
BYTE * data,
573
PINDEX size,
574
PINDEX & length
575
);
576
580
virtual
PBoolean
WriteData
(
581
const
BYTE * data,
582
PINDEX length,
583
PINDEX & written
584
);
585
589
virtual
PBoolean
IsSynchronous
()
const
;
591
592
protected
:
593
virtual
void
InternalClose
() { }
594
595
OpalLocalEndPoint::Synchronicity
m_synchronicity
;
596
};
597
598
599
#endif // OPAL_OPAL_LOCALEP_H
600
601
602
// End of File ///////////////////////////////////////////////////////////////
include
opal
localep.h
Generated on Sun Nov 10 2013 22:20:51 for OPAL by
1.8.4