Commit 0a878baa authored by Sylvain Berfini's avatar Sylvain Berfini 🎩

Fix compilation issue

parent c51e20cc
......@@ -20,12 +20,21 @@
#ifndef ortp_srtp_h
#define ortp_srtp_h
#ifdef HAVE_SRTP
#ifndef ANDROID
#include <srtp/srtp.h>
#else
// Android doesn't use make install
#include <srtp.h>
#endif
#else
typedef void* srtp_t;
typedef int err_status_t;
typedef int srtp_policy_t;
#endif
#include <ortp/rtpsession.h>
/*srtp defines all this stuff*/
......@@ -50,7 +59,7 @@ err_status_t ortp_srtp_init(void);
err_status_t ortp_srtp_create(srtp_t *session, const srtp_policy_t *policy);
err_status_t ortp_srtp_dealloc(srtp_t session);
err_status_t ortp_srtp_add_stream(srtp_t session, const srtp_policy_t *policy);
void ortp_crypto_get_random(uint8_t *tmp, int size);
bool_t ortp_srtp_supported(void);
int srtp_transport_new(srtp_t srtp, RtpTransport **rtpt, RtpTransport **rtcpt );
......
......@@ -24,6 +24,8 @@
#endif
#include "ortp/ortp.h"
#include "ortp/ortp_srtp.h"
#ifdef HAVE_SRTP
#undef PACKAGE_NAME
......@@ -31,7 +33,7 @@
#undef PACKAGE_TARNAME
#undef PACKAGE_VERSION
#include "ortp/ortp_srtp.h"
#include "ortp/b64.h"
#define SRTP_PAD_BYTES 64 /*?? */
......@@ -233,6 +235,11 @@ static bool_t ortp_init_srtp_policy(srtp_t srtp, srtp_policy_t* policy, enum ort
return TRUE;
}
void ortp_crypto_get_random(uint8_t *tmp, int size)
{
crypto_get_random(tmp, size);
}
srtp_t ortp_srtp_create_configure_session(enum ortp_srtp_crypto_suite_t suite, uint32_t ssrc, const char* snd_key, const char* rcv_key)
{
err_status_t err;
......@@ -278,6 +285,15 @@ srtp_t ortp_srtp_create_configure_session(enum ortp_srtp_crypto_suite_t suite, u
#else
err_status_t ortp_srtp_init(void) {
return 0;
}
void ortp_crypto_get_random(uint8_t *tmp, int size)
{
}
int srtp_transport_new(void *i, RtpTransport **rtpt, RtpTransport **rtcpt ){
ortp_error("srtp_transport_new: oRTP has not been compiled with SRTP support.");
return -1;
......@@ -287,22 +303,22 @@ bool_t ortp_srtp_supported(void){
return FALSE;
}
int ortp_srtp_create(void *i, const void *policy)
err_status_t ortp_srtp_create(srtp_t *i, const srtp_policy_t *policy)
{
return -1;
}
int ortp_srtp_dealloc(void *session)
err_status_t ortp_srtp_dealloc(srtp_t session)
{
return -1;
}
int ortp_srtp_add_stream(void *session, const void *policy)
err_status_t ortp_srtp_add_stream(srtp_t session, const srtp_policy_t *policy)
{
return -1;
}
srtp_t ortp_srtp_create_configure_session(enum ortp_srtp_crypto_suite_t suite, const char* snd_key, unsigned snd_key_length, uint32_t ssrc, const char* rcv_key, unsigned rcv_key_length)
srtp_t ortp_srtp_create_configure_session(enum ortp_srtp_crypto_suite_t suite, uint32_t ssrc, const char* snd_key, const char* rcv_key)
{
return NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment