Commit 90912505 authored by Guillaume Beraudo's avatar Guillaume Beraudo

Improve ZRTP support.

parent 037e4703
......@@ -74,6 +74,9 @@ struct _AudioStream
bool_t use_rc;
bool_t is_beginning;
OrtpZrtpContext *ortpZrtpContext;
char *auth_token;
bool_t auth_token_verified;
bool_t encrypted;
};
#ifdef __cplusplus
......@@ -230,6 +233,7 @@ struct _VideoStream
bool_t use_preview_window;
bool_t adapt_bitrate;
OrtpZrtpContext *ortpZrtpContext;
bool_t encrypted;
};
typedef struct _VideoStream VideoStream;
......
......@@ -50,6 +50,10 @@ void audio_stream_free(AudioStream *stream)
if (stream->session!=NULL) {
rtp_session_unregister_event_queue(stream->session,stream->evq);
rtp_session_destroy(stream->session);
if (stream->ortpZrtpContext != NULL) {
ortp_zrtp_context_destroy(stream->ortpZrtpContext);
stream->ortpZrtpContext=NULL;
}
}
if (stream->evq) ortp_ev_queue_destroy(stream->evq);
if (stream->rtpsend!=NULL) ms_filter_destroy(stream->rtpsend);
......@@ -619,11 +623,6 @@ void audio_stream_stop(AudioStream * stream)
rtp_stats_display(rtp_session_get_stats(stream->session),"Audio session's RTP statistics");
if (stream->ortpZrtpContext != NULL) {
ortp_zrtp_context_destroy(stream->ortpZrtpContext);
stream->ortpZrtpContext=NULL;
}
/*dismantle the outgoing graph*/
ms_connection_helper_start(&h);
ms_connection_helper_unlink(&h,stream->soundread,-1,0);
......
......@@ -27,6 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "mediastreamer2/msrtp.h"
#include "mediastreamer2/msvideoout.h"
#include "mediastreamer2/msextdisplay.h"
#include <ortp/zrtp.h>
extern RtpSession * create_duplex_rtpsession( int locport, bool_t ipv6);
......@@ -667,7 +668,8 @@ void video_stream_send_only_stop(VideoStream *vs){
/* enable ZRTP on the video stream using information from the audio stream */
void video_stream_enable_zrtp(VideoStream *vstream, AudioStream *astream, OrtpZrtpParams *param){
if (astream->ortpZrtpContext != NULL) {
vstream->ortpZrtpContext=ortp_zrtp_multistream_new(astream->ortpZrtpContext, vstream->session, param);
ms_warning("ZRTP for video stream is disabled");
// vstream->ortpZrtpContext=ortp_zrtp_multistream_new(astream->ortpZrtpContext, vstream->session, param);
}
}
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