private.h 4.4 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
/*
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"
25
#include "mediastreamer2/msvideopresets.h"
Ghislain MARY's avatar
Ghislain MARY committed
26 27


Ghislain MARY's avatar
Ghislain MARY committed
28 29 30 31 32 33 34 35 36 37 38 39 40 41
#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
42 43 44
#define MAX_RTP_SIZE	UDP_MAX_SIZE


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

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

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

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

void media_stream_free(MediaStream *stream);

58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
/**
 * 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);

81 82 83 84 85

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

void video_stream_close_player(VideoStream *stream);

johan's avatar
johan committed
86 87 88 89
/**
 * 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
 */
90
MS2_PUBLIC int ms_srtp_init(void);
johan's avatar
johan committed
91 92 93 94 95 96

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

97 98 99 100 101 102
/**
 * 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);
103 104 105 106 107 108
/**
 * 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);
109

110
bool_t ms_media_stream_sessions_secured(const MSMediaStreamSessions *sessions,MediaStreamDir dir);
111

112
MSSrtpCtx* ms_srtp_context_new(void);
113 114 115
void ms_srtp_context_delete(MSSrtpCtx *session);


116 117
void register_video_preset_high_fps(MSVideoPresetsManager *manager);

118
MSFilter *_ms_create_av_player(const char *filename);
119 120
void video_recorder_handle_event(void *userdata, MSFilter *recorder, unsigned int event, void *event_arg);

121

122 123 124
#ifdef __cplusplus
}
#endif
125

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