# opalzrtp.h

Go to the documentation of this file.

    00001 #ifndef OPAL_ZRTP_OPALZRTP_H
    00002 #define OPAL_ZRTP_OPALZRTP_H
    00003
    00004 #ifdef P_USE_PRAGMA
    00005 #pragma interface
    00006 #endif
    00007
    00008 #ifdef OPAL_ZRTP
    00009
    00010 #include <zrtp.h>
    00011 #include <opal/buildopts.h>
    00012 #include <zrtp/zrtpeventproc.h>
    00013
    00014 namespace PWLibStupidLinkerHacks {
    00015   extern int libZRTPLoader;
    00016 };
    00017
    00018 class OpalZrtp {
    00019   public:
    00020         static bool Init(char *name, char *zidFile);
    00021         static bool Init(OpalZrtp *opalZrtp);
    00022         static bool DeInit();
    00023
    00024         static zrtp_global_ctx *GetZrtpContext();
    00025         static unsigned char *GetZID();
    00026         static void SetEventProcessor(ZrtpEventProcessor *eventProcessor);
    00027         static ZrtpEventProcessor * GetEventProcessor();
    00028
    00029         virtual ~OpalZrtp();
    00030
    00031   protected:
    00032         virtual unsigned char *DoGetZID();
    00033         virtual zrtp_global_ctx *DoGetZrtpContext();
    00034         virtual bool DoInit(char *name, char *zidFile);
    00035
    00036   private:
    00037         static OpalZrtp *instance;
    00038         static int              isDefault;
    00039         static ZrtpEventProcessor *eventProcessor;
    00040 };
    00041
    00042
    00043 class OpalZRTPStreamInfo {
    00044   public:
    00045     virtual bool Open() = 0;
    00046     virtual OpalMediaSession * CreateSession(
    00047       OpalConnection & connection,
    00048       unsigned sessionId,
    00049       const OpalMediaType & mediaType
    00050     ) = 0;
    00051 };
    00052
    00053 class OpalZRTPConnectionInfo {
    00054   public:
    00055     virtual bool Open() = 0;
    00056     virtual OpalMediaSession * CreateSession(
    00057       OpalConnection & connection,
    00058       unsigned sessionId,
    00059       const OpalMediaType & mediaType
    00060     ) = 0;
    00061
    00062     PMutex mutex;
    00063 };
    00064
    00065 #endif // OPAL_ZRTP
    00066
    00067 #endif // OPAL_ZRTP_OPALZRTP_H