mediastream.h 17.1 KB
Newer Older
aymeric's avatar
aymeric committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/*
mediastreamer2 library - modular sound and video processing and streaming
Copyright (C) 2006  Simon MORLAT (simon.morlat@linphone.org)

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 MEDIASTREAM_H
#define MEDIASTREAM_H

Simon Morlat's avatar
Simon Morlat committed
24 25 26 27 28
#include <mediastreamer2/msfilter.h>
#include <mediastreamer2/msticker.h>
#include <mediastreamer2/mssndcard.h>
#include <mediastreamer2/mswebcam.h>
#include <mediastreamer2/msvideo.h>
29 30
#include <mediastreamer2/bitratecontrol.h>
#include <mediastreamer2/qualityindicator.h>
31
#include <mediastreamer2/ice.h>
Simon Morlat's avatar
Simon Morlat committed
32 33
#include <ortp/ortp.h>
#include <ortp/event.h>
34
#include <ortp/zrtp.h>
35
#include <ortp/ortp_srtp.h>
36

37
#include <ortp/zrtp.h>
aymeric's avatar
aymeric committed
38

39 40 41
#define PAYLOAD_TYPE_FLAG_CAN_RECV	PAYLOAD_TYPE_USER_FLAG_1
#define PAYLOAD_TYPE_FLAG_CAN_SEND	PAYLOAD_TYPE_USER_FLAG_2

42 43 44
typedef enum EchoLimiterType{
	ELInactive,
	ELControlMic,
45
	ELControlFull
46 47
} EchoLimiterType;

aymeric's avatar
aymeric committed
48 49 50 51
struct _AudioStream
{
	MSTicker *ticker;
	RtpSession *session;
52
	IceCheckList *ice_check_list;
aymeric's avatar
aymeric committed
53 54 55 56 57 58 59
	MSFilter *soundread;
	MSFilter *soundwrite;
	MSFilter *encoder;
	MSFilter *decoder;
	MSFilter *rtprecv;
	MSFilter *rtpsend;
	MSFilter *dtmfgen;
60
	MSFilter *dtmfgen_rtp;
Yann Diorcet's avatar
Yann Diorcet committed
61
	MSFilter *plc;
aymeric's avatar
aymeric committed
62
	MSFilter *ec;/*echo canceler*/
63
	MSFilter *volsend,*volrecv; /*MSVolumes*/
64 65
	MSFilter *read_resampler;
	MSFilter *write_resampler;
smorlat's avatar
smorlat committed
66
	MSFilter *equalizer;
67
	MSFilter *dummy;
68
	MSFilter *voidsink;
aymeric's avatar
aymeric committed
69
	uint64_t last_packet_count;
aymeric's avatar
aymeric committed
70
	time_t last_packet_time;
71
	EchoLimiterType el_type; /*use echo limiter: two MSVolume, measured input level controlling local output level*/
72
	OrtpEvQueue *evq;
73
	MSBitrateController *rc;
74
	MSQualityIndicator *qi;
75
	time_t start_time;
smorlat's avatar
smorlat committed
76
	bool_t play_dtmfs;
smorlat's avatar
smorlat committed
77
	bool_t use_gc;
78
	bool_t use_agc;
smorlat's avatar
smorlat committed
79
	bool_t eq_active;
80
	bool_t use_ng;/*noise gate*/
81
	bool_t use_rc;
82
	bool_t is_beginning;
83
	OrtpZrtpContext *ortpZrtpContext;
84
	srtp_t srtp_session;
Yann Diorcet's avatar
Yann Diorcet committed
85
	uint32_t features;
aymeric's avatar
aymeric committed
86 87 88 89 90 91
};

#ifdef __cplusplus
extern "C" {
#endif

92 93 94 95 96 97 98 99
/**
 * @addtogroup audio_stream_api
 * @{
**/

/**
 * The AudioStream holds all resources to create and run typical VoIP audiostream.
**/
aymeric's avatar
aymeric committed
100 101 102 103 104 105
typedef struct _AudioStream AudioStream;

struct _RingStream
{
	MSTicker *ticker;
	MSFilter *source;
106
	MSFilter *gendtmf;
Simon Morlat's avatar
Simon Morlat committed
107
	MSFilter *write_resampler;
aymeric's avatar
aymeric committed
108 109 110 111 112 113 114 115
	MSFilter *sndwrite;
};

typedef struct _RingStream RingStream;



/* start a thread that does sampling->encoding->rtp_sending|rtp_receiving->decoding->playing */
Simon Morlat's avatar
Simon Morlat committed
116
MS2_PUBLIC AudioStream *audio_stream_start (RtpProfile * prof, int locport, const char *remip,
aymeric's avatar
aymeric committed
117 118
				 int remport, int payload_type, int jitt_comp, bool_t echo_cancel);

Simon Morlat's avatar
Simon Morlat committed
119
MS2_PUBLIC AudioStream *audio_stream_start_with_sndcards(RtpProfile * prof, int locport, const char *remip4, int remport, int payload_type, int jitt_comp, MSSndCard *playcard, MSSndCard *captcard, bool_t echocancel);
aymeric's avatar
aymeric committed
120

121

Simon Morlat's avatar
Simon Morlat committed
122
MS2_PUBLIC int audio_stream_start_with_files (AudioStream * stream, RtpProfile * prof,
aymeric's avatar
aymeric committed
123 124 125 126
					    const char *remip, int remport, int rem_rtcp_port,
					    int pt, int jitt_comp,
					    const char * infile,  const char * outfile);

127 128 129 130 131 132 133 134 135
/**
 * Starts an audio stream from/to local wav files or soundcards.
 * 
 * This method starts the processing of the audio stream, that is playing from wav file or soundcard, voice processing, encoding,
 * sending through RTP, receiving from RTP, decoding, voice processing and wav file recording or soundcard playback.
 * 
 * 
 * @param stream an AudioStream previously created with audio_stream_new().
 * @param prof a RtpProfile containing all PayloadType possible during the audio session.
136 137 138
 * @param rem_rtp_ip remote IP address where to send the encoded audio.
 * @param rem_rtp_port remote IP port where to send the encoded audio.
 * @param rem_rtcp_ip remote IP address for RTCP.
139 140 141 142 143 144 145 146 147 148
 * @param rem_rtcp_port remote port for RTCP.
 * @param payload_type payload type index to use for the sending stream. This index must point to a valid PayloadType in the RtpProfile.
 * @param jitt_comp Nominal jitter buffer size in milliseconds.
 * @param infile path to wav file to play out (can be NULL)
 * @param outfile path to wav file to record into (can be NULL)
 * @param playcard The soundcard to be used for playback (can be NULL)
 * @param captcard The soundcard to be used for catpure. (can be NULL)
 * @param echo_cancel whether echo cancellation is to be performed.
 * @returns 0 if sucessful, -1 otherwise.
**/
149 150
MS2_PUBLIC int audio_stream_start_full(AudioStream *stream, RtpProfile *profile, const char *rem_rtp_ip,int rem_rtp_port,
	const char *rem_rtcp_ip, int rem_rtcp_port, int payload,int jitt_comp, const char *infile, const char *outfile,
151 152
	MSSndCard *playcard, MSSndCard *captcard, bool_t use_ec);

153

Simon Morlat's avatar
Simon Morlat committed
154 155
MS2_PUBLIC void audio_stream_play(AudioStream *st, const char *name);
MS2_PUBLIC void audio_stream_record(AudioStream *st, const char *name);
aymeric's avatar
aymeric committed
156

Simon Morlat's avatar
Simon Morlat committed
157
MS2_PUBLIC void audio_stream_set_rtcp_information(AudioStream *st, const char *cname, const char *tool);
aymeric's avatar
aymeric committed
158

Simon Morlat's avatar
Simon Morlat committed
159
MS2_PUBLIC void audio_stream_play_received_dtmfs(AudioStream *st, bool_t yesno);
smorlat's avatar
smorlat committed
160

161 162
/**
 * Creates an AudioStream object listening on a RTP port.
163 164
 * @param loc_rtp_port the local UDP port to listen for RTP packets.
 * @param loc_rtcp_port the local UDP port to listen for RTCP packets
165 166 167
 * @param ipv6 TRUE if ipv6 must be used.
 * @returns a new AudioStream.
**/
168
MS2_PUBLIC AudioStream *audio_stream_new(int loc_rtp_port, int loc_rtcp_port, bool_t ipv6);
169

170 171 172 173 174 175 176
#define AUDIO_STREAM_FEATURE_PLC 	(1 << 0)
#define AUDIO_STREAM_FEATURE_EC 	(1 << 1)
#define AUDIO_STREAM_FEATURE_EQUALIZER	(1 << 2)
#define AUDIO_STREAM_FEATURE_VOL_SND 	(1 << 3)
#define AUDIO_STREAM_FEATURE_VOL_RCV 	(1 << 4)
#define AUDIO_STREAM_FEATURE_DTMF	(1 << 5)
#define AUDIO_STREAM_FEATURE_DTMF_ECHO (1 << 6)
Yann Diorcet's avatar
Yann Diorcet committed
177 178 179 180 181 182 183 184 185 186 187 188
#define AUDIO_STREAM_FEATURE_ALL	(\
					AUDIO_STREAM_FEATURE_PLC | \
					AUDIO_STREAM_FEATURE_EC | \
					AUDIO_STREAM_FEATURE_EQUALIZER | \
					AUDIO_STREAM_FEATURE_VOL_SND | \
					AUDIO_STREAM_FEATURE_VOL_RCV | \
					AUDIO_STREAM_FEATURE_DTMF | \
					AUDIO_STREAM_FEATURE_DTMF_ECHO \
					)

MS2_PUBLIC uint32_t audio_stream_get_features(AudioStream *st);
MS2_PUBLIC void audio_stream_set_features(AudioStream *st, uint32_t features);
189 190 191 192
	
MS2_PUBLIC void audio_stream_prepare_sound(AudioStream *st, MSSndCard *playcard, MSSndCard *captcard);
MS2_PUBLIC void audio_stream_unprepare_sound(AudioStream *st);
MS2_PUBLIC bool_t audio_stream_started(AudioStream *stream);
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
/**
 * Starts an audio stream from local soundcards.
 * 
 * This method starts the processing of the audio stream, that is capture from soundcard, voice processing, encoding,
 * sending through RTP, receiving from RTP, decoding, voice processing and soundcard playback.
 * 
 * @param stream an AudioStream previously created with audio_stream_new().
 * @param prof a RtpProfile containing all PayloadType possible during the audio session.
 * @param remip remote IP address where to send the encoded audio.
 * @param remport remote IP port where to send the encoded audio
 * @param rem_rtcp_port remote port for RTCP.
 * @param payload_type payload type index to use for the sending stream. This index must point to a valid PayloadType in the RtpProfile.
 * @param jitt_comp Nominal jitter buffer size in milliseconds.
 * @param playcard The soundcard to be used for playback
 * @param captcard The soundcard to be used for catpure.
 * @param echo_cancel whether echo cancellation is to be performed.
**/
Simon Morlat's avatar
Simon Morlat committed
210 211
MS2_PUBLIC int audio_stream_start_now(AudioStream * stream, RtpProfile * prof,  const char *remip, int remport, int rem_rtcp_port, int payload_type, int jitt_comp,MSSndCard *playcard, MSSndCard *captcard, bool_t echo_cancel);
MS2_PUBLIC void audio_stream_set_relay_session_id(AudioStream *stream, const char *relay_session_id);
aymeric's avatar
aymeric committed
212
/*returns true if we are still receiving some data from remote end in the last timeout seconds*/
Simon Morlat's avatar
Simon Morlat committed
213
MS2_PUBLIC bool_t audio_stream_alive(AudioStream * stream, int timeout);
aymeric's avatar
aymeric committed
214

215 216 217 218
/**
 * Executes background low priority tasks related to audio processing (RTP statistics analysis).
 * It should be called periodically, for example with an interval of 100 ms or so.
 */
219 220
MS2_PUBLIC void audio_stream_iterate(AudioStream *stream);

smorlat's avatar
smorlat committed
221
/*enable echo-limiter dispositve: one MSVolume in input branch controls a MSVolume in the output branch*/
Simon Morlat's avatar
Simon Morlat committed
222
MS2_PUBLIC void audio_stream_enable_echo_limiter(AudioStream *stream, EchoLimiterType type);
223

smorlat's avatar
smorlat committed
224
/*enable gain control, to be done before start() */
Simon Morlat's avatar
Simon Morlat committed
225
MS2_PUBLIC void audio_stream_enable_gain_control(AudioStream *stream, bool_t val);
smorlat's avatar
smorlat committed
226

227
/*enable automatic gain control, to be done before start() */
Simon Morlat's avatar
Simon Morlat committed
228
MS2_PUBLIC void audio_stream_enable_automatic_gain_control(AudioStream *stream, bool_t val);
229

230
/*to be done before start */
Simon Morlat's avatar
Simon Morlat committed
231
MS2_PUBLIC void audio_stream_set_echo_canceller_params(AudioStream *st, int tail_len_ms, int delay_ms, int framesize);
232

233 234
/*enable adaptive rate control */
MS2_PUBLIC void audio_stream_enable_adaptive_bitrate_control(AudioStream *st, bool_t enabled);
235

236 237 238
/* Enable adaptive jitter compensation */
MS2_PUBLIC void audio_stream_enable_adaptive_jittcomp(AudioStream *st, bool_t enabled);

239

Simon Morlat's avatar
Simon Morlat committed
240
MS2_PUBLIC void audio_stream_set_mic_gain(AudioStream *stream, float gain);
smorlat's avatar
smorlat committed
241

242
/* enable/disable rtp stream */
Simon Morlat's avatar
Simon Morlat committed
243
MS2_PUBLIC void audio_stream_mute_rtp(AudioStream *stream, bool_t val);
Simon Morlat's avatar
Simon Morlat committed
244

245
/*enable noise gate, must be done before start()*/
Simon Morlat's avatar
Simon Morlat committed
246
MS2_PUBLIC void audio_stream_enable_noise_gate(AudioStream *stream, bool_t val);
247

smorlat's avatar
smorlat committed
248
/*enable parametric equalizer in the stream that goes to the speaker*/
Simon Morlat's avatar
Simon Morlat committed
249
MS2_PUBLIC void audio_stream_enable_equalizer(AudioStream *stream, bool_t enabled);
smorlat's avatar
smorlat committed
250

Simon Morlat's avatar
Simon Morlat committed
251
MS2_PUBLIC void audio_stream_equalizer_set_gain(AudioStream *stream, int frequency, float gain, int freq_width);
smorlat's avatar
smorlat committed
252

smorlat's avatar
smorlat committed
253
/* stop the audio streaming thread and free everything*/
Simon Morlat's avatar
Simon Morlat committed
254
MS2_PUBLIC void audio_stream_stop (AudioStream * stream);
aymeric's avatar
aymeric committed
255

Simon Morlat's avatar
Simon Morlat committed
256 257 258
MS2_PUBLIC RingStream *ring_start (const char * file, int interval, MSSndCard *sndcard);
MS2_PUBLIC RingStream *ring_start_with_cb(const char * file, int interval, MSSndCard *sndcard, MSFilterNotifyFunc func, void * user_data);
MS2_PUBLIC void ring_stop (RingStream * stream);
aymeric's avatar
aymeric committed
259 260 261


/* send a dtmf */
Simon Morlat's avatar
Simon Morlat committed
262
MS2_PUBLIC int audio_stream_send_dtmf (AudioStream * stream, char dtmf);
aymeric's avatar
aymeric committed
263

Simon Morlat's avatar
Simon Morlat committed
264
MS2_PUBLIC void audio_stream_set_default_card(int cardindex);
aymeric's avatar
aymeric committed
265

Simon Morlat's avatar
Simon Morlat committed
266
/* retrieve RTP statistics*/
Simon Morlat's avatar
Simon Morlat committed
267
MS2_PUBLIC void audio_stream_get_local_rtp_stats(AudioStream *stream, rtp_stats_t *stats);
Simon Morlat's avatar
Simon Morlat committed
268

269
/* returns a realtime indicator of the stream quality between 0 and 5 */
270 271
MS2_PUBLIC float audio_stream_get_quality_rating(AudioStream *stream);

272 273
/* returns the quality rating as an average since the start of the streaming session.*/
MS2_PUBLIC float audio_stream_get_average_quality_rating(AudioStream *stream);
aymeric's avatar
aymeric committed
274

275 276 277
/* enable ZRTP on the audio stream */
MS2_PUBLIC void audio_stream_enable_zrtp(AudioStream *stream, OrtpZrtpParams *params);

278 279
/* enable SRTP on the audio stream */
MS2_PUBLIC bool_t audio_stream_enable_strp(AudioStream* stream, enum ortp_srtp_crypto_suite_t suite, const char* snd_key, const char* rcv_key);
280

Simon Morlat's avatar
Simon Morlat committed
281 282
MS2_PUBLIC int audio_stream_set_dscp(AudioStream *stream, int dscp);

aymeric's avatar
aymeric committed
283 284 285 286
/*****************
  Video Support
 *****************/

287
typedef void (*VideoStreamRenderCallback)(void *user_pointer, const MSPicture *local_view, const MSPicture *remote_view);
288 289 290
typedef void (*VideoStreamEventCallback)(void *user_pointer, const MSFilter *f, const unsigned int event_id, const void *args);


aymeric's avatar
aymeric committed
291

292 293 294 295 296 297
typedef enum _VideoStreamDir{
	VideoStreamSendRecv,
	VideoStreamSendOnly,
	VideoStreamRecvOnly
}VideoStreamDir;

aymeric's avatar
aymeric committed
298 299 300 301
struct _VideoStream
{
	MSTicker *ticker;
	RtpSession *session;
302
	IceCheckList *ice_check_list;
aymeric's avatar
aymeric committed
303 304
	MSFilter *source;
	MSFilter *pixconv;
305
	MSFilter *sizeconv;
aymeric's avatar
aymeric committed
306 307 308 309 310 311
	MSFilter *tee;
	MSFilter *output;
	MSFilter *encoder;
	MSFilter *decoder;
	MSFilter *rtprecv;
	MSFilter *rtpsend;
312 313
	MSFilter *tee2;
	MSFilter *jpegwriter;
314
	MSFilter *output2;
315
	MSFilter *voidsink;
aymeric's avatar
aymeric committed
316
	OrtpEvQueue *evq;
317
	MSVideoSize sent_vsize;
smorlat's avatar
smorlat committed
318
	int corner; /*for selfview*/
319 320
	VideoStreamRenderCallback rendercb;
	void *render_pointer;
321 322
	VideoStreamEventCallback eventcb;
	void *event_pointer;
323
	char *display_name;
324 325
	unsigned long window_id;
	unsigned long preview_window_id;
326
	VideoStreamDir dir;
327
	MSWebCam *cam;
328
	bool_t use_preview_window;
329 330
	bool_t use_rc;
	bool_t pad[2];
331
    bool_t display_filter_auto_rotate_enabled;
332
	int device_orientation; /* warning: meaning of this variable depends on the platform (Android, iOS, ...) */
333
	OrtpZrtpContext *ortpZrtpContext;
334
	srtp_t srtp_session;
335
	MSBitrateController *rc;
aymeric's avatar
aymeric committed
336 337 338
};

typedef struct _VideoStream VideoStream;
339

340 341


342
MS2_PUBLIC VideoStream *video_stream_new(int loc_rtp_port, int loc_rtcp_port, bool_t use_ipv6);
Simon Morlat's avatar
Simon Morlat committed
343 344
MS2_PUBLIC void video_stream_set_direction(VideoStream *vs, VideoStreamDir dir);
MS2_PUBLIC void video_stream_enable_adaptive_bitrate_control(VideoStream *s, bool_t yesno);
345
MS2_PUBLIC void video_stream_enable_adaptive_jittcomp(VideoStream *st, bool_t enabled);
Simon Morlat's avatar
Simon Morlat committed
346 347 348
MS2_PUBLIC void video_stream_set_render_callback(VideoStream *s, VideoStreamRenderCallback cb, void *user_pointer);
MS2_PUBLIC void video_stream_set_event_callback(VideoStream *s, VideoStreamEventCallback cb, void *user_pointer);
MS2_PUBLIC void video_stream_set_display_filter_name(VideoStream *s, const char *fname);
349
MS2_PUBLIC int video_stream_start(VideoStream * stream, RtpProfile *profile, const char *rem_rtp_ip, int rem_rtp_port, const char *rem_rtcp_ip, int rem_rtcp_port,
aymeric's avatar
aymeric committed
350
		int payload, int jitt_comp, MSWebCam *device);
351 352
MS2_PUBLIC void video_stream_prepare_video(VideoStream *stream);
MS2_PUBLIC void video_stream_unprepare_video(VideoStream *stream);
353 354


Simon Morlat's avatar
Simon Morlat committed
355 356 357
MS2_PUBLIC void video_stream_set_relay_session_id(VideoStream *stream, const char *relay_session_id);
MS2_PUBLIC void video_stream_set_rtcp_information(VideoStream *st, const char *cname, const char *tool);
MS2_PUBLIC void video_stream_change_camera(VideoStream *stream, MSWebCam *cam);
358 359
/* Calling video_stream_set_sent_video_size() or changing the bitrate value in the used PayloadType during a stream is running does nothing.
The following function allows to take into account new parameters by redrawing the sending graph*/
Simon Morlat's avatar
Simon Morlat committed
360
MS2_PUBLIC void video_stream_update_video_params(VideoStream *stream);
aymeric's avatar
aymeric committed
361
/*function to call periodically to handle various events */
Simon Morlat's avatar
Simon Morlat committed
362 363 364 365 366 367 368 369 370 371
MS2_PUBLIC void video_stream_iterate(VideoStream *stream);
MS2_PUBLIC void video_stream_send_vfu(VideoStream *stream);
MS2_PUBLIC void video_stream_stop(VideoStream * stream);
MS2_PUBLIC void video_stream_set_sent_video_size(VideoStream *stream, MSVideoSize vsize);
MS2_PUBLIC void video_stream_enable_self_view(VideoStream *stream, bool_t val);
MS2_PUBLIC unsigned long video_stream_get_native_window_id(VideoStream *stream);
MS2_PUBLIC void video_stream_set_native_window_id(VideoStream *stream, unsigned long id);
MS2_PUBLIC void video_stream_set_native_preview_window_id(VideoStream *stream, unsigned long id);
MS2_PUBLIC unsigned long video_stream_get_native_preview_window_id(VideoStream *stream);
MS2_PUBLIC void video_stream_use_preview_video_window(VideoStream *stream, bool_t yesno);
372
MS2_PUBLIC void video_stream_set_device_rotation(VideoStream *stream, int orientation);
373
MS2_PUBLIC void video_stream_show_video(VideoStream *stream, bool_t show);
374

375
/*provided for compatibility, use video_stream_set_direction() instead */
Simon Morlat's avatar
Simon Morlat committed
376 377
MS2_PUBLIC int video_stream_recv_only_start(VideoStream *videostream, RtpProfile *profile, const char *addr, int port, int used_pt, int jitt_comp);
MS2_PUBLIC int video_stream_send_only_start(VideoStream *videostream,
378
				RtpProfile *profile, const char *addr, int port, int rtcp_port,
379
				int used_pt, int  jitt_comp, MSWebCam *device);
Simon Morlat's avatar
Simon Morlat committed
380 381
MS2_PUBLIC void video_stream_recv_only_stop(VideoStream *vs);
MS2_PUBLIC void video_stream_send_only_stop(VideoStream *vs);
aymeric's avatar
aymeric committed
382

383 384
/* enable ZRTP on the video stream using information from the audio stream */
MS2_PUBLIC void video_stream_enable_zrtp(VideoStream *vstream, AudioStream *astream, OrtpZrtpParams *param);
385

386 387
/* enable SRTP on the video stream */
MS2_PUBLIC bool_t video_stream_enable_strp(VideoStream* stream, enum ortp_srtp_crypto_suite_t suite, const char* snd_key, const char* rcv_key);
388 389
/* if enabled, the display filter will internaly rotate the video, according to the device orientation */
MS2_PUBLIC void video_stream_enable_display_filter_auto_rotate(VideoStream* stream, bool_t enable);
390

Simon Morlat's avatar
Simon Morlat committed
391 392
MS2_PUBLIC int video_stream_set_dscp(VideoStream *stream, int dscp);

393 394 395 396
/**
 * Small API to display a local preview window.
**/

Simon Morlat's avatar
Simon Morlat committed
397 398
typedef VideoStream VideoPreview;

Simon Morlat's avatar
Simon Morlat committed
399
MS2_PUBLIC VideoPreview * video_preview_new();
Simon Morlat's avatar
Simon Morlat committed
400 401 402 403
#define video_preview_set_size(p,s) 							video_stream_set_sent_video_size(p,s)
#define video_preview_set_display_filter_name(p,dt)	video_stream_set_display_filter_name(p,dt)
#define video_preview_set_native_window_id(p,id)		video_stream_set_native_preview_window_id (p,id)
#define video_preview_get_native_window_id(p)			video_stream_get_native_preview_window_id (p)
Simon Morlat's avatar
Simon Morlat committed
404 405
MS2_PUBLIC void video_preview_start(VideoPreview *stream, MSWebCam *device);
MS2_PUBLIC void video_preview_stop(VideoPreview *stream);
aymeric's avatar
aymeric committed
406

Simon Morlat's avatar
Simon Morlat committed
407
MS2_PUBLIC bool_t ms_is_ipv6(const char *address);
aymeric's avatar
aymeric committed
408

409

aymeric's avatar
aymeric committed
410 411 412 413
#ifdef __cplusplus
}
#endif

414 415 416
/**
 * @}
**/
aymeric's avatar
aymeric committed
417 418

#endif