reSIProcate
SIP stack, Dialog Usage Manager and related libraries
Loading...
Searching...
No Matches
GstMediaStackAdapter.hxx
Go to the documentation of this file.
1#if !defined(GstMediaStackAdapter_hxx)
2#define GstMediaStackAdapter_hxx
3
4#include <boost/function.hpp>
5
6#include "BridgeMixer.hxx"
7
8#include <resip/stack/Uri.hxx>
14#include <rutil/Mutex.hxx>
15
16#include "MediaStackAdapter.hxx"
17#include "HandleTypes.hxx"
19
20#include <memory>
21
22#include <glibmm/main.h>
23#include <gstreamermm.h>
24
25namespace resip
26{
27class DialogUsageManager;
28}
29
30namespace recon
31{
32class Conversation;
33class Participant;
34class UserAgent;
35class ConversationProfile;
36class GstRemoteParticipant;
37class LocalParticipant;
38class MediaResourceParticipant;
39class RemoteParticipant;
40class RemoteParticipantDialogSet;
41class GstRemoteParticipantDialogSet;
42
62{
63public:
64
120 virtual ~GstMediaStackAdapter();
121
123
124 virtual void shutdown() override;
125
127 // Conversation methods //////////////////////////////////////////////
129
158
160 // Participant methods ///////////////////////////////////////////////
162
170 const std::vector<unsigned int>& codecIds, resip::SdpContents& sessionCaps) override;
171
172
174 // Media Related Methods - this may not be the right spot for these - move to LocalParticipant?
176
177 virtual void setGstTOSValue(int tos) { mGstTOSValue = tos; }
178
180 RelatedConversationSet* relatedConversationSet, // Pass NULL to create new RelatedConversationSet
189 std::shared_ptr<ConversationProfile> conversationProfile = nullptr) override;
190
191 virtual bool supportsMultipleMediaInterfaces() override;
193 virtual bool supportsLocalAudio() override { return false; } // FIXME Gstreamer - implement local audio
194
195 virtual void runMainLoop();
196
197protected:
198 virtual void setUserAgent(UserAgent *userAgent) override;
200
201private:
202 void init(int defaultSampleRate = 0, int maxSampleRate = 0);
203
204 virtual void thread() override;
205
206 friend class DefaultDialogSet;
207 friend class Subscription;
208
210
211 // Note: In general the following fns are not thread safe and must be called from dum process
212 // loop only
213 friend class Conversation;
214 friend class GstConversation;
216
217 friend class Participant;
218 friend class GstParticipant;
219
220 friend class RemoteParticipant;
222 friend class UserAgent;
223
224 friend class DtmfEvent;
225 friend class MediaEvent;
226
230 friend class LocalParticipant;
231 friend class BridgeMixer;
232 friend class GstMediaInterface;
233
234 virtual void process() override;
235
236 virtual void initializeDtlsFactory(const resip::Data& defaultAoR) override;
237
238 friend class OutputBridgeMixWeightsCmd;
239 void outputBridgeMatrixImpl(ConversationHandle convHandle = 0) override;
240
249 friend class AddParticipantCmd;
251 friend class MoveParticipantCmd;
258 friend class HoldParticipantCmd;
259
260 // Gst Media related members
261 Glib::RefPtr<Glib::MainLoop> main_loop;
262 int mGstTOSValue; // FIXME Gstreamer - need to pass to Gstreamer, maybe move to superclass too
263};
264
265}
266
267#endif
268
269
270/* ====================================================================
271
272 Copyright (c) 2022, Software Freedom Institute https://softwarefreedom.institute
273 Copyright (c) 2022, Daniel Pocock https://danielpocock.com
274 Copyright (c) 2021-2022, SIP Spectrum, Inc. www.sipspectrum.com
275 Copyright (c) 2007-2008, Plantronics, Inc.
276 All rights reserved.
277
278 Redistribution and use in source and binary forms, with or without
279 modification, are permitted provided that the following conditions are
280 met:
281
282 1. Redistributions of source code must retain the above copyright
283 notice, this list of conditions and the following disclaimer.
284
285 2. Redistributions in binary form must reproduce the above copyright
286 notice, this list of conditions and the following disclaimer in the
287 documentation and/or other materials provided with the distribution.
288
289 3. Neither the name of Plantronics nor the names of its contributors
290 may be used to endorse or promote products derived from this
291 software without specific prior written permission.
292
293 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
294 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
295 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
296 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
297 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
298 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
299 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
300 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
301 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
302 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
303 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
304
305 ==================================================================== */
This class is used to control the sipX Bridge Mixer mix matrix.
This class is one of two main classes of concern to an application using the UserAgent library.
This class is used to manage membership of participants.
The classes defined here are used to pass commands from the application thread to the UserAgent threa...
This class is used by non-Invite DialogSets.
This class represents the data passed in a DTMF event.
Definition DtmfEvent.hxx:18
This class is used to manage membership of participants.
This class is one of two main classes of concern to an application using the UserAgent library.
virtual RemoteParticipant * createRemoteParticipantInstance(resip::DialogUsageManager &dum, RemoteParticipantDialogSet &rpds) override
virtual void conversationManagerReady(ConversationManager *conversationManager) override
virtual ConversationHandle createSharedMediaInterfaceConversation(ConversationHandle sharedMediaInterfaceConvHandle, ConversationManager::AutoHoldMode autoHoldMode=ConversationManager::AutoHoldEnabled)
Only applicable if GstConversationMediaInterfaceMode is used.
virtual RemoteParticipantDialogSet * createRemoteParticipantDialogSetInstance(ConversationManager::ParticipantForkSelectMode forkSelectMode=ConversationManager::ForkSelectAutomatic, std::shared_ptr< ConversationProfile > conversationProfile=nullptr) override
virtual bool supportsMultipleMediaInterfaces() override
virtual MediaResourceParticipant * createMediaResourceParticipantInstance(ParticipantHandle partHandle, const resip::Uri &mediaUrl, const std::shared_ptr< resip::Data > &audioBuffer, void *recordingCircularBuffer) override
virtual bool canConversationsShareParticipants(Conversation *conversation1, Conversation *conversation2) override
virtual void configureRemoteParticipantInstance(GstRemoteParticipant *krp)
virtual void setUserAgent(UserAgent *userAgent) override
virtual void buildSessionCapabilities(const resip::Data &ipaddress, const std::vector< unsigned int > &codecIds, resip::SdpContents &sessionCaps) override
Builds a session capabilties SDPContents based on the passed in ipaddress and codec ordering.
virtual Conversation * createConversationInstance(ConversationHandle handle, RelatedConversationSet *relatedConversationSet, ConversationHandle sharedMediaInterfaceConvHandle, ConversationManager::AutoHoldMode autoHoldMode) override
virtual void shutdown() override
virtual bool supportsLocalAudio() override
virtual LocalParticipant * createLocalParticipantInstance(ParticipantHandle partHandle) override
This is the base class for a GstRemoteParticipant, GstLocalParticipant and a GstMediaResourceParticip...
This class is used by Invite DialogSets.
This class represent a remote participant.
This class represents a local participant.
This class represents an event that happens to a media participant.
This class represents a media resource participant.
This class is one of two main classes of concern to an application.
This is the base class for a RemoteParticipant, LocalParticipant and a MediaResourceParticipant.
This is used to keep a mapping between all related conversations.
This class is used by Invite DialogSets.
This class represent a remote participant.
The classes defined here are used to pass commands from the application thread to the UserAgent threa...
This class is one of two main classes of concern to an application using the UserAgent library.
Definition UserAgent.hxx:56
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Definition Data.hxx:90
Provides an interface to process and generate SDP bodies (MIME content-type application/sdp).
A wrapper class to create and spawn a thread.
Definition ThreadIf.hxx:54
Represents the "SIP-URI" and "SIPS-URI" elements in the RFC 3261 grammar.
Definition Uri.hxx:22
unsigned int ConversationHandle
unsigned int ParticipantHandle
dcm! – add UnusedChecking(_enum) below;
void list()
Definition userAdmin.cxx:66