00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097 #ifndef __OPAL_PCSS_H
00098 #define __OPAL_PCSS_H
00099
00100 #ifdef P_USE_PRAGMA
00101 #pragma interface
00102 #endif
00103
00104 #include <opal/buildopts.h>
00105
00106 #include <opal/endpoint.h>
00107
00108
00109 class OpalPCSSConnection;
00110
00111
00114 class OpalPCSSEndPoint : public OpalEndPoint
00115 {
00116 PCLASSINFO(OpalPCSSEndPoint, OpalEndPoint);
00117 public:
00122 OpalPCSSEndPoint(
00123 OpalManager & manager,
00124 const char * prefix = "pc"
00125 );
00126
00129 ~OpalPCSSEndPoint();
00131
00163 virtual BOOL MakeConnection(
00164 OpalCall & call,
00165 const PString & party,
00166 void * userData = NULL
00167 );
00168
00178 virtual OpalMediaFormatList GetMediaFormats() const;
00180
00186 virtual OpalPCSSConnection * CreateConnection(
00187 OpalCall & call,
00188 const PString & playDevice,
00189 const PString & recordDevice,
00190 void * userData
00191 );
00192
00195 virtual PSoundChannel * CreateSoundChannel(
00196 const OpalPCSSConnection & connection,
00197 const OpalMediaFormat & mediaFormat,
00198 BOOL isSource
00199 );
00201
00208 PSafePtr<OpalPCSSConnection> GetPCSSConnectionWithLock(
00209 const PString & token,
00210 PSafetyMode mode = PSafeReadWrite
00211 ) { return PSafePtrCast<OpalConnection, OpalPCSSConnection>(GetConnectionWithLock(token, mode)); }
00212
00218 virtual PString OnGetDestination(
00219 const OpalPCSSConnection & connection
00220 ) = 0;
00221
00227 virtual void OnShowIncoming(
00228 const OpalPCSSConnection & connection
00229 ) = 0;
00230
00233 virtual void AcceptIncomingConnection(
00234 const PString & connectionToken
00235 );
00236
00242 virtual BOOL OnShowOutgoing(
00243 const OpalPCSSConnection & connection
00244 ) = 0;
00245
00251 virtual BOOL OnShowUserInput(
00252 const OpalPCSSConnection & connection,
00253 const PString & indication
00254 );
00255
00256
00261 virtual void OnPatchMediaStream(
00262 const OpalPCSSConnection & connection,
00263 BOOL isSource,
00264 OpalMediaPatch & patch
00265 );
00267
00277 virtual BOOL SetSoundChannelPlayDevice(const PString & name);
00278
00283 const PString & GetSoundChannelPlayDevice() const { return soundChannelPlayDevice; }
00284
00292 virtual BOOL SetSoundChannelRecordDevice(const PString & name);
00293
00298 const PString & GetSoundChannelRecordDevice() const { return soundChannelRecordDevice; }
00299
00302 unsigned GetSoundChannelBufferDepth() const { return soundChannelBuffers; }
00303
00306 void SetSoundChannelBufferDepth(
00307 unsigned depth
00308 );
00310
00311 protected:
00312 PString soundChannelPlayDevice;
00313 PString soundChannelRecordDevice;
00314 unsigned soundChannelBuffers;
00315 };
00316
00317
00320 class OpalPCSSConnection : public OpalConnection
00321 {
00322 PCLASSINFO(OpalPCSSConnection, OpalConnection);
00323 public:
00328 OpalPCSSConnection(
00329 OpalCall & call,
00330 OpalPCSSEndPoint & endpoint,
00331 const PString & playDevice,
00332 const PString & recordDevice
00333 );
00334
00337 ~OpalPCSSConnection();
00339
00348 virtual BOOL SetUpConnection();
00349
00360 virtual BOOL SetAlerting(
00361 const PString & calleeName,
00362 BOOL withMedia
00363 );
00364
00369 virtual BOOL SetConnected();
00370
00377 virtual PString GetDestinationAddress();
00378
00386 virtual OpalMediaFormatList GetMediaFormats() const;
00387
00402 virtual OpalMediaStream * CreateMediaStream(
00403 const OpalMediaFormat & mediaFormat,
00404 unsigned sessionID,
00405 BOOL isSource
00406 );
00407
00415 virtual void OnPatchMediaStream(
00416 BOOL isSource,
00417 OpalMediaPatch & patch
00418 );
00419
00422 virtual BOOL OpenSourceMediaStream(
00423 const OpalMediaFormatList & mediaFormats,
00424 unsigned sessionID
00425 );
00426
00429 virtual OpalMediaStream * OpenSinkMediaStream(
00430 OpalMediaStream & source
00431 );
00432
00440 virtual BOOL SendUserInputString(
00441 const PString & value
00442 );
00444
00449 virtual void InitiateCall();
00450
00453 virtual void AcceptIncoming();
00454
00457 virtual PSoundChannel * CreateSoundChannel(
00458 const OpalMediaFormat & mediaFormat,
00459 BOOL isSource
00460 );
00462
00469 const PString & GetSoundChannelPlayDevice() const { return soundChannelPlayDevice; }
00470
00475 const PString & GetSoundChannelRecordDevice() const { return soundChannelRecordDevice; }
00476
00479 unsigned GetSoundChannelBufferDepth() const { return soundChannelBuffers; }
00481
00482
00483 protected:
00484 OpalPCSSEndPoint & endpoint;
00485 PString soundChannelPlayDevice;
00486 PString soundChannelRecordDevice;
00487 unsigned soundChannelBuffers;
00488 };
00489
00490
00491 #endif // __OPAL_PCSS_H
00492
00493
00494