OPAL  Version 3.10.10
opalmixer.h
Go to the documentation of this file.
1 /*
2  * opalmixer.h
3  *
4  * OPAL media mixers
5  *
6  * Open Phone Abstraction Library (OPAL)
7  * Formally known as the Open H323 project.
8  *
9  * Copyright (C) 2007 Post Increment
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 Post Increment
24  *
25  * Contributor(s): Craig Southeren (craigs@postincrement.com)
26  * Robert Jongbloed (robertj@voxlucida.com.au)
27  *
28  * $Revision: 27149 $
29  * $Author: rjongbloed $
30  * $Date: 2012-03-07 18:32:36 -0600 (Wed, 07 Mar 2012) $
31  */
32 
33 
34 #ifndef OPAL_OPAL_OPALMIXER_H
35 #define OPAL_OPAL_OPALMIXER_H
36 
37 #ifndef _PTLIB_H
38 #include <ptlib.h>
39 #endif
40 
41 #include <opal/buildopts.h>
42 
43 #include <queue>
44 
45 #include <opal/localep.h>
46 #include <codec/vidcodec.h>
47 #include <ptclib/threadpool.h>
48 
49 
50 class RTP_DataFrame;
51 class OpalJitterBuffer;
53 
54 
55 //#define OPAL_MIXER_AUDIO_DEBUG 1
56 
57 
58 #define OPAL_OPT_LISTEN_ONLY "Listen-Only"
59 
60 
62 
73 {
74  public:
76  bool pushThread,
77  unsigned periodMS,
78  unsigned periodTS
79  );
80 
81  virtual ~OpalBaseMixer();
82 
83  typedef PString Key_T;
84 
87  virtual bool AddStream(
88  const Key_T & key
89  );
90 
93  virtual void RemoveStream(
94  const Key_T & key
95  );
96 
99  virtual void RemoveAllStreams();
100 
106  virtual bool WriteStream(
107  const Key_T & key,
108  const RTP_DataFrame & input
109  );
110 
120  virtual RTP_DataFrame * ReadMixed();
121  virtual bool ReadMixed(RTP_DataFrame & mixed);
122 
133  virtual bool OnMixed(
134  RTP_DataFrame * & mixed
135  );
136 
140  void StartPushThread();
141 
146  void StopPushThread(bool lock = true);
147 
150  unsigned GetPeriodTS() const { return m_periodTS; }
151 
152  protected:
153  struct Stream {
154  virtual ~Stream() { }
155  virtual void QueuePacket(const RTP_DataFrame & rtp) = 0;
156  queue<RTP_DataFrame> m_queue;
157  };
158  typedef std::map<Key_T, Stream *> StreamMap_T;
159 
160  virtual Stream * CreateStream() = 0;
161  virtual bool MixStreams(RTP_DataFrame & frame) = 0;
162  virtual size_t GetOutputSize() const = 0;
163 
164  virtual bool OnPush();
165  void PushThreadMain();
166 
167  bool m_pushThread; // true if to use a thread to push data out
168  unsigned m_periodMS; // Mixing interval in milliseconds
169  unsigned m_periodTS; // Mixing interval in timestamp units
170 
171  StreamMap_T m_inputStreams; // Map of key to stream for input RTP frame queues
172  unsigned m_outputTimestamp; // RTP timestamp for output data
173  RTP_DataFrame * m_pushFrame; // Cached frame for pushing RTP
174  PThread * m_workerThread; // reader thread handle
175  bool m_threadRunning; // used to stop reader thread
176  PMutex m_mutex; // mutex for list of streams and thread handle
177 };
178 
180 
190 {
191  public:
193  bool stereo = false,
194  unsigned sampleRate = OpalMediaFormat::AudioClockRate,
195  bool pushThread = true,
196  unsigned period = 10
197  );
198 
200 
203  virtual void RemoveStream(
204  const Key_T & key
205  );
206 
209  virtual void RemoveAllStreams();
210 
213  bool IsStereo() const { return m_stereo; }
214 
217  unsigned GetSampleRate() const { return m_sampleRate; }
218 
225  bool SetSampleRate(
226  unsigned rate
227  );
228 
235  bool SetJitterBufferSize(
236  const Key_T & key,
237  unsigned minJitterDelay,
238  unsigned maxJitterDelay
239  );
240 
241  protected:
242  struct AudioStream : public Stream
243  {
244  AudioStream(OpalAudioMixer & mixer);
245  ~AudioStream();
246 
247  virtual void QueuePacket(const RTP_DataFrame & rtp);
248  const short * GetAudioDataPtr();
249 
252  unsigned m_nextTimestamp;
253  PShortArray m_cacheSamples;
255  };
256 
257  virtual Stream * CreateStream();
258  virtual bool MixStreams(RTP_DataFrame & frame);
259  virtual size_t GetOutputSize() const;
260 
261  void PreMixStreams();
262  void MixStereo(RTP_DataFrame & frame);
263  void MixAdditive(RTP_DataFrame & frame, const short * audioToSubtract);
264 
265  protected:
266  bool m_stereo;
267  unsigned m_sampleRate;
268 
271  std::vector<int> m_mixedAudio;
272 };
273 
274 
276 
277 #if OPAL_VIDEO
278 
286 {
287  public:
288  enum Styles {
289  eSideBySideLetterbox,
293  eSideBySideScaled,
297  eStackedPillarbox,
301  eStackedScaled,
305  eGrid,
307  };
308 
310  Styles style,
311  unsigned width,
312  unsigned height,
313  unsigned rate = 15,
314  bool pushThread = true
315  );
316 
318 
321  unsigned GetFrameWidth() const { return m_width; }
322 
325  unsigned GetFrameHeight() const { return m_height; }
326 
329  unsigned GetFrameRate() const { return 1000/m_periodMS; }
330 
334  bool SetFrameRate(
335  unsigned rate // New frames per second.
336  );
337 
341  bool SetFrameSize(
342  unsigned width,
343  unsigned height
344  );
345 
346  protected:
347  struct VideoStream : public Stream
348  {
349  VideoStream(OpalVideoMixer & mixer);
350  virtual void QueuePacket(const RTP_DataFrame & rtp);
351  void InsertVideoFrame(unsigned x, unsigned y, unsigned w, unsigned h);
352 
354  };
355 
356  friend struct VideoStream;
357 
358  virtual Stream * CreateStream();
359  virtual bool MixStreams(RTP_DataFrame & frame);
360  virtual size_t GetOutputSize() const;
361 
362  protected:
364  unsigned m_width, m_height;
365  BYTE m_bgFillRed,m_bgFillGreen,m_bgFillBlue;
366 
367  PBYTEArray m_frameStore;
369 };
370 
371 #endif // OPAL_VIDEO
372 
373 
375 
376 
382 {
383  OpalMixerNodeInfo(const char * name = NULL)
384  : m_name(name)
385  , m_listenOnly(false)
386  , m_sampleRate(OpalMediaFormat::AudioClockRate)
387 #if OPAL_VIDEO
388  , m_audioOnly(false)
389  , m_style(OpalVideoMixer::eGrid)
390  , m_width(PVideoFrameInfo::CIFWidth)
391  , m_height(PVideoFrameInfo::CIFHeight)
392  , m_rate(15)
393 #endif
394  , m_mediaPassThru(false)
395  { }
396 
397  virtual ~OpalMixerNodeInfo() { }
398 
399  virtual OpalMixerNodeInfo * Clone() const { return new OpalMixerNodeInfo(*this); }
400 
401  PString m_name;
403  unsigned m_sampleRate;
404 #if OPAL_VIDEO
405  bool m_audioOnly;
407  unsigned m_width;
408  unsigned m_height;
409  unsigned m_rate;
410 #endif
413 };
414 
415 
417 
418 class OpalMixerNode;
419 
420 
425 class OpalMixerNodeManager : public PObject
426 {
427  PCLASSINFO(OpalMixerNodeManager, PObject);
428  public:
434 
438  virtual ~OpalMixerNodeManager();
439 
442  virtual void ShutDown();
443 
449  virtual PBoolean GarbageCollection();
451 
460  virtual OpalMixerNode * CreateNode(
461  OpalMixerNodeInfo * info
462  );
463 
469  virtual PSafePtr<OpalMixerNode> AddNode(
470  OpalMixerNodeInfo * info
471  );
472 
475  void AddNode(OpalMixerNode * node);
476 
480  PSafePtr<OpalMixerNode> GetFirstNode(
481  PSafetyMode mode = PSafeReference
482  ) const { return PSafePtr<OpalMixerNode>(m_nodesByUID, mode); }
483 
487  virtual PSafePtr<OpalMixerNode> FindNode(
488  const PString & name,
489  PSafetyMode mode = PSafeReference
490  );
491 
496  virtual void RemoveNode(
497  OpalMixerNode & node
498  );
499 
502  void AddNodeName(
503  PString name,
504  OpalMixerNode * node
505  );
506 
509  void RemoveNodeName(
510  PString name
511  );
512 
516  void RemoveNodeNames(
517  PStringList names
518  );
519 
522  void QueueUserInput(
523  const PSafePtr<OpalMixerNode> & node,
524  const OpalMixerConnection * connection,
525  const PString & value
526  );
528 
529  protected:
530  PSafeDictionary<PGloballyUniqueID, OpalMixerNode> m_nodesByUID;
531  PDictionary<PString, OpalMixerNode> m_nodesByName;
532 
533  struct UserInput {
535  const PSafePtr<OpalMixerNode> & node,
536  const OpalMixerConnection * connection,
537  const PString & value
538  ) : m_node(node)
539  , m_connection(connection)
540  , m_value(value)
541  { }
542 
543  PSafePtr<OpalMixerNode> m_node;
545  PString m_value;
546 
547  void Work();
548  };
549  PQueuedThreadPool<UserInput> m_userInputPool;
550 };
551 
552 
554 
560 {
562  public:
568  OpalManager & manager,
569  const char * prefix
570  );
571 
575 
580  virtual void ShutDown();
582 
595  virtual OpalMediaFormatList GetMediaFormats() const;
596 
626  virtual PSafePtr<OpalConnection> MakeConnection(
627  OpalCall & call,
628  const PString & party,
629  void * userData = NULL,
630  unsigned options = 0,
631  OpalConnection::StringOptions * stringOptions = NULL
632  );
633 
638  virtual PBoolean GarbageCollection();
640 
649  PSafePtr<OpalMixerConnection> GetMixerConnectionWithLock(
650  const PString & token,
651  PSafetyMode mode = PSafeReadWrite
652  ) { return GetConnectionWithLockAs<OpalMixerConnection>(token, mode); }
653 
657  virtual OpalMixerConnection * CreateConnection(
658  PSafePtr<OpalMixerNode> node,
659  OpalCall & call,
660  void * userData,
661  unsigned options,
662  OpalConnection::StringOptions * stringOptions
663  );
665 
673  PSafePtr<OpalMixerNode> AddNode(
674  OpalMixerNodeInfo * info
675  );
676 
683  virtual OpalMixerNode * CreateNode(
684  OpalMixerNodeInfo * info
685  );
686 
690  PSafePtr<OpalMixerNode> GetFirstNode(
691  PSafetyMode mode = PSafeReference
692  ) const { return m_nodeManager.GetFirstNode(mode); }
693 
697  PSafePtr<OpalMixerNode> FindNode(
698  const PString & name,
699  PSafetyMode mode = PSafeReference
700  ) { return m_nodeManager.FindNode(name, mode); }
701 
707  OpalMixerNode & node
708  ) { m_nodeManager.RemoveNode(node); }
710 
725  void SetAdHocNodeInfo(
726  const OpalMixerNodeInfo & info
727  );
728  void SetAdHocNodeInfo(
729  OpalMixerNodeInfo * info
730  );
731 
743  OpalMixerNodeInfo * GetAdHocNodeInfo() { return m_adHocNodeInfo; }
744 
747  const OpalMixerNodeManager & GetNodeManager() const { return m_nodeManager; }
748  OpalMixerNodeManager & GetNodeManager() { return m_nodeManager; }
750 
751  protected:
754 };
755 
756 
758 
762 {
764  public:
770  PSafePtr<OpalMixerNode> node,
771  OpalCall & call,
772  OpalMixerEndPoint & endpoint,
773  void * userData,
774  unsigned options = 0,
775  OpalConnection::StringOptions * stringOptions = NULL
776  );
777 
782 
802  virtual void OnReleased();
803 
810  virtual OpalMediaFormatList GetMediaFormats() const;
811 
826  virtual OpalMediaStream * CreateMediaStream(
827  const OpalMediaFormat & mediaFormat,
828  unsigned sessionID,
829  PBoolean isSource
830  );
831 
834  virtual void OnStartMediaPatch(
835  OpalMediaPatch & patch
836  );
837 
839  virtual void OnApplyStringOptions();
840 
847  virtual PBoolean SendUserInputString(
848  const PString & value
849  );
850 
867  virtual PBoolean SendUserInputTone(
868  char tone,
869  unsigned duration = 0
870  );
872 
877  void SetListenOnly(
878  bool listenOnly
879  );
880 
883  bool GetListenOnly() const { return m_listenOnly; }
884 
887  PSafePtr<OpalMixerNode> GetNode() const { return m_node; }
889 
890  protected:
892  PSafePtr<OpalMixerNode> m_node;
894 };
895 
896 
901 {
903  public:
909  OpalConnection & conn,
910  const OpalMediaFormat & mediaFormat,
911  unsigned sessionID,
912  bool isSource,
913  PSafePtr<OpalMixerNode> node,
914  bool listenOnly
915  );
916 
921 
926  virtual PBoolean Open();
927 
933  virtual PBoolean WritePacket(
934  RTP_DataFrame & packet
935  );
936 
940  virtual PBoolean IsSynchronous() const;
941 
952  virtual PBoolean RequiresPatchThread() const;
953 
961  virtual bool EnableJitterBuffer(bool enab = true) const;
963 
968  PSafePtr<OpalMixerNode> GetNode() { return m_node; }
970 
971  protected:
972  virtual void InternalClose();
973 
974  PSafePtr<OpalMixerNode> m_node;
976 #if OPAL_VIDEO
977  bool m_video;
978 #endif
979 };
980 
981 
985 class OpalMixerNode : public PSafeObject
986 {
987  PCLASSINFO(OpalMixerNode, PSafeObject);
988  public:
994  OpalMixerNodeManager & manager,
995  OpalMixerNodeInfo * info
996  );
998  OpalMixerEndPoint & endpoint,
999  OpalMixerNodeInfo * info
1000  );
1001 
1004  ~OpalMixerNode();
1005 
1010  void ShutDown();
1012 
1019  void PrintOn(
1020  ostream & strm
1021  ) const;
1023 
1028  void AttachConnection(
1029  OpalConnection * connection
1030  );
1031 
1034  void DetachConnection(
1035  OpalConnection * connection
1036  );
1037 
1040  bool AttachStream(
1041  OpalMixerMediaStream * stream
1042  );
1043 
1046  void DetachStream(
1047  OpalMixerMediaStream * stream
1048  );
1049 
1052  void UseMediaPassThrough(
1053  unsigned sessionID,
1054  OpalConnection * connection = NULL
1055  );
1056 
1064  const OpalBaseMixer::Key_T & key,
1065  unsigned minJitterDelay,
1066  unsigned maxJitterDelay
1067  ) { return m_audioMixer.SetJitterBufferSize(key, minJitterDelay, maxJitterDelay); }
1068 
1072  const OpalBaseMixer::Key_T & key,
1073  const RTP_DataFrame & input
1074  ) { return m_audioMixer.WriteStream(key, input); }
1075 
1076 #if OPAL_VIDEO
1077 
1080  const OpalBaseMixer::Key_T & key,
1081  const RTP_DataFrame & input
1082  ) { return m_videoMixer.WriteStream(key, input); }
1083 #endif // OPAL_VIDEO
1084 
1087  virtual void BroadcastUserInput(
1088  const OpalConnection * connection,
1089  const PString & value
1090  );
1092 
1097  const PGloballyUniqueID & GetGUID() const { return m_guid; }
1098 
1101  const PStringList & GetNames() const { return m_names; }
1102 
1105  void AddName(
1106  const PString & name
1107  );
1108 
1111  void RemoveName(
1112  const PString & name
1113  );
1114 
1120  PINDEX GetConnectionCount() const { return m_connections.GetSize(); }
1121 
1124  template <class Subclass>
1125  PSafePtr<Subclass> GetFirstConnectionAs(
1126  PSafetyMode mode = PSafeReference
1127  ) const { return PSafePtr<Subclass>(m_connections, mode); }
1128 
1131  PSafePtr<OpalConnection> GetFirstConnection(
1132  PSafetyMode mode = PSafeReference
1133  ) const { return GetFirstConnectionAs<OpalConnection>(mode); }
1134 
1137  const OpalMixerNodeInfo & GetNodeInfo() { return *m_info; }
1138 
1141  const PTime & GetCreationTime() const { return m_creationTime; }
1143 
1144  protected:
1145  void Construct();
1146 
1148  PGloballyUniqueID m_guid;
1149  PStringList m_names;
1152 
1153  PSafeList<OpalConnection> m_connections;
1154 
1155  struct MediaMixer
1156  {
1157  MediaMixer();
1158 
1159  PSafeList<OpalMixerMediaStream> m_outputStreams;
1160  };
1161 
1162  struct AudioMixer : public OpalAudioMixer, public MediaMixer
1163  {
1164  AudioMixer(const OpalMixerNodeInfo & info);
1165  ~AudioMixer();
1166 
1167  virtual bool OnPush();
1168 
1169  struct CachedAudio {
1170  CachedAudio();
1171  ~CachedAudio();
1172  enum { Collecting, Collected, Completed } m_state;
1176  };
1177  std::map<PString, CachedAudio> m_cache;
1178 
1179  void PushOne(
1180  PSafePtr<OpalMixerMediaStream> & stream,
1181  CachedAudio & cache,
1182  const short * audioToSubtract
1183  );
1184 #ifdef OPAL_MIXER_AUDIO_DEBUG
1185  class PAudioMixerDebug * m_audioDebug;
1186 #endif
1187  };
1189 
1190 #if OPAL_VIDEO
1191  struct VideoMixer : public OpalVideoMixer, public MediaMixer
1192  {
1193  VideoMixer(const OpalMixerNodeInfo & info);
1194  ~VideoMixer();
1195 
1196  virtual bool OnMixed(RTP_DataFrame * & output);
1197 
1198  PDictionary<PString, OpalTranscoder> m_transcoders;
1199  };
1201 #endif // OPAL_VIDEO
1202 };
1203 
1204 
1205 #endif // OPAL_OPAL_OPAL_MIXER
1206 
1207 
virtual OpalMixerNodeInfo * Clone() const
Definition: opalmixer.h:399
bool m_mediaPassThru
Definition: opalmixer.h:411
PSafePtr< OpalConnection > GetFirstConnection(PSafetyMode mode=PSafeReference) const
Definition: opalmixer.h:1131
Definition: manager.h:74
Styles
Definition: opalmixer.h:288
std::map< Key_T, Stream * > StreamMap_T
Definition: opalmixer.h:158
PSafeList< OpalMixerMediaStream > m_outputStreams
Definition: opalmixer.h:1159
AudioStream * m_right
Definition: opalmixer.h:270
PSafePtr< OpalMixerNode > GetFirstNode(PSafetyMode mode=PSafeReference) const
Definition: opalmixer.h:690
bool m_audioOnly
No video is to be allowed.
Definition: opalmixer.h:405
Definition: opalmixer.h:1155
PTime m_creationTime
Definition: opalmixer.h:1151
Definition: opalmixer.h:153
Definition: opalmixer.h:1162
PDictionary< PString, OpalMixerNode > m_nodesByName
Definition: opalmixer.h:531
Definition: localep.h:360
PSafePtr< OpalMixerNode > GetNode() const
Definition: opalmixer.h:887
virtual Stream * CreateStream()=0
bool m_pushThread
Definition: opalmixer.h:167
OpalAudioMixer & m_mixer
Definition: opalmixer.h:250
PBYTEArray m_frameStore
Definition: opalmixer.h:367
bool SetJitterBufferSize(const OpalBaseMixer::Key_T &key, unsigned minJitterDelay, unsigned maxJitterDelay)
Definition: opalmixer.h:1063
bool WriteAudio(const OpalBaseMixer::Key_T &key, const RTP_DataFrame &input)
Definition: opalmixer.h:1071
bool m_listenOnly
Mixer only transmits data to "listeners".
Definition: opalmixer.h:402
PQueuedThreadPool< UserInput > m_userInputPool
Definition: opalmixer.h:549
unsigned m_width
Width of mixed video.
Definition: opalmixer.h:407
OpalJitterBuffer * m_jitter
Definition: opalmixer.h:251
PSafeDictionary< PGloballyUniqueID, OpalMixerNode > m_nodesByUID
Definition: opalmixer.h:530
void StopPushThread(bool lock=true)
Definition: opalmixer.h:347
AudioStream * m_left
Definition: opalmixer.h:269
unsigned m_height
Height of mixed video.
Definition: opalmixer.h:408
unsigned GetFrameRate() const
Definition: opalmixer.h:329
bool m_stereo
Definition: opalmixer.h:266
PMutex m_mutex
Definition: opalmixer.h:176
Styles m_style
Definition: opalmixer.h:363
Definition: opalmixer.h:900
PThread * m_workerThread
Definition: opalmixer.h:174
~OpalAudioMixer()
Definition: opalmixer.h:199
OpalMixerNodeInfo * m_adHocNodeInfo
Definition: opalmixer.h:752
OpalVideoMixer & m_mixer
Definition: opalmixer.h:353
virtual ~OpalBaseMixer()
OpalMixerNodeManager & GetNodeManager()
Definition: opalmixer.h:748
bool m_listenOnly
Definition: opalmixer.h:975
Definition: opalmixer.h:425
Definition: opalmixer.h:1169
UserInput(const PSafePtr< OpalMixerNode > &node, const OpalMixerConnection *connection, const PString &value)
Definition: opalmixer.h:534
void RemoveNode(OpalMixerNode &node)
Definition: opalmixer.h:706
const PGloballyUniqueID & GetGUID() const
Definition: opalmixer.h:1097
Definition: opalmixer.h:533
Definition: opalmixer.h:381
size_t m_samplesUsed
Definition: opalmixer.h:254
queue< RTP_DataFrame > m_queue
Definition: opalmixer.h:156
OpalBaseMixer(bool pushThread, unsigned periodMS, unsigned periodTS)
PSafePtr< OpalMixerConnection > GetMixerConnectionWithLock(const PString &token, PSafetyMode mode=PSafeReadWrite)
Definition: opalmixer.h:649
Definition: mediafmt.h:72
PSafePtr< OpalMixerNode > m_node
Definition: opalmixer.h:974
virtual void RemoveAllStreams()
Definition: connection.h:462
unsigned GetSampleRate() const
Definition: opalmixer.h:217
const PStringList & GetNames() const
Definition: opalmixer.h:1101
Definition: rtp.h:71
Definition: localep.h:50
Definition: opalmixer.h:285
Definition: jitter.h:55
Definition: patch.h:60
size_t m_lastStreamCount
Definition: opalmixer.h:368
virtual void RemoveStream(const Key_T &key)
Definition: mediafmt.h:724
PShortArray m_cacheSamples
Definition: opalmixer.h:253
unsigned m_sampleRate
Definition: opalmixer.h:267
Definition: opalmixer.h:1191
Definition: call.h:65
std::map< PString, CachedAudio > m_cache
Definition: opalmixer.h:1177
unsigned m_periodMS
Definition: opalmixer.h:168
RTP_DataFrame m_raw
Definition: opalmixer.h:1173
PSafePtr< OpalMixerNode > GetFirstNode(PSafetyMode mode=PSafeReference) const
Definition: opalmixer.h:480
Definition: opalmixer.h:559
Definition: opalmixer.h:189
PINDEX GetConnectionCount() const
Definition: opalmixer.h:1120
std::vector< int > m_mixedAudio
Definition: opalmixer.h:271
Definition: transcoders.h:137
virtual void QueuePacket(const RTP_DataFrame &rtp)=0
RTP_DataFrame * m_pushFrame
Definition: opalmixer.h:173
OpalMixerNodeInfo * m_info
Definition: opalmixer.h:1150
Definition: opalmixer.h:761
PSafePtr< OpalMixerNode > m_node
Definition: opalmixer.h:543
PString m_name
Name for mixer node.
Definition: opalmixer.h:401
OpalTranscoder * m_transcoder
Definition: opalmixer.h:1175
const OpalMixerNodeInfo & GetNodeInfo()
Definition: opalmixer.h:1137
Definition: opalmixer.h:985
PSafePtr< OpalMixerNode > FindNode(const PString &name, PSafetyMode mode=PSafeReference)
Definition: opalmixer.h:697
unsigned m_nextTimestamp
Definition: opalmixer.h:252
bool m_listenOnly
Definition: opalmixer.h:893
virtual bool OnMixed(RTP_DataFrame *&mixed)
PGloballyUniqueID m_guid
Definition: opalmixer.h:1148
const PTime & GetCreationTime() const
Definition: opalmixer.h:1141
unsigned m_width
Definition: opalmixer.h:364
PSafePtr< OpalMixerNode > GetNode()
Definition: opalmixer.h:968
virtual ~OpalMixerNodeInfo()
Definition: opalmixer.h:397
void StartPushThread()
BYTE m_bgFillRed
Definition: opalmixer.h:365
PDictionary< PString, OpalTranscoder > m_transcoders
Definition: opalmixer.h:1198
~OpalVideoMixer()
Definition: opalmixer.h:317
OpalMixerNodeInfo * GetAdHocNodeInfo()
Definition: opalmixer.h:743
void PushThreadMain()
8kHz sample rate
Definition: mediafmt.h:955
unsigned m_rate
Frame rate of mixed video.
Definition: opalmixer.h:409
const OpalMixerNodeManager & GetNodeManager() const
Definition: opalmixer.h:747
Definition: mediastrm.h:111
Definition: opalmixer.h:242
bool GetListenOnly() const
Definition: opalmixer.h:883
Definition: opalmixer.h:72
bool m_threadRunning
Definition: opalmixer.h:175
unsigned GetFrameWidth() const
Definition: opalmixer.h:321
Definition: connection.h:353
RTP_DataFrame m_encoded
Definition: opalmixer.h:1174
PSafeList< OpalConnection > m_connections
Definition: opalmixer.h:1153
bool IsStereo() const
Definition: opalmixer.h:213
OpalMixerNodeManager m_nodeManager
Definition: opalmixer.h:753
PSafePtr< OpalMixerNode > m_node
Definition: opalmixer.h:892
OpalMixerNodeManager & m_manager
Definition: opalmixer.h:1147
virtual ~Stream()
Definition: opalmixer.h:154
OpalVideoMixer::Styles m_style
Method for mixing video.
Definition: opalmixer.h:406
bool WriteVideo(const OpalBaseMixer::Key_T &key, const RTP_DataFrame &input)
Definition: opalmixer.h:1079
virtual bool WriteStream(const Key_T &key, const RTP_DataFrame &input)
const OpalMixerConnection * m_connection
Definition: opalmixer.h:544
AudioMixer m_audioMixer
Definition: opalmixer.h:1188
PString m_value
Definition: opalmixer.h:545
unsigned m_sampleRate
Audio sample rate, usually 8000.
Definition: opalmixer.h:403
virtual bool MixStreams(RTP_DataFrame &frame)=0
OpalMixerNodeInfo(const char *name=NULL)
Definition: opalmixer.h:383
virtual bool OnPush()
unsigned m_outputTimestamp
Definition: opalmixer.h:172
unsigned GetPeriodTS() const
Definition: opalmixer.h:150
virtual RTP_DataFrame * ReadMixed()
VideoMixer m_videoMixer
Definition: opalmixer.h:1200
virtual size_t GetOutputSize() const =0
StreamMap_T m_inputStreams
Definition: opalmixer.h:171
OpalMixerEndPoint & m_endpoint
Definition: opalmixer.h:891
bool m_video
Definition: opalmixer.h:977
PSafePtr< Subclass > GetFirstConnectionAs(PSafetyMode mode=PSafeReference) const
Definition: opalmixer.h:1125
unsigned GetFrameHeight() const
Definition: opalmixer.h:325
PString Key_T
Definition: opalmixer.h:83
unsigned m_periodTS
Definition: opalmixer.h:169
virtual bool AddStream(const Key_T &key)
PStringList m_names
Definition: opalmixer.h:1149