private.h 4.26 KB
Newer Older
Ghislain MARY's avatar
Ghislain MARY committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
/*
mediastreamer2 library - modular sound and video processing and streaming
Copyright (C) 2006-2013 Belledonne Communications, Grenoble

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/


#ifndef PRIVATE_H
#define PRIVATE_H

#include "mediastreamer2/mediastream.h"


Ghislain MARY's avatar
Ghislain MARY committed
27 28 29 30 31 32 33 34 35 36 37 38 39 40
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32) || defined(__WIN32__)
#ifdef MEDIASTREAMER2_INTERNAL_EXPORTS
#define MEDIASTREAMER2_INTERNAL_EXPORT __declspec(dllexport)
#define MEDIASTREAMER2_INTERNAL_VAR_EXPORT __declspec(dllexport)
#else
#define MEDIASTREAMER2_INTERNAL_EXPORT
#define MEDIASTREAMER2_INTERNAL_VAR_EXPORT extern __declspec(dllimport)
#endif
#else
#define MEDIASTREAMER2_INTERNAL_EXPORT extern
#define MEDIASTREAMER2_INTERNAL_VAR_EXPORT extern
#endif


Ghislain MARY's avatar
Ghislain MARY committed
41 42 43
#define MAX_RTP_SIZE	UDP_MAX_SIZE


44 45 46 47 48
#ifdef __cplusplus
extern "C"
{
#endif

Ghislain MARY's avatar
Ghislain MARY committed
49 50
MSTickerPrio __ms_get_default_prio(bool_t is_video);

jehan's avatar
jehan committed
51
MEDIASTREAMER2_INTERNAL_EXPORT RtpSession * create_duplex_rtpsession(const char* local_ip,int loc_rtp_port, int loc_rtcp_port);
Ghislain MARY's avatar
Ghislain MARY committed
52

53
void media_stream_start_ticker(MediaStream *stream);
Ghislain MARY's avatar
Ghislain MARY committed
54

Ghislain MARY's avatar
Ghislain MARY committed
55
const char * media_stream_type_str(MediaStream *stream);
Ghislain MARY's avatar
Ghislain MARY committed
56 57 58

void media_stream_free(MediaStream *stream);

59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
/**
 * Ask the video stream to send a Picture Loss Indication.
 * @param[in] stream The videostream object.
 */
MS2_PUBLIC void video_stream_send_pli(VideoStream *stream);

/**
 * Ask the video stream to send a Slice Loss Indication.
 * @param[in] stream The videostream object.
 * @param[in] first The address of the first lost macroblock.
 * @param[in] number The number of lost macroblocks.
 * @param[in] picture_id The six least significant bits of the picture ID.
 */
MS2_PUBLIC void video_stream_send_sli(VideoStream *stream, uint16_t first, uint16_t number, uint8_t picture_id);

/**
 * Ask the video stream to send a Reference Picture Selection Indication.
 * @param[in] stream The videostream object.
 * @param[in] bit_string A pointer to the variable length native RPSI bit string to include in the RTCP FB message.
 * @param[in] bit_string_len The length of the bit_string in bits.
 */
MS2_PUBLIC void video_stream_send_rpsi(VideoStream *stream, uint8_t *bit_string, uint16_t bit_string_len);

82 83 84 85 86

void video_stream_open_player(VideoStream *stream, MSFilter *sink);

void video_stream_close_player(VideoStream *stream);

johan's avatar
johan committed
87 88 89 90
/**
 * Initialise srtp library, shall be called once but multiple call is supported
 * @return 0 on success, error code from srtp/crypto/include/err.h otherwise
 */
91
MS2_PUBLIC int ms_srtp_init(void);
johan's avatar
johan committed
92 93 94 95 96 97

/**
 * Shutdown the srtp library
 */
MS2_PUBLIC void ms_srtp_shutdown(void);

98 99 100 101 102 103
/**
 * Set the backlink in dtls_context to stream sessions context. Used when reinvite force creation of a new stream with same session data
 * @param[in/out]	dtls_context	Dtls context, contains a link to stream session context needed to access srtp context
 * @param[in]		stream_sessions	Pointer to the new stream session structure
 */
MS2_PUBLIC void ms_dtls_srtp_set_stream_sessions(MSDtlsSrtpContext *dtls_context, MSMediaStreamSessions *stream_sessions);
104 105 106 107 108 109
/**
 * Set the backlink in zrtp_context to stream sessions context. Used when reinvite force creation of a new stream with same session data
 * @param[in/out]	zrtp_context	ZRTP context, contains a link to stream session context needed to access srtp context
 * @param[in]		stream_sessions	Pointer to the new stream session structure
 */
MS2_PUBLIC void ms_zrtp_set_stream_sessions(MSZrtpContext *zrtp_context, MSMediaStreamSessions *stream_sessions);
110 111 112 113 114 115 116

bool_t media_stream_session_secured(const struct _MSMediaStreamSessions *sessions,MediaStreamDir dir);

MSSrtpCtx* ms_srtp_context_new();
void ms_srtp_context_delete(MSSrtpCtx *session);


117 118 119
#ifdef __cplusplus
}
#endif
120

Ghislain MARY's avatar
Ghislain MARY committed
121
#endif /* PRIVATE_H */