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

Add more sections to the high-level API documentation.

parent 7aed9d2c
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
* @mainpage * @mainpage
* *
* Project Website: http://www.mediastreamer2.com * Project Website: http://www.mediastreamer2.com
*
*
*/ */
/** /**
...@@ -41,7 +39,7 @@ ...@@ -41,7 +39,7 @@
* 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
...@@ -187,10 +185,20 @@ ...@@ -187,10 +185,20 @@
* @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.
**/
/** /**
...@@ -212,4 +220,3 @@ ...@@ -212,4 +220,3 @@
* @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