37 #ifndef RTPSECURESESSION_H
39 #define RTPSECURESESSION_H
41 #include "rtpconfig.h"
43 #if defined(RTP_SUPPORT_SRTP) || defined(RTP_SUPPORT_SRTP2)
47 #ifdef RTP_SUPPORT_THREAD
48 #include <jthread/jthread.h>
51 #ifdef RTP_SUPPORT_SRTP2
53 typedef struct srtp_ctx_t_ srtp_ctx_t;
109 void SetLastLibSRTPError(
int err);
114 virtual void OnErrorChangeIncomingData(
int errcode,
int libsrtperrorcode);
116 int OnChangeRTPOrRTCPData(
const void *origdata,
size_t origlen,
bool isrtp,
void **senddata,
size_t *sendlen);
118 void OnSentRTPOrRTCPData(
void *senddata,
size_t sendlen,
bool isrtp);
120 int encryptData(uint8_t *pData,
int &dataLength,
bool rtp);
121 int decryptRawPacket(
RTPRawPacket *rawpack,
int *srtpError);
123 srtp_ctx_t *m_pSRTPContext;
125 #ifdef RTP_SUPPORT_THREAD
126 jthread::JMutex m_srtpLock;
A memory manager.
Definition: rtpmemorymanager.h:151
Interface for generating random numbers.
Definition: rtprandom.h:52
This class is used by the transmission component to store the incoming RTP and RTCP data in.
Definition: rtprawpacket.h:53
RTPSession derived class that serves as a base class for an SRTP implementation.
Definition: rtpsecuresession.h:83
int InitializeSRTPContext()
Initializes the SRTP context, in case of an error it may be useful to inspect RTPSecureSession::GetLa...
RTPSecureSession(RTPRandom *rnd=0, RTPMemoryManager *mgr=0)
Constructs an RTPSecureSession instance, see RTPSession::RTPSession for more information about the pa...
srtp_ctx_t * LockSRTPContext()
This function locks a mutex and returns the libsrtp context that was created in RTPSecureSession::Ini...
int GetLastLibSRTPError()
Returns (and clears) the last error that was encountered when using a libsrtp based function.
virtual void OnErrorChangeIncomingData(int errcode, int libsrtperrorcode)
In case the reimplementation of OnChangeIncomingData (which may take place in a background thread) en...
Definition: rtpsecuresession.h:130
int UnlockSRTPContext()
Releases the lock on the SRTP context that was obtained in RTPSecureSession::LockSRTPContext.
High level class for using RTP.
Definition: rtpsession.h:81