OPAL  Version 3.18.8
OpalMixerEndPoint Class Reference

#include <opalmixer.h>

Inheritance diagram for OpalMixerEndPoint:
Collaboration diagram for OpalMixerEndPoint:

Public Member Functions

Construction
 OpalMixerEndPoint (OpalManager &manager, const char *prefix=OPAL_MIXER_PREFIX)
 
 ~OpalMixerEndPoint ()
 
virtual void ShutDown ()
 
Overrides from OpalEndPoint
virtual OpalMediaFormatList GetMediaFormats () const
 
virtual PStringList GetAvailableStringOptions () const
 
virtual PSafePtr< OpalConnectionMakeConnection (OpalCall &call, const PString &party, void *userData=NULL, unsigned options=0, OpalConnection::StringOptions *stringOptions=NULL)
 
virtual bool GetConferenceStates (OpalConferenceStates &states, const PString &name=PString::Empty()) const
 
virtual PBoolean GarbageCollection ()
 
Operations
PSafePtr< OpalMixerConnectionGetMixerConnectionWithLock (const PString &token, PSafetyMode mode=PSafeReadWrite)
 
virtual OpalMixerConnectionCreateConnection (PSafePtr< OpalMixerNode > node, OpalCall &call, void *userData, unsigned options, OpalConnection::StringOptions *stringOptions)
 
virtual OpalMixerNodeInfoFindNodeInfo (const PString &name)
 
Member variable access
void SetAdHocNodeInfo (const OpalMixerNodeInfo &info)
 
void SetAdHocNodeInfo (OpalMixerNodeInfo *info)
 
OpalMixerNodeInfoGetAdHocNodeInfo ()
 
void SetFactoryNodeInfo (const OpalMixerNodeInfo &info)
 
void SetFactoryNodeInfo (OpalMixerNodeInfo *info)
 
virtual PString GetNewFactoryName ()
 
OpalManagerGetManager () const
 Get manager. More...
 
- Public Member Functions inherited from OpalLocalEndPoint
 OpalLocalEndPoint (OpalManager &manager, const char *prefix=OPAL_LOCAL_PREFIX, bool useCallbacks=true)
 
 ~OpalLocalEndPoint ()
 
virtual PSafePtr< OpalConnectionMakeConnection (OpalCall &call, const PString &party, void *userData=NULL, unsigned int options=0, OpalConnection::StringOptions *stringOptions=NULL)
 
PSafePtr< OpalLocalConnectionGetLocalConnectionWithLock (const PString &token, PSafetyMode mode=PSafeReadWrite)
 
virtual OpalLocalConnectionCreateConnection (OpalCall &call, void *userData, unsigned options, OpalConnection::StringOptions *stringOptions)
 
virtual bool OnOutgoingSetUp (const OpalLocalConnection &connection)
 
virtual bool OnOutgoingCall (const OpalLocalConnection &connection)
 
virtual bool OnIncomingCall (OpalLocalConnection &connection)
 
virtual bool AlertingIncomingCall (const PString &token, OpalConnection::StringOptions *options=NULL, bool withMedia=false)
 
virtual bool AcceptIncomingCall (const PString &token, OpalConnection::StringOptions *options=NULL)
 
virtual bool RejectIncomingCall (const PString &token, const OpalConnection::CallEndReason &reason=OpalConnection::EndedByAnswerDenied)
 
virtual bool OnUserInput (const OpalLocalConnection &connection, const PString &indication)
 
Synchronicity GetDefaultAudioSynchronicity () const
 
void SetDefaultAudioSynchronicity (Synchronicity sync)
 
Synchronicity GetDefaultVideoSourceSynchronicity () const
 
void SetDefaultVideoSourceSynchronicity (Synchronicity sync)
 
bool IsDeferredAlerting () const
 
void SetDeferredAlerting (bool defer)
 
bool IsDeferredAnswer () const
 
void SetDeferredAnswer (bool defer)
 
bool WillPauseTransmitMediaOnHold () const
 
void SetPauseTransmitMediaOnHold (bool pause)
 
void SetFarEndCameraCapabilityChangedNotifier (const PNotifier &notifier)
 Set a callback for when the far end camera control capabilities change. More...
 
const PNotifier & GetFarEndCameraCapabilityChangedNotifier () const
 Get a callback for when the far end camera control capabilities change. More...
 
void SetFarEndCameraActionNotifier (const PNotifier &notifier)
 Set a callback for when a far end camera control action comes from remote. More...
 
const PNotifier & GetFarEndCameraActionNotifier () const
 Get a callback for when a far end camera control action comes from remote. More...
 
 P_DECLARE_BITWISE_ENUM (CallbackUsage, 2,(NoCallbacks, UseSourceCallback, UseSinkCallback))
 Enumeration for usage of media callback direction in CallbackMap. More...
 
bool UseCallback (const OpalMediaFormat &mediaFormat, bool isSource) const
 Indicate media type and direction is to use virtual callback functions. More...
 
bool SetCallbackUsage (const OpalMediaType &mediaType, CallbackUsage usage)
 Set callback usage for media type. More...
 
virtual bool OnReadMediaFrame (const OpalLocalConnection &connection, const OpalMediaStream &mediaStream, RTP_DataFrame &frame)
 
virtual bool OnWriteMediaFrame (const OpalLocalConnection &connection, const OpalMediaStream &mediaStream, RTP_DataFrame &frame)
 
virtual bool OnReadMediaData (OpalLocalConnection &connection, OpalMediaStream &mediaStream, void *data, PINDEX size, PINDEX &length)
 
virtual bool OnWriteMediaData (const OpalLocalConnection &connection, const OpalMediaStream &mediaStream, const void *data, PINDEX length, PINDEX &written)
 
virtual bool CreateVideoInputDevice (const OpalConnection &connection, const OpalMediaFormat &mediaFormat, PVideoInputDevice *&device, bool &autoDelete)
 
virtual bool CreateVideoOutputDevice (const OpalConnection &connection, const OpalMediaFormat &mediaFormat, bool preview, PVideoOutputDevice *&device, bool &autoDelete)
 
virtual Synchronicity GetSynchronicity (const OpalMediaFormat &mediaFormat, bool isSource) const
 
- Public Member Functions inherited from OpalEndPoint
 P_DECLARE_BITWISE_ENUM (Attributes, 2,(NoAttributes, IsNetworkEndPoint, SupportsE164))
 
 OpalEndPoint (OpalManager &manager, const PCaselessString &prefix, Attributes attributes)
 
 ~OpalEndPoint ()
 
void PrintOn (ostream &strm) const
 
bool StartListeners (const PStringArray &interfaces, bool add=true)
 
virtual bool StartListener (const PString &address)
 
virtual bool StartListener (OpalListener *listener)
 
virtual PStringArray GetDefaultListeners () const
 
virtual PString GetDefaultTransport () const
 
virtual WORD GetDefaultSignalPort () const
 
OpalListenerFindListener (const OpalTransportAddress &iface)
 
bool FindListenerForProtocol (const char *proto, OpalTransportAddress &addr)
 
PBoolean StopListener (const OpalTransportAddress &iface)
 
PBoolean RemoveListener (OpalListener *listener)
 
OpalTransportAddressArray GetInterfaceAddresses (const OpalTransport *associatedTransport=NULL) const
 
 PDECLARE_AcceptHandlerNotifier (OpalEndPoint, NewIncomingConnection)
 
virtual void OnNewConnection (OpalCall &call, OpalConnection &connection)
 
virtual PBoolean OnSetUpConnection (OpalConnection &connection)
 
virtual PBoolean OnIncomingConnection (OpalConnection &connection, unsigned options, OpalConnection::StringOptions *stringOptions)
 
virtual void OnProceeding (OpalConnection &connection)
 
virtual void OnAlerting (OpalConnection &connection, bool withMedia)
 
virtual void OnAlerting (OpalConnection &connection)
 
virtual
OpalConnection::AnswerCallResponse 
OnAnswerCall (OpalConnection &connection, const PString &caller)
 
virtual void OnConnected (OpalConnection &connection)
 
virtual void OnEstablished (OpalConnection &connection)
 
virtual void OnReleased (OpalConnection &connection)
 
virtual void OnHold (OpalConnection &connection, bool fromRemote, bool onHold)
 
virtual void OnHold (OpalConnection &connection)
 
virtual PBoolean OnForwarded (OpalConnection &connection, const PString &remoteParty)
 
virtual bool OnTransferNotify (OpalConnection &connection, const PStringToString &info, const OpalConnection *transferringConnection)
 
virtual PBoolean ClearCall (const PString &token, OpalConnection::CallEndReason reason=OpalConnection::EndedByLocalUser, PSyncPoint *sync=NULL)
 
virtual PBoolean ClearCallSynchronous (const PString &token, OpalConnection::CallEndReason reason=OpalConnection::EndedByLocalUser, PSyncPoint *sync=NULL)
 
virtual void ClearAllCalls (OpalConnection::CallEndReason reason=OpalConnection::EndedByLocalUser, PBoolean wait=true)
 
PSafePtr< OpalConnectionGetConnectionWithLock (const PString &token, PSafetyMode mode=PSafeReadWrite) const
 
template<class ConnClass >
PSafePtr< ConnClass > GetConnectionWithLockAs (const PString &token, PSafetyMode mode=PSafeReadWrite) const
 
PStringList GetAllConnections ()
 
PINDEX GetConnectionCount () const
 
virtual PBoolean HasConnection (const PString &token)
 
virtual void DestroyConnection (OpalConnection *connection)
 
virtual void AdjustMediaFormats (bool local, const OpalConnection &connection, OpalMediaFormatList &mediaFormats) const
 
virtual bool GetMediaTransportAddresses (const OpalConnection &provider, const OpalConnection &consumer, unsigned sessionId, const OpalMediaType &mediaType, OpalTransportAddressArray &transports) const
 
virtual PBoolean OnOpenMediaStream (OpalConnection &connection, OpalMediaStream &stream)
 
virtual void OnClosedMediaStream (const OpalMediaStream &stream)
 
virtual void OnFailedMediaStream (OpalConnection &connection, bool fromRemote, const PString &reason)
 
void SetMediaCryptoSuites (const PStringArray &security)
 
PStringArray GetMediaCryptoSuites () const
 
virtual PStringArray GetAllMediaCryptoSuites () const
 
virtual void OnUserInputString (OpalConnection &connection, const PString &value)
 
virtual void OnUserInputTone (OpalConnection &connection, char tone, int duration)
 
virtual PString ReadUserInput (OpalConnection &connection, const char *terminators="#\r\n", unsigned lastDigitTimeout=4, unsigned firstDigitTimeout=30)
 
virtual PBoolean Message (const PString &to, const PString &body)
 
virtual PBoolean Message (const PURL &to, const PString &type, const PString &body, PURL &from, PString &conversationId)
 
virtual PBoolean Message (OpalIM &Message)
 
virtual void OnMessageReceived (const OpalIM &message)
 
virtual void OnMWIReceived (const PString &party, OpalManager::MessageWaitingType type, const PString &extraInfo)
 
virtual void OnConferenceStatusChanged (OpalEndPoint &endpoint, const PString &uri, OpalConferenceState::ChangeType change)
 
virtual PStringList GetNetworkURIs (const PString &name) const
 
OpalManagerGetManager () const
 
const PString & GetPrefixName () const
 
bool HasAttribute (Attributes opt) const
 
const OpalProductInfoGetProductInfo () const
 
void SetProductInfo (const OpalProductInfo &info)
 
const PString & GetDefaultLocalPartyName () const
 
virtual void SetDefaultLocalPartyName (const PString &name)
 
const PString & GetDefaultDisplayName () const
 
void SetDefaultDisplayName (const PString &name)
 
OpalBandwidth GetInitialBandwidth (OpalBandwidth::Direction dir) const
 
bool SetInitialBandwidth (OpalBandwidth::Direction dir, OpalBandwidth bandwidth)
 
const OpalListenerList & GetListeners () const
 
const
OpalConnection::StringOptions
GetDefaultStringOptions () const
 
void SetDefaultStringOptions (const OpalConnection::StringOptions &opts, bool overwrite=false)
 
void SetDefaultStringOption (const PCaselessString &key, const PString &data)
 
void RemoveDefaultStringOption (const PCaselessString &key)
 
OpalConnection::SendUserInputModes GetSendUserInputMode () const
 
void SetSendUserInputMode (OpalConnection::SendUserInputModes mode)
 
const PIPSocket::QoS & GetSignalQoS () const
 
void SetSignalQoS (const PIPSocket::QoS &qos)
 
const PIPSocket::QoS & GetMediaQoS (const OpalMediaType &type) const
 
void SetMediaQoS (const OpalMediaType &type, const PIPSocket::QoS &qos)
 
PINDEX GetMaxSizeUDP () const
 
void SetMaxSizeUDP (PINDEX size)
 
- Public Member Functions inherited from OpalMixerNodeManager
 OpalMixerNodeManager (OpalManager &manager)
 
virtual ~OpalMixerNodeManager ()
 
virtual OpalMixerNodeCreateNode (OpalMixerNodeInfo *info)
 
virtual PSafePtr< OpalMixerNodeAddNode (OpalMixerNodeInfo *info)
 
void AddNode (OpalMixerNode *node)
 
PSafePtr< OpalMixerNodeGetFirstNode (PSafetyMode mode=PSafeReference) const
 
virtual PSafePtr< OpalMixerNodeFindNode (const PString &name, PSafetyMode mode=PSafeReference)
 
virtual void RemoveNode (OpalMixerNode &node)
 
bool AddNodeName (PString name, OpalMixerNode *node)
 
void RemoveNodeName (PString name)
 
void RemoveNodeNames (const PStringSet &names)
 
virtual OpalAudioStreamMixerCreateAudioMixer (const OpalMixerNodeInfo &info)
 Create the instance of the audio mixer. More...
 
virtual OpalVideoStreamMixerCreateVideoMixer (const OpalMixerNodeInfo &info)
 Create the instance of the video mixer. More...
 
OpalManagerGetManager () const
 Get manager. More...
 

Protected Member Functions

virtual PString CreateInternalURI (const PGloballyUniqueID &guid)
 
virtual void OnNodeStatusChanged (const OpalMixerNode &node, OpalConferenceState::ChangeType change)
 
 PDECLARE_MUTEX (m_infoMutex)
 
- Protected Member Functions inherited from OpalEndPoint
OpalConnectionAddConnection (OpalConnection *connection)
 

Protected Attributes

OpalMixerNodeInfom_adHocNodeInfo
 
OpalMixerNodeInfom_factoryNodeInfo
 
atomic< uint32_t > m_factoryIndex
 
- Protected Attributes inherited from OpalLocalEndPoint
bool m_deferredAlerting
 
bool m_deferredAnswer
 
bool m_pauseTransmitMediaOnHold
 
CallbackMap m_useCallback
 
Synchronicity m_defaultAudioSynchronicity
 
Synchronicity m_defaultVideoSourceSynchronicity
 
PNotifier m_farEndCameraCapabilityChangedNotifier
 
PNotifier m_farEndCameraActionNotifier
 
- Protected Attributes inherited from OpalEndPoint
OpalManagerm_manager
 
PCaselessString m_prefixName
 
Attributes m_attributes
 
PINDEX m_maxSizeUDP
 
OpalProductInfo m_productInfo
 
PString m_defaultLocalPartyName
 
PString m_defaultDisplayName
 
PStringArray m_mediaCryptoSuites
 
PIPSocket::QoS m_signalQoS
 
OpalManager::MediaQoSMap m_mediaQoS
 
OpalBandwidth m_initialRxBandwidth
 
OpalBandwidth m_initialTxBandwidth
 
OpalConnection::StringOptions m_defaultStringOptions
 
OpalConnection::SendUserInputModes m_defaultSendUserInputMode
 
OpalListenerList m_listeners
 
OpalEndPoint::ConnectionDict m_connectionsActive
 
- Protected Attributes inherited from OpalMixerNodeManager
OpalManagerm_manager
 
PSafeDictionary
< PGloballyUniqueID,
OpalMixerNode
m_nodesByUID
 
PSafeDictionary< PString,
OpalMixerNode
m_nodesByName
 

Detailed Description

Mixer EndPoint. This class represents an endpoint that mixes media. It can be used as the basis for a Multipoint Conferencing Unit.

Constructor & Destructor Documentation

OpalMixerEndPoint::OpalMixerEndPoint ( OpalManager manager,
const char *  prefix = OPAL_MIXER_PREFIX 
)

Create a new endpoint.

Parameters
managerManager of all endpoints.
prefixPrefix for URL style address strings
OpalMixerEndPoint::~OpalMixerEndPoint ( )

Destroy endpoint.

Member Function Documentation

virtual OpalMixerConnection* OpalMixerEndPoint::CreateConnection ( PSafePtr< OpalMixerNode node,
OpalCall call,
void *  userData,
unsigned  options,
OpalConnection::StringOptions stringOptions 
)
virtual

Create a connection for the PCSS endpoint. The default implementation is to create a OpalMixerConnection.

Parameters
nodeNode the connection is in
callOwner of connection
userDataArbitrary data to pass to connection
optionsOption bit mask to pass to connection
stringOptionsOptions to pass to connection
virtual PString OpalMixerEndPoint::CreateInternalURI ( const PGloballyUniqueID &  guid)
protectedvirtual

Internal function to get internal URI string.

Reimplemented from OpalMixerNodeManager.

virtual OpalMixerNodeInfo* OpalMixerEndPoint::FindNodeInfo ( const PString &  name)
virtual

Get Node Info for the given alias name. Default behaviour returns a clone of m_adHocNodeInfo.

virtual PBoolean OpalMixerEndPoint::GarbageCollection ( )
virtual

Execute garbage collection for endpoint. Returns true if all garbage has been collected. Default behaviour deletes the objects in the connectionsActive list.

Reimplemented from OpalMixerNodeManager.

OpalMixerNodeInfo* OpalMixerEndPoint::GetAdHocNodeInfo ( )
inline

Get default ad hoc mode information. The pointer returned from this function is passed to the CreateNode() function, so may be a reference to derived class, which a derived class of OpalMixerNode could use.

Note if NULL, then ad hoc nodes are not created and incoming connections are refused. A user must expicitly call AddNode() to create a name that can be connected to.

Default bahaviour returns member variable m_adHocNodeInfo.

References m_adHocNodeInfo.

virtual PStringList OpalMixerEndPoint::GetAvailableStringOptions ( ) const
virtual

Get available string option names.

Reimplemented from OpalEndPoint.

virtual bool OpalMixerEndPoint::GetConferenceStates ( OpalConferenceStates states,
const PString &  name = PString::Empty() 
) const
virtual

Get conference state information for all nodes. This obtains the state of one or more conferences managed by this endpoint. If this endpoint does not do conferencing, then false is returned.

The name parameter may be one of the aliases for the conference, or the internal URI for the conference. An empty string indicates all active conferences are to be returned.

Note that if the name does not match an active conference, true is still returned, but the states list will be empty.

The default behaviour returns false indicating this is not a conferencing endpoint.

Parameters
statesList of conference states
nameName for specific node, empty string is all

Reimplemented from OpalEndPoint.

OpalManager& OpalMixerEndPoint::GetManager ( ) const
inline

Get manager.

References OpalEndPoint::GetManager().

virtual OpalMediaFormatList OpalMixerEndPoint::GetMediaFormats ( ) const
virtual

Get the data formats this endpoint is capable of operating. This provides a list of media data format names that may be used by an OpalMediaStream may be created by a connection from this endpoint.

Note that a specific connection may not actually support all of the media formats returned here, but should return no more.

The default behaviour returns the most basic media formats, PCM audio and YUV420P video.

Reimplemented from OpalLocalEndPoint.

PSafePtr<OpalMixerConnection> OpalMixerEndPoint::GetMixerConnectionWithLock ( const PString &  token,
PSafetyMode  mode = PSafeReadWrite 
)
inline

Find a connection that uses the specified token. This searches the endpoint for the connection that contains the token as provided by functions such as MakeConnection(). If not then it attempts to use the token as a OpalCall token and find a connection of the same class.

Parameters
tokenToken to identify connection
modeLock mode
virtual PString OpalMixerEndPoint::GetNewFactoryName ( )
virtual

Generate a new name when a factory generated node is created. The default is to append a monitonic increasing integer to the factory name.

virtual PSafePtr<OpalConnection> OpalMixerEndPoint::MakeConnection ( OpalCall call,
const PString &  party,
void *  userData = NULL,
unsigned  options = 0,
OpalConnection::StringOptions stringOptions = NULL 
)
virtual

Set up a connection to a remote party. This is called from the OpalManager::MakeConnection() function once it has determined that this is the endpoint for the protocol.

The general form for this party parameter is:

 [proto:][alias@][transport$]address[:port]

where the various fields will have meanings specific to the endpoint type. For example, with H.323 it could be "h323:Fred@site.com" which indicates a user Fred at gatekeeper size.com. Whereas for the PSTN endpoint it could be "pstn:5551234" which is to call 5551234 on the first available PSTN line.

The proto field is optional when passed to a specific endpoint. If it is present, however, it must agree with the endpoints protocol name or false is returned.

This function usually returns almost immediately with the connection continuing to occur in a new background thread.

If false is returned then the connection could not be established. For example if a PSTN endpoint is used and the assiciated line is engaged then it may return immediately. Returning a non-NULL value does not mean that the connection will succeed, only that an attempt is being made.

Parameters
callOwner of connection
partyRemote party to call
userDataArbitrary data to pass to connection
optionsOption bit mask to pass to connection
stringOptionsOptions to pass to connection
virtual void OpalMixerEndPoint::OnNodeStatusChanged ( const OpalMixerNode node,
OpalConferenceState::ChangeType  change 
)
protectedvirtual

Call back when mixed node state information changes.

Default behaviour does nothing.

Reimplemented from OpalMixerNodeManager.

OpalMixerEndPoint::PDECLARE_MUTEX ( m_infoMutex  )
protected
void OpalMixerEndPoint::SetAdHocNodeInfo ( const OpalMixerNodeInfo info)

Set default ad hoc node information. The pointer is passed to the CreateNode() function, so may be a reference to derived class, which a derived class of OpalMixerNode could use.

Note if NULL, then ad hoc nodes are not created and incoming connections are refused. A user must expicitly call AddNode() to create a name that can be connected to.

The version that takes a reference will utilise the Clone() function to create a copy of the mixer info.

void OpalMixerEndPoint::SetAdHocNodeInfo ( OpalMixerNodeInfo info)
void OpalMixerEndPoint::SetFactoryNodeInfo ( const OpalMixerNodeInfo info)

Set factory node information. If an incoming connections destination address is the info->m_name, then a new node is created and the incoming call is forwarded to it. This is an alternative to enabling ad-hoc nodes and follows the RFC4353 model.

The pointer is passed to the CreateNode() function, so may be a reference to derived class, which a derived class of OpalMixerNode could use.

Note if NULL, then factory nodes are not created and incoming connections are refused. A user must expicitly call AddNode() to create a name that can be connected to.

The version that takes a reference will utilise the Clone() function to create a copy of the mixer info.

void OpalMixerEndPoint::SetFactoryNodeInfo ( OpalMixerNodeInfo info)
virtual void OpalMixerEndPoint::ShutDown ( )
virtual

Shut down the endpoint, this is called by the OpalManager just before destroying the object and can be handy to make sure some things are stopped before the vtable gets clobbered.

Reimplemented from OpalMixerNodeManager.

Field Documentation

OpalMixerNodeInfo* OpalMixerEndPoint::m_adHocNodeInfo
protected

Referenced by GetAdHocNodeInfo().

atomic<uint32_t> OpalMixerEndPoint::m_factoryIndex
protected
OpalMixerNodeInfo* OpalMixerEndPoint::m_factoryNodeInfo
protected

The documentation for this class was generated from the following file: