Commit 572e7222 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Add more sections to the high-level API documentation.

parent 7aed9d2c
/** /**
* @mainpage * @mainpage
*
* Project Website: http://www.mediastreamer2.com
*
* *
* Project Website: http://www.mediastreamer2.com
*/ */
/** /**
* @defgroup mediastreamer2_intro Introduction to mediastreamer2 concepts. * @defgroup mediastreamer2_intro Introduction to mediastreamer2 concepts.
* @brief Introduction * @brief Introduction
* *
* @section what_is_it What is mediastreamer2 * @section what_is_it What is mediastreamer2
* *
* mediastreamer2 is a powerful engine to make audio and video streams. * mediastreamer2 is a powerful engine to make audio and video streams.
* mediastreamer2 is GPL (COPYING). Please understand the licencing details * mediastreamer2 is GPL (COPYING). Please understand the licencing details
* before using it! * before using it!
* *
* Commercial support and licensing is provided by Belledonne Communications * Commercial support and licensing is provided by Belledonne Communications
* http://www.belledonne-communications.com * http://www.belledonne-communications.com
* *
* @see http://www.linphone.org/eng/documentation/dev/mediastreamer2.html * @see http://www.linphone.org/eng/documentation/dev/mediastreamer2.html
* *
* @section definitions Some definitions. * @section definitions Some definitions.
* *
* Filter: * Filter:
* A filter is a mediastreamer2 component that process data. A filter * A filter is a mediastreamer2 component that process data. A filter
...@@ -32,7 +30,7 @@ ...@@ -32,7 +30,7 @@
* play audio or display video data. * play audio or display video data.
* send or receive RTP data. * send or receive RTP data.
* encode or decode audio or video data. * encode or decode audio or video data.
* transform (resize video, resample audio...) data. * transform (resize video, resample audio...) data.
* duplicate any kind of data. * duplicate any kind of data.
* mix audio/video data. * mix audio/video data.
* </PRE> * </PRE>
...@@ -41,13 +39,13 @@ ...@@ -41,13 +39,13 @@
* data from OUTPUT pins to INPUT pins and will be responsible for * data from OUTPUT pins to INPUT pins and will be responsible for
* running filters. * running filters.
* *
* @section how_do_i_use_mediastreamer2 How do I use mediastremer2? * @section how_do_i_use_mediastreamer2 How do I use mediastreamer2?
* *
* Mediastreamer2 can be used for a lot of different purpose. The primary * Mediastreamer2 can be used for a lot of different purpose. The primary
* use is to manage RTP audio and video session. You will need to use * use is to manage RTP audio and video session. You will need to use
* the API to build filters, link them together in a graph. Then the * the API to build filters, link them together in a graph. Then the
* ticker API will help you to start and stop the graph. * ticker API will help you to start and stop the graph.
* *
* Basic graph sample: * Basic graph sample:
* *
* <PRE> * <PRE>
...@@ -106,7 +104,7 @@ ...@@ -106,7 +104,7 @@
* video4linux API (linux) * video4linux API (linux)
* Quicktime API (MACOSX) * Quicktime API (MACOSX)
* AV Foundation API (IOS) * AV Foundation API (IOS)
* android.hardware.Camera API (Android) * android.hardware.Camera API (Android)
* video display * video display
* v4w API (windows) * v4w API (windows)
* SDL API (linux, macosx...) * SDL API (linux, macosx...)
...@@ -187,29 +185,38 @@ ...@@ -187,29 +185,38 @@
* @defgroup mediastreamer2_audio_conference Audio conferencing API - easily create conferences. * @defgroup mediastreamer2_audio_conference Audio conferencing API - easily create conferences.
* @ingroup mediastreamer2_high_api * @ingroup mediastreamer2_high_api
* @brief Audio conferencing API - easily create conferences. * @brief Audio conferencing API - easily create conferences.
*
*
*/ */
/**
* @defgroup video_stream_api Creating typical VoIP video streams.
* @ingroup mediastreamer2_high_api
* @brief Video streaming API - easily run video streams from camera capture or static picture files to RTP.
**/
/**
* @defgroup ring_api Creating ring graphs.
* @ingroup mediastreamer2_high_api
* @brief Ring playing API - easily play a local ring from a wav file.
**/
/**
* @page mediastreamer2_readme README /**
* @page mediastreamer2_readme README
* @verbinclude README * @verbinclude README
*/ */
/** /**
* @page mediastreamer2_install INSTALL * @page mediastreamer2_install INSTALL
* @verbinclude INSTALL * @verbinclude INSTALL
*/ */
/** /**
* @page mediastreamer2_license COPYING * @page mediastreamer2_license COPYING
* @verbinclude COPYING * @verbinclude COPYING
*/ */
/** /**
* @page mediastreamer2_changelog ChangeLog * @page mediastreamer2_changelog ChangeLog
* @verbinclude ChangeLog * @verbinclude ChangeLog
*/ */
...@@ -45,6 +45,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. ...@@ -45,6 +45,31 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
extern "C" { extern "C" {
#endif #endif
/**
* @addtogroup ring_api
* @{
**/
struct _RingStream
{
MSTicker *ticker;
MSFilter *source;
MSFilter *gendtmf;
MSFilter *write_resampler;
MSFilter *sndwrite;
};
typedef struct _RingStream RingStream;
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);
/**
* @}
**/
typedef enum StreamType { typedef enum StreamType {
AudioStreamType, AudioStreamType,
VideoStreamType VideoStreamType
...@@ -69,6 +94,24 @@ struct _MediaStream { ...@@ -69,6 +94,24 @@ struct _MediaStream {
typedef struct _MediaStream MediaStream; typedef struct _MediaStream MediaStream;
MS2_PUBLIC void media_stream_set_rtcp_information(MediaStream *stream, const char *cname, const char *tool);
MS2_PUBLIC void media_stream_get_local_rtp_stats(MediaStream *stream, rtp_stats_t *stats);
MS2_PUBLIC int media_stream_set_dscp(MediaStream *stream, int dscp);
MS2_PUBLIC void media_stream_enable_adaptive_bitrate_control(MediaStream *stream, bool_t enabled);
MS2_PUBLIC void media_stream_enable_adaptive_jittcomp(MediaStream *stream, bool_t enabled);
MS2_PUBLIC bool_t media_stream_enable_srtp(MediaStream* stream, enum ortp_srtp_crypto_suite_t suite, const char* snd_key, const char* rcv_key);
/**
* @addtogroup audio_stream_api
* @{
**/
typedef enum EchoLimiterType{ typedef enum EchoLimiterType{
ELInactive, ELInactive,
ELControlMic, ELControlMic,
...@@ -103,42 +146,11 @@ struct _AudioStream ...@@ -103,42 +146,11 @@ struct _AudioStream
bool_t is_beginning; bool_t is_beginning;
}; };
MS2_PUBLIC void media_stream_set_rtcp_information(MediaStream *stream, const char *cname, const char *tool);
MS2_PUBLIC void media_stream_get_local_rtp_stats(MediaStream *stream, rtp_stats_t *stats);
MS2_PUBLIC int media_stream_set_dscp(MediaStream *stream, int dscp);
MS2_PUBLIC void media_stream_enable_adaptive_bitrate_control(MediaStream *stream, bool_t enabled);
MS2_PUBLIC void media_stream_enable_adaptive_jittcomp(MediaStream *stream, bool_t enabled);
MS2_PUBLIC bool_t media_stream_enable_srtp(MediaStream* stream, enum ortp_srtp_crypto_suite_t suite, const char* snd_key, const char* rcv_key);
/**
* @addtogroup audio_stream_api
* @{
**/
/** /**
* The AudioStream holds all resources to create and run typical VoIP audiostream. * The AudioStream holds all resources to create and run typical VoIP audiostream.
**/ **/
typedef struct _AudioStream AudioStream; typedef struct _AudioStream AudioStream;
struct _RingStream
{
MSTicker *ticker;
MSFilter *source;
MSFilter *gendtmf;
MSFilter *write_resampler;
MSFilter *sndwrite;
};
typedef struct _RingStream RingStream;
/* start a thread that does sampling->encoding->rtp_sending|rtp_receiving->decoding->playing */ /* start a thread that does sampling->encoding->rtp_sending|rtp_receiving->decoding->playing */
MS2_PUBLIC AudioStream *audio_stream_start (RtpProfile * prof, int locport, const char *remip, MS2_PUBLIC AudioStream *audio_stream_start (RtpProfile * prof, int locport, const char *remip,
...@@ -286,11 +298,6 @@ MS2_PUBLIC void audio_stream_equalizer_set_gain(AudioStream *stream, int frequen ...@@ -286,11 +298,6 @@ MS2_PUBLIC void audio_stream_equalizer_set_gain(AudioStream *stream, int frequen
/* stop the audio streaming thread and free everything*/ /* stop the audio streaming thread and free everything*/
MS2_PUBLIC void audio_stream_stop (AudioStream * stream); MS2_PUBLIC void audio_stream_stop (AudioStream * stream);
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);
/* send a dtmf */ /* send a dtmf */
MS2_PUBLIC int audio_stream_send_dtmf (AudioStream * stream, char dtmf); MS2_PUBLIC int audio_stream_send_dtmf (AudioStream * stream, char dtmf);
...@@ -319,15 +326,20 @@ MS2_PUBLIC static inline int audio_stream_set_dscp(AudioStream *stream, int dscp ...@@ -319,15 +326,20 @@ MS2_PUBLIC static inline int audio_stream_set_dscp(AudioStream *stream, int dscp
return media_stream_set_dscp(&stream->ms, dscp); return media_stream_set_dscp(&stream->ms, dscp);
} }
/***************** /**
Video Support * @}
*****************/ **/
/**
* @addtogroup video_stream_api
* @{
**/
typedef void (*VideoStreamRenderCallback)(void *user_pointer, const MSPicture *local_view, const MSPicture *remote_view); typedef void (*VideoStreamRenderCallback)(void *user_pointer, const MSPicture *local_view, const MSPicture *remote_view);
typedef void (*VideoStreamEventCallback)(void *user_pointer, const MSFilter *f, const unsigned int event_id, const void *args); typedef void (*VideoStreamEventCallback)(void *user_pointer, const MSFilter *f, const unsigned int event_id, const void *args);
typedef enum _VideoStreamDir{ typedef enum _VideoStreamDir{
VideoStreamSendRecv, VideoStreamSendRecv,
VideoStreamSendOnly, VideoStreamSendOnly,
...@@ -365,7 +377,6 @@ struct _VideoStream ...@@ -365,7 +377,6 @@ struct _VideoStream
typedef struct _VideoStream VideoStream; typedef struct _VideoStream VideoStream;
MS2_PUBLIC VideoStream *video_stream_new(int loc_rtp_port, int loc_rtcp_port, bool_t use_ipv6); MS2_PUBLIC VideoStream *video_stream_new(int loc_rtp_port, int loc_rtcp_port, bool_t use_ipv6);
MS2_PUBLIC void video_stream_set_direction(VideoStream *vs, VideoStreamDir dir); MS2_PUBLIC void video_stream_set_direction(VideoStream *vs, VideoStreamDir dir);
MS2_PUBLIC static inline void video_stream_enable_adaptive_bitrate_control(VideoStream *stream, bool_t enabled) { MS2_PUBLIC static inline void video_stream_enable_adaptive_bitrate_control(VideoStream *stream, bool_t enabled) {
...@@ -447,6 +458,10 @@ MS2_PUBLIC VideoPreview * video_preview_new(); ...@@ -447,6 +458,10 @@ MS2_PUBLIC VideoPreview * video_preview_new();
MS2_PUBLIC void video_preview_start(VideoPreview *stream, MSWebCam *device); MS2_PUBLIC void video_preview_start(VideoPreview *stream, MSWebCam *device);
MS2_PUBLIC void video_preview_stop(VideoPreview *stream); MS2_PUBLIC void video_preview_stop(VideoPreview *stream);
/**
* @}
**/
MS2_PUBLIC bool_t ms_is_ipv6(const char *address); MS2_PUBLIC bool_t ms_is_ipv6(const char *address);
...@@ -454,8 +469,4 @@ MS2_PUBLIC bool_t ms_is_ipv6(const char *address); ...@@ -454,8 +469,4 @@ MS2_PUBLIC bool_t ms_is_ipv6(const char *address);
} }
#endif #endif
/**
* @}
**/
#endif #endif
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