OPAL  Version 3.18.8
opalzrtp.h
Go to the documentation of this file.
1 #ifndef OPAL_ZRTP_OPALZRTP_H
2 #define OPAL_ZRTP_OPALZRTP_H
3 
4 #ifdef P_USE_PRAGMA
5 #pragma interface
6 #endif
7 
8 #ifdef OPAL_ZRTP
9 
10 #include <zrtp.h>
11 #include <opal_config.h>
12 #include <zrtp/zrtpeventproc.h>
13 
14 namespace PWLibStupidLinkerHacks {
15  extern int libZRTPLoader;
16 };
17 
18 class OpalZrtp {
19  public:
20  static bool Init(char *name, char *zidFile);
21  static bool Init(OpalZrtp *opalZrtp);
22  static bool DeInit();
23 
24  static zrtp_global_ctx *GetZrtpContext();
25  static unsigned char *GetZID();
26  static void SetEventProcessor(ZrtpEventProcessor *eventProcessor);
27  static ZrtpEventProcessor * GetEventProcessor();
28 
29  virtual ~OpalZrtp();
30 
31  protected:
32  virtual unsigned char *DoGetZID();
33  virtual zrtp_global_ctx *DoGetZrtpContext();
34  virtual bool DoInit(char *name, char *zidFile);
35 
36  private:
37  static OpalZrtp *instance;
38  static int isDefault;
39  static ZrtpEventProcessor *eventProcessor;
40 };
41 
42 
43 class OpalZRTPStreamInfo {
44  public:
45  virtual bool Open() = 0;
46  virtual OpalMediaSession * CreateSession(
47  OpalConnection & connection,
48  unsigned sessionId,
49  const OpalMediaType & mediaType
50  ) = 0;
51 };
52 
53 class OpalZRTPConnectionInfo {
54  public:
55  virtual bool Open() = 0;
56  virtual OpalMediaSession * CreateSession(
57  OpalConnection & connection,
58  unsigned sessionId,
59  const OpalMediaType & mediaType
60  ) = 0;
61 
62  PMutex mutex;
63 };
64 
65 #endif // OPAL_ZRTP
66 
67 #endif // OPAL_ZRTP_OPALZRTP_H
Definition: mediasession.h:647
Definition: mediatype.h:66
Definition: connection.h:415
Definition: zrtpeventproc.h:8