allfilters.h   allfilters.h 
skipping to change at line 84 skipping to change at line 84
MS_CA_READ_ID, MS_CA_READ_ID,
MS_CA_WRITE_ID, MS_CA_WRITE_ID,
MS_WINSNDDS_READ_ID, MS_WINSNDDS_READ_ID,
MS_WINSNDDS_WRITE_ID, MS_WINSNDDS_WRITE_ID,
MS_STATIC_IMAGE_ID, MS_STATIC_IMAGE_ID,
MS_V4L2_CAPTURE_ID, MS_V4L2_CAPTURE_ID,
MS_H263_OLD_DEC_ID, MS_H263_OLD_DEC_ID,
MS_H263_OLD_ENC_ID, MS_H263_OLD_ENC_ID,
MS_MIRE_ID, MS_MIRE_ID,
MS_VFW_ID, MS_VFW_ID,
MS_ICE_ID, MS_VOID_SOURCE_ID,
MS_VOID_SINK_ID, MS_VOID_SINK_ID,
MS_DSCAP_ID, MS_DSCAP_ID,
MS_AQ_READ_ID, MS_AQ_READ_ID,
MS_AQ_WRITE_ID, MS_AQ_WRITE_ID,
MS_EQUALIZER_ID, MS_EQUALIZER_ID,
MS_JPEG_DEC_ID, MS_JPEG_DEC_ID,
MS_JPEG_ENC_ID, MS_JPEG_ENC_ID,
MS_PULSE_READ_ID, MS_PULSE_READ_ID,
MS_PULSE_WRITE_ID, MS_PULSE_WRITE_ID,
MS_DRAWDIB_DISPLAY_ID, MS_DRAWDIB_DISPLAY_ID,
skipping to change at line 135 skipping to change at line 135
MS_G726_40_DEC_ID, MS_G726_40_DEC_ID,
MS_G726_32_DEC_ID, MS_G726_32_DEC_ID,
MS_G726_24_DEC_ID, MS_G726_24_DEC_ID,
MS_G726_16_DEC_ID, MS_G726_16_DEC_ID,
MS_AAL2_G726_40_DEC_ID, MS_AAL2_G726_40_DEC_ID,
MS_AAL2_G726_32_DEC_ID, MS_AAL2_G726_32_DEC_ID,
MS_AAL2_G726_24_DEC_ID, MS_AAL2_G726_24_DEC_ID,
MS_AAL2_G726_16_DEC_ID, MS_AAL2_G726_16_DEC_ID,
MS_L16_ENC_ID, MS_L16_ENC_ID,
MS_L16_DEC_ID, MS_L16_DEC_ID,
MS_OSX_GL_DISPLAY_ID MS_OSX_GL_DISPLAY_ID,
MS_GLXVIDEO_ID,
MS_GENERIC_PLC_ID,
MS_WEBRTC_AEC_ID,
MS_AAC_ELD_ENC_ID,
MS_AAC_ELD_DEC_ID,
MS_OPUS_ENC_ID,
MS_OPUS_DEC_ID
} MSFilterId; } MSFilterId;
#endif #endif
 End of changes. 2 change blocks. 
2 lines changed or deleted 9 lines changed or added


 b64.h   b64.h 
skipping to change at line 227 skipping to change at line 227
* *
* \note The function returns the required length if \c dest is NULL * \note The function returns the required length if \c dest is NULL
* *
* \note The function returns the required length if \c dest is NULL. The r eturned size * \note The function returns the required length if \c dest is NULL. The r eturned size
* might be larger than the actual required size, but will never be small er. * might be larger than the actual required size, but will never be small er.
* *
* \note Threading: The function is fully re-entrant. * \note Threading: The function is fully re-entrant.
* *
* \see b64::encode() * \see b64::encode()
*/ */
size_t b64_encode(void const *src, size_t srcSize, char *dest, size_t destL en); ORTP_PUBLIC size_t b64_encode(void const *src, size_t srcSize, char *dest, size_t destLen);
/** \brief Encodes a block of binary data into Base-64 /** \brief Encodes a block of binary data into Base-64
* *
* \param src Pointer to the block to be encoded. May not be NULL, except w hen * \param src Pointer to the block to be encoded. May not be NULL, except w hen
* \c dest is NULL, in which case it is ignored. * \c dest is NULL, in which case it is ignored.
* \param srcSize Length of block to be encoded * \param srcSize Length of block to be encoded
* \param dest Pointer to the buffer into which the result is to be written . May * \param dest Pointer to the buffer into which the result is to be written . May
* be NULL, in which case the function returns the required length * be NULL, in which case the function returns the required length
* \param destLen Length of the buffer into which the result is to be writt en. Must * \param destLen Length of the buffer into which the result is to be writt en. Must
* be at least as large as that indicated by the return value from * be at least as large as that indicated by the return value from
skipping to change at line 298 skipping to change at line 298
* \note \anchor anchor__4_characters The behaviour of both * \note \anchor anchor__4_characters The behaviour of both
* \link b64::b64_encode2 b64_encode2()\endlink * \link b64::b64_encode2 b64_encode2()\endlink
* and * and
* \link b64::b64_decode2 b64_decode2()\endlink * \link b64::b64_decode2 b64_decode2()\endlink
* are undefined if the line length is not a multiple of 4. * are undefined if the line length is not a multiple of 4.
* *
* \note Threading: The function is fully re-entrant. * \note Threading: The function is fully re-entrant.
* *
* \see b64::decode() * \see b64::decode()
*/ */
size_t b64_decode(char const *src, size_t srcLen, void *dest, size_t destSi ze); ORTP_PUBLIC size_t b64_decode(char const *src, size_t srcLen, void *dest, s ize_t destSize);
/** \brief Decodes a sequence of Base-64 into a block of binary data /** \brief Decodes a sequence of Base-64 into a block of binary data
* *
* \param src Pointer to the Base-64 block to be decoded. May not be NULL, except when * \param src Pointer to the Base-64 block to be decoded. May not be NULL, except when
* \c dest is NULL, in which case it is ignored. If \c dest is NULL, and \c src is * \c dest is NULL, in which case it is ignored. If \c dest is NULL, and \c src is
* <b>not</b> NULL, then the returned value is calculated exactly, otherwis e a value * <b>not</b> NULL, then the returned value is calculated exactly, otherwis e a value
* is returned that is guaranteed to be large enough to hold the decoded bl ock. * is returned that is guaranteed to be large enough to hold the decoded bl ock.
* *
* \param srcLen Length of block to be encoded. Must be an integral of 4, t he Base-64 * \param srcLen Length of block to be encoded. Must be an integral of 4, t he Base-64
* encoding quantum, otherwise the Base-64 block is assumed to be invalid * encoding quantum, otherwise the Base-64 block is assumed to be invalid
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 bitratecontrol.h   bitratecontrol.h 
skipping to change at line 25 skipping to change at line 25
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef ms2_ratecontrol #ifndef ms2_ratecontrol
#define ms2_ratecontrol #define ms2_ratecontrol
#include "mediastreamer2/msfilter.h" #include "mediastreamer2/msfilter.h"
#include <ortp/ortp.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/** /**
* Audio Bitrate controller object * Audio Bitrate controller object
**/ **/
typedef struct _MSAudioBitrateController MSAudioBitrateController; typedef struct _MSAudioBitrateController MSAudioBitrateController;
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 dtmfgen.h   dtmfgen.h 
skipping to change at line 40 skipping to change at line 40
/**Start playing a given dtmf, then it has to be stopped using MS_DTMF_GEN_ STOP */ /**Start playing a given dtmf, then it has to be stopped using MS_DTMF_GEN_ STOP */
#define MS_DTMF_GEN_START MS_FILTER_METHOD(MS_DTMF_GEN_ID,1,co nst char) #define MS_DTMF_GEN_START MS_FILTER_METHOD(MS_DTMF_GEN_ID,1,co nst char)
/**Stop currently played dtmf*/ /**Stop currently played dtmf*/
#define MS_DTMF_GEN_STOP MS_FILTER_METHOD_NO_ARG(MS_DTMF_GEN_ ID,2) #define MS_DTMF_GEN_STOP MS_FILTER_METHOD_NO_ARG(MS_DTMF_GEN_ ID,2)
/** /**
* Structure describing a custom tone. * Structure describing a custom tone.
**/ **/
struct _MSDtmfGenCustomTone{ struct _MSDtmfGenCustomTone{
int duration; /**<Duration of the tone in milliseconds*/ char tone_name[8]; /**<Tone name for convenience*/
int frequency; /**<Frequency of the tone to be played */ int duration; /**<Duration of the tone in milliseconds*/
float amplitude; /**<Amplitude of the tone, 1.0 being the 0dbm norma int frequencies[2]; /**<Frequencies of the tone to be played */
lized level*/ float amplitude; /**<Amplitude of the tone, 1.0 being the 0db
int interval; /**<Interval 'between tones' in milliseconds*/ m normalized level*/
int interval; /**<Interval 'between tones' in milliseconds
*/
int repeat_count; /**<Number of times the tone is repeated.*/
}; };
typedef struct _MSDtmfGenCustomTone MSDtmfGenCustomTone; typedef struct _MSDtmfGenCustomTone MSDtmfGenCustomTone;
/**Play a custom tone according to the supplied tone description*/ /**Play a custom tone according to the supplied tone description*/
#define MS_DTMF_GEN_PLAY_CUSTOM MS_FILTER_METHOD(MS_DTMF_GEN_ID,3,MS DtmfGenCustomTone) #define MS_DTMF_GEN_PLAY_CUSTOM MS_FILTER_METHOD(MS_DTMF_GEN_ID,3,MS DtmfGenCustomTone)
/**Sets default amplitude for dtmfs, expressed in the 0..1 range*/ /**Sets default amplitude for dtmfs, expressed in the 0..1 range*/
#define MS_DTMF_GEN_SET_DEFAULT_AMPLITUDE MS_FILTER_METHOD(MS_DTMF_GEN_ID,4 ,float) #define MS_DTMF_GEN_SET_DEFAULT_AMPLITUDE MS_FILTER_METHOD(MS_DTMF_GEN_ID,4 ,float)
 End of changes. 1 change blocks. 
5 lines changed or deleted 8 lines changed or added


 event.h   event.h 
skipping to change at line 29 skipping to change at line 29
#ifndef ortp_events_h #ifndef ortp_events_h
#define ortp_events_h #define ortp_events_h
#include <ortp/str_utils.h> #include <ortp/str_utils.h>
typedef mblk_t OrtpEvent; typedef mblk_t OrtpEvent;
typedef unsigned long OrtpEventType; typedef unsigned long OrtpEventType;
typedef enum {
OrtpRTPSocket,
OrtpRTCPSocket
} OrtpSocketType;
typedef struct RtpEndpoint{ typedef struct RtpEndpoint{
#ifdef ORTP_INET6 #ifdef ORTP_INET6
struct sockaddr_storage addr; struct sockaddr_storage addr;
#else #else
struct sockaddr addr; struct sockaddr addr;
#endif #endif
socklen_t addrlen; socklen_t addrlen;
}RtpEndpoint; }RtpEndpoint;
struct _OrtpEventData{ struct _OrtpEventData{
mblk_t *packet; /* most events are associated to a received packet * / mblk_t *packet; /* most events are associated to a received packet * /
RtpEndpoint *ep; RtpEndpoint *ep;
ortpTimeSpec ts;
union { union {
int telephone_event; int telephone_event;
int payload_type; int payload_type;
bool_t zrtp_stream_encrypted; bool_t zrtp_stream_encrypted;
struct _ZrtpSas{ struct _ZrtpSas{
char sas[5]; // 4 characters char sas[5]; // 4 characters
bool_t verified; bool_t verified;
} zrtp_sas; } zrtp_sas;
OrtpSocketType socket_type;
bool_t ice_processing_successful;
} info; } info;
}; };
typedef struct _OrtpEventData OrtpEventData; typedef struct _OrtpEventData OrtpEventData;
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
RtpEndpoint *rtp_endpoint_new(struct sockaddr *addr, socklen_t addrlen); ORTP_PUBLIC RtpEndpoint *rtp_endpoint_new(struct sockaddr *addr, socklen_t
RtpEndpoint *rtp_endpoint_dup(const RtpEndpoint *ep); addrlen);
ORTP_PUBLIC RtpEndpoint *rtp_endpoint_dup(const RtpEndpoint *ep);
OrtpEvent * ortp_event_new(OrtpEventType tp); ORTP_PUBLIC OrtpEvent * ortp_event_new(OrtpEventType tp);
OrtpEventType ortp_event_get_type(const OrtpEvent *ev); ORTP_PUBLIC OrtpEventType ortp_event_get_type(const OrtpEvent *ev);
/* type is one of the following*/ /* type is one of the following*/
#define ORTP_EVENT_STUN_PACKET_RECEIVED 1 #define ORTP_EVENT_STUN_PACKET_RECEIVED 1
#define ORTP_EVENT_PAYLOAD_TYPE_CHANGED 2 #define ORTP_EVENT_PAYLOAD_TYPE_CHANGED 2
#define ORTP_EVENT_TELEPHONE_EVENT 3 #define ORTP_EVENT_TELEPHONE_EVENT 3
#define ORTP_EVENT_RTCP_PACKET_RECEIVED 4 /**<when a RTCP pa cket is received from far end */ #define ORTP_EVENT_RTCP_PACKET_RECEIVED 4 /**<when a RTCP pa cket is received from far end */
#define ORTP_EVENT_RTCP_PACKET_EMITTED 5 /**<fired when oRTP decide s to send an automatic RTCP SR or RR */ #define ORTP_EVENT_RTCP_PACKET_EMITTED 5 /**<fired when oRTP decide s to send an automatic RTCP SR or RR */
#define ORTP_EVENT_ZRTP_ENCRYPTION_CHANGED 6 #define ORTP_EVENT_ZRTP_ENCRYPTION_CHANGED 6
#define ORTP_EVENT_ZRTP_SAS_READY 7 #define ORTP_EVENT_ZRTP_SAS_READY 7
#define ORTP_EVENT_ICE_CHECK_LIST_PROCESSING_FINISHED 8
OrtpEventData * ortp_event_get_data(OrtpEvent *ev); #define ORTP_EVENT_ICE_SESSION_PROCESSING_FINISHED 9
void ortp_event_destroy(OrtpEvent *ev); #define ORTP_EVENT_ICE_GATHERING_FINISHED 10
OrtpEvent *ortp_event_dup(OrtpEvent *ev); #define ORTP_EVENT_ICE_LOSING_PAIRS_COMPLETED 11
#define ORTP_EVENT_ICE_RESTART_NEEDED 12
ORTP_PUBLIC OrtpEventData * ortp_event_get_data(OrtpEvent *ev);
ORTP_PUBLIC void ortp_event_destroy(OrtpEvent *ev);
ORTP_PUBLIC OrtpEvent *ortp_event_dup(OrtpEvent *ev);
typedef struct OrtpEvQueue{ typedef struct OrtpEvQueue{
queue_t q; queue_t q;
ortp_mutex_t mutex; ortp_mutex_t mutex;
} OrtpEvQueue; } OrtpEvQueue;
OrtpEvQueue * ortp_ev_queue_new(void); ORTP_PUBLIC OrtpEvQueue * ortp_ev_queue_new(void);
void ortp_ev_queue_destroy(OrtpEvQueue *q); ORTP_PUBLIC void ortp_ev_queue_destroy(OrtpEvQueue *q);
OrtpEvent * ortp_ev_queue_get(OrtpEvQueue *q); ORTP_PUBLIC OrtpEvent * ortp_ev_queue_get(OrtpEvQueue *q);
void ortp_ev_queue_flush(OrtpEvQueue * qp); ORTP_PUBLIC void ortp_ev_queue_flush(OrtpEvQueue * qp);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 7 change blocks. 
12 lines changed or deleted 26 lines changed or added


 ice.h   ice.h 
/* /*
mediastreamer2 library - modular sound and video processing and streaming mediastreamer2 library - modular sound and video processing and streaming
Copyright (C) 2006 Simon MORLAT (simon.morlat@linphone.org) Copyright (C) 2012 Belledonne Communications
This program is free software; you can redistribute it and/or This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2 as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version. of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef ice_hh #ifndef ice_h
#define ice_hh #define ice_h
#include <mediastreamer2/msfilter.h> #include "mscommon.h"
#include "ortp/stun_udp.h" #include "ortp/stun_udp.h"
#include "ortp/stun.h" #include "ortp/stun.h"
#include "ortp/ortp.h" #include "ortp/ortp.h"
/* list of state for STUN connectivity check */ /**
#define ICE_PRUNED -1 * @file ice.h
#define ICE_FROZEN 0 * @brief mediastreamer2 ice.h include file
#define ICE_WAITING 1 *
#define ICE_IN_PROGRESS 2 /* STUN request was sent */ * This file provides the API to handle the ICE protocol defined in the RFC
#define ICE_SUCCEEDED 3 5245.
#define ICE_FAILED 4 /* no answer or unrecoverable failure */ */
struct SdpCandidate { /**
/* mandatory attributes: draft 19 */ * ICE agent role.
int foundation; *
int component_id; * See the terminology in paragraph 3 of the RFC 5245 for more details.
char transport[20]; */
int priority; typedef enum {
char conn_addr[64]; IR_Controlling,
int conn_port; IR_Controlled
char cand_type[20]; } IceRole;
char rel_addr[64];
int rel_port; /**
* ICE candidate type.
/* optionnal attributes: draft 19 */ *
char extension_attr[512]; /* *(SP extension-att-name SP extension-at * See the terminology in paragraph 3 of the RFC 5245 for more details.
t-value) */ */
}; typedef enum {
ICT_HostCandidate,
struct CandidatePair { ICT_ServerReflexiveCandidate,
ICT_PeerReflexiveCandidate,
struct SdpCandidate local_candidate; ICT_RelayedCandidate
struct SdpCandidate remote_candidate; } IceCandidateType;
long long pair_priority;
/* additionnal information */ /**
int rem_controlling; * ICE candidate pair state.
UInt96 tid; *
int connectivity_check; * See paragraph 5.7.4 ("Computing states") of RFC 5245 for more details.
int retransmission_number; */
uint64_t retransmission_time; typedef enum {
int nominated_pair; ICP_Waiting,
}; ICP_InProgress,
ICP_Succeeded,
#define MAX_ICE_CANDIDATES 10 ICP_Failed,
ICP_Frozen
struct IceCheckList { } IceCandidatePairState;
struct CandidatePair cand_pairs[MAX_ICE_CANDIDATES];
int nominated_pair_index; /**
* ICE check list state.
char loc_ice_ufrag[256]; *
char loc_ice_pwd[256]; * See paragraph 5.7.4 ("Computing states") of RFC 5245 for more details.
char rem_ice_ufrag[256]; */
char rem_ice_pwd[256]; typedef enum {
ICL_Running,
int rem_controlling; ICL_Completed,
uint64_t tiebreak_value; ICL_Failed
} IceCheckListState;
#define ICE_CL_RUNNING 0
#define ICE_CL_COMPLETED 1 /**
#define ICE_CL_FAILED 2 * ICE session state.
int state; */
typedef enum {
int RTO; IS_Stopped,
int Ta; IS_Running,
uint64_t keepalive_time; IS_Completed,
}; IS_Failed
} IceSessionState;
/**
* Structure representing an ICE session.
*/
typedef struct _IceSession {
MSList *streams; /**< List of IceChecklist structures. Each e
lement of the list represents a media stream */
char *local_ufrag; /**< Local username fragment for the session
(assigned during the session creation) */
char *local_pwd; /**< Local password for the session (assigne
d during the session creation) */
char *remote_ufrag; /**< Remote username fragment for the sessio
n (provided via SDP by the peer) */
char *remote_pwd; /**< Remote password for the session (provid
ed via SDP by the peer) */
IceRole role; /**< Role played by the agent for this session */
IceSessionState state; /**< State of the session */
uint64_t tie_breaker; /**< Random number used to resolve role conf
licts (see paragraph 5.2 of the RFC 5245) */
uint32_t ta; /**< Duration of timer for sending connectivity chec
ks in ms */
uint8_t max_connectivity_checks; /**< Configuration parameter
to limit the number of connectivity checks performed by the agent (default
is 100) */
uint8_t keepalive_timeout; /**< Configuration parameter to defi
ne the timeout between each keepalive packets (default is 15s) */
MSTimeSpec event_time; /**< Time when an event must be sent */
int event_value; /** Value of the event to send */
bool_t send_event; /**< Boolean value telling whether an event
must be sent or not */
struct sockaddr_storage ss; /**< STUN server address to use for
the candidates gathering process */
socklen_t ss_len; /**< Length of the STUN server address to us
e for the candidates gathering process */
MSTimeSpec gathering_start_ts;
MSTimeSpec gathering_end_ts;
} IceSession;
typedef struct _IceStunServerCheckTransaction {
UInt96 transactionID;
MSTimeSpec request_time;
MSTimeSpec response_time;
} IceStunServerCheckTransaction;
typedef struct _IceStunServerCheck {
ortp_socket_t sock;
int srcport;
MSList *transactions; /**< List of IceStunServerCheckTransaction s
tructures. */
MSTimeSpec next_transmission_time;
bool_t responded;
} IceStunServerCheck;
/**
* Structure representing an ICE transport address.
*/
typedef struct _IceTransportAddress {
char ip[64];
int port;
// TODO: Handling of IP version (4 or 6) and transport type: TCP, UD
P...
} IceTransportAddress;
/**
* Structure representing an ICE candidate.
*/
typedef struct _IceCandidate {
char foundation[32]; /**< Foundation of the candidate (see paragr
aph 3 of the RFC 5245 for more details */
IceTransportAddress taddr; /**< Transport address of the candid
ate */
IceCandidateType type; /**< Type of the candidate */
uint32_t priority; /**< Priority of the candidate */
uint16_t componentID; /**< component ID between 1 and 256: usually
1 for RTP component and 2 for RTCP component */
struct _IceCandidate *base; /**< Pointer to the candidate that i
s the base of the current one */
bool_t is_default; /**< Boolean value telling whether this cand
idate is a default candidate or not */
} IceCandidate;
/**
* Structure representing an ICE candidate pair.
*/
typedef struct _IceCandidatePair {
IceCandidate *local; /**< Pointer to the local candidate of the p
air */
IceCandidate *remote; /**< Pointer to the remote candidate of the
pair */
IceCandidatePairState state; /**< State of the candidate pair */
uint64_t priority; /**< Priority of the candidate pair */
MSTimeSpec transmission_time; /**< Time when the connectivity chec
k for the candidate pair has been sent */
uint32_t rto; /**< Duration of the retransmit timer for the connec
tivity check sent for the candidate pair in ms */
uint8_t retransmissions; /**< Number of retransmissions for t
he connectivity check sent for the candidate pair */
IceRole role; /**< Role of the agent when the connectivity check h
as been sent for the candidate pair */
bool_t is_default; /**< Boolean value telling whether this cand
idate pair is a default candidate pair or not */
bool_t use_candidate; /**< Boolean value telling if the USE-CANDID
ATE attribute must be set for the connectivity checks send for the candidat
e pair */
bool_t is_nominated; /**< Boolean value telling whether this cand
idate pair is nominated or not */
bool_t wait_transaction_timeout; /**< Boolean value telling t
o create a new binding request on retransmission timeout */
} IceCandidatePair;
/**
* Structure representing the foundation of an ICE candidate pair.
*
* It is the concatenation of the foundation of a local candidate and the f
oundation of a remote candidate.
*/
typedef struct _IcePairFoundation {
char local[32]; /**< Foundation of the local candidate */
char remote[32]; /**< Foundation of the remote candidate */
} IcePairFoundation;
typedef struct _IceValidCandidatePair {
IceCandidatePair *valid; /**< Pointer to a valid candidate pa
ir (it may be in the check list or not */
IceCandidatePair *generated_from; /**< Pointer to the candidat
e pair that generated the connectivity check producing the valid candidate
pair */
bool_t selected; /**< Boolean value telling whether this vali
d candidate pair has been selected or not */
} IceValidCandidatePair;
typedef struct _IceTransaction {
UInt96 transactionID; /**< Transaction ID of the connectivity chec
k sent for the candidate pair */
IceCandidatePair *pair; /**< A pointer to the candidate pair associa
ted with the transaction. */
} IceTransaction;
/**
* Structure representing an ICE check list.
*
* Each media stream must be assigned a check list.
* Check lists are added to an ICE session using the ice_session_add_check_
list() function.
*/
typedef struct _IceCheckList {
IceSession *session; /**< Pointer to the ICE session */
RtpSession *rtp_session; /**< Pointer to the RTP session asso
ciated with this ICE check list */
char *remote_ufrag; /**< Remote username fragment for this check
list (provided via SDP by the peer) */
char *remote_pwd; /**< Remote password for this check list (pr
ovided via SDP by the peer) */
MSList *stun_server_checks; /**< List of IceStunServerCheck stru
ctures */
MSList *local_candidates; /**< List of IceCandidate structures
*/
MSList *remote_candidates; /**< List of IceCandidate structures
*/
MSList *pairs; /**< List of IceCandidatePair structures */
MSList *losing_pairs; /**< List of IceCandidatePair structures */
MSList *triggered_checks_queue; /**< List of IceCandidatePair struct
ures */
MSList *check_list; /**< List of IceCandidatePair structures */
MSList *valid_list; /**< List of IceValidCandidatePair structure
s */
MSList *foundations; /**< List of IcePairFoundation structures */
MSList *local_componentIDs; /**< List of uint16_t */
MSList *remote_componentIDs; /**< List of uint16_t */
MSList *transaction_list; /**< List of IceTransaction structur
es */
IceCheckListState state; /**< Global state of the ICE check l
ist */
MSTimeSpec ta_time; /**< Time when the Ta timer has been process
ed for the last time */
MSTimeSpec keepalive_time; /**< Time when the last keepalive pa
cket has been sent for this stream */
uint32_t foundation_generator; /**< Autoincremented integer to gene
rate unique foundation values */
bool_t mismatch; /**< Boolean value telling whether there was
a mismatch during the answer/offer process */
bool_t gathering_candidates; /**< Boolean value telling whether a
candidate gathering process is running or not */
bool_t gathering_finished; /**< Boolean value telling whether t
he candidate gathering process has finished or not */
bool_t nomination_delay_running; /**< Boolean value telling w
hether the nomination process has been delayed or not */
MSTimeSpec gathering_start_time; /**< Time when the gathering
process was started */
MSTimeSpec nomination_delay_start_time; /**< Time when the nominatio
n process has been delayed */
} IceCheckList;
#define MS_ICE_SET_SESSION MS_FILTER_METHOD(MS_ICE_ID,0 #ifdef __cplusplus
,RtpSession*) extern "C"{
#define MS_ICE_SET_CANDIDATEPAIRS MS_FILTER_METHOD(MS_ICE_ID,1,struct #endif
CandidatePair*)
/**
* Allocate a new ICE session.
*
* @return Pointer to the allocated session
*
* This must be performed for each media session that is to use ICE.
*/
MS2_PUBLIC IceSession * ice_session_new(void);
/**
* Destroy a previously allocated ICE session.
*
* @param session The session to destroy.
*
* To be used when a media session using ICE is tore down.
*/
MS2_PUBLIC void ice_session_destroy(IceSession *session);
/**
* Allocate a new ICE check list.
*
* @return Pointer to the allocated check list
*
* A check list must be allocated for each media stream of a media session
and be added to an ICE session using the ice_session_add_check_list() funct
ion.
*/
MS2_PUBLIC IceCheckList * ice_check_list_new(void);
/**
* Destroy a previously allocated ICE check list.
*
* @param cl The check list to destroy
*/
MS2_PUBLIC void ice_check_list_destroy(IceCheckList *cl);
/**
* Tell whether ICE local candidates have been gathered for an ICE check li
st or not.
*
* @param session A pointer to a check list
* @return TRUE if local candidates have been gathered for the check list,
FALSE otherwise.
*/
MS2_PUBLIC bool_t ice_check_list_candidates_gathered(const IceCheckList *cl
);
/**
* Get the nth check list of an ICE session.
*
* @param session A pointer to a session
* @param n The number of the check list to access
* @return A pointer to the nth check list of the session if it exists, NUL
L otherwise
*/
MS2_PUBLIC IceCheckList *ice_session_check_list(const IceSession *session,
unsigned int n);
/**
* Get the local username fragment of an ICE session.
*
* @param session A pointer to a session
* @return A pointer to the local username fragment of the session
*/
MS2_PUBLIC const char * ice_session_local_ufrag(const IceSession *session);
/**
* Get the local password of an ICE session.
*
* @param session A pointer to a session
* @return A pointer to the local password of the session
*/
MS2_PUBLIC const char * ice_session_local_pwd(const IceSession *session);
/**
* Get the remote username fragment of an ICE session.
*
* @param session A pointer to a session
* @return A pointer to the remote username fragment of the session
*/
MS2_PUBLIC const char * ice_session_remote_ufrag(const IceSession *session)
;
/**
* Get the remote password of an ICE session.
*
* @param session A pointer to a session
* @return A pointer to the remote password of the session
*/
MS2_PUBLIC const char * ice_session_remote_pwd(const IceSession *session);
/**
* Get the state of an ICE session.
*
* @param session A pointer to a session
* @return The state of the session
*/
MS2_PUBLIC IceSessionState ice_session_state(const IceSession *session);
/**
* Gte the role of the agent for an ICE session.
*
* @param session A pointer to a session
* @return The role of the agent for the session
*/
MS2_PUBLIC IceRole ice_session_role(const IceSession *session);
/**
* Set the role of the agent for an ICE session.
*
* @param session The session for which to set the role
* @param role The role to set the session to
*/
MS2_PUBLIC void ice_session_set_role(IceSession *session, IceRole role);
/**
* Set the local credentials of an ICE session.
*
* This function SHOULD not be used. However, it is used by mediastream for
testing purpose to
* apply the same credentials for local and remote agents because the SDP e
xchange is bypassed.
*/
MS2_PUBLIC void ice_session_set_local_credentials(IceSession *session, cons
t char *ufrag, const char *pwd);
/**
* Tell if remote credentials of an ICE session have changed or not.
*
* @param session A pointer to a session
* @param ufrag The new remote username fragment
* @param pwd The new remote password
* @return TRUE if the remote credentials of the session have changed, FALS
E otherwise.
*/
MS2_PUBLIC bool_t ice_session_remote_credentials_changed(IceSession *sessio
n, const char *ufrag, const char *pwd);
/**
* Set the remote credentials of an ICE session.
*
* @param session A pointer to a session
* @param ufrag The remote username fragment
* @param pwd The remote password
*
* This function is to be called once the remote credentials have been rece
ived via SDP.
*/
MS2_PUBLIC void ice_session_set_remote_credentials(IceSession *session, con
st char *ufrag, const char *pwd);
/**
* Define the maximum number of connectivity checks that will be performed
by the agent.
*
* @param session A pointer to a session
* @param max_connectivity_checks The maximum number of connectivity checks
to perform
*
* This function is to be called just after the creation of the session, be
fore any connectivity check is performed.
* The default number of connectivity checks is 100.
*/
MS2_PUBLIC void ice_session_set_max_connectivity_checks(IceSession *session
, uint8_t max_connectivity_checks);
/**
* Define the timeout between each keepalive packet in seconds.
*
* @param session A pointer to a session
* @param timeout The duration of the keepalive timeout in seconds
*
* The default keepalive timeout is set to 15 seconds.
*/
MS2_PUBLIC void ice_session_set_keepalive_timeout(IceSession *session, uint
8_t timeout);
/**
* Get the number of check lists in an ICE session.
*
* @param session A pointer to a session
* @return The number of check lists in the ICE session
*/
MS2_PUBLIC int ice_session_nb_check_lists(IceSession *session);
/**
* Tell whether an ICE session has at least one completed check list.
*
* @param session A pointer to a session
* @return TRUE if the session has at least one completed check list, FALSE
otherwise
*/
MS2_PUBLIC bool_t ice_session_has_completed_check_list(const IceSession *se
ssion);
/**
* Add an ICE check list to an ICE session.
*
* @param session The session that is assigned the check list
* @param cl The check list to assign to the session
*/
MS2_PUBLIC void ice_session_add_check_list(IceSession *session, IceCheckLis
t *cl);
/**
* Remove an ICE check list from an ICE session.
*
* @param session The session from which to remove the check list
* @param cl The check list to remove from the session
*/
MS2_PUBLIC void ice_session_remove_check_list(IceSession *session, IceCheck
List *cl);
/**
* Tell whether ICE local candidates have been gathered for an ICE session
or not.
*
* @param session A pointer to a session
* @return TRUE if local candidates have been gathered for the session, FAL
SE otherwise.
*/
MS2_PUBLIC bool_t ice_session_candidates_gathered(const IceSession *session
);
/**
* Gather ICE local candidates for an ICE session.
*
* @param session A pointer to a session
* @param ss The STUN server address
* @param ss_len The length of the STUN server address
*/
MS2_PUBLIC void ice_session_gather_candidates(IceSession *session, struct s
ockaddr_storage ss, socklen_t ss_len);
/**
* Tell the duration of the gathering process for an ICE session in ms.
*
* @param session A pointer to a session
* @return -1 if gathering has not been run, the duration of the gathering
process in ms otherwise.
*/
MS2_PUBLIC int ice_session_gathering_duration(IceSession *session);
/**
* Tell the average round trip time during the gathering process for an ICE
session in ms.
*
* @param session A pointer to a session
* @return -1 if gathering has not been run, the average round trip time in
ms otherwise.
*/
MS2_PUBLIC int ice_session_average_gathering_round_trip_time(IceSession *se
ssion);
/**
* Select ICE candidates that will be used and notified in the SDP.
*
* @param session A pointer to a session
*
* This function is to be used by the Controlling agent when ICE processing
has finished.
*/
MS2_PUBLIC void ice_session_select_candidates(IceSession *session);
/**
* Restart an ICE session.
*
* @param session A pointer to a session
*/
MS2_PUBLIC void ice_session_restart(IceSession *session);
/**
* Get the state of an ICE check list.
*
* @param cl A pointer to a check list
* @return The check list state
*/
MS2_PUBLIC IceCheckListState ice_check_list_state(const IceCheckList *cl);
/**
* Set the state of an ICE check list.
*
* @param cl A pointer to a check list
* @param state The new state of the check list
*/
MS2_PUBLIC void ice_check_list_set_state(IceCheckList *cl, IceCheckListStat
e state);
/**
* Assign an RTP session to an ICE check list.
*
* @param cl A pointer to a check list
* @param rtp_session A pointer to the RTP session to assign to the check l
ist
*/
MS2_PUBLIC void ice_check_list_set_rtp_session(IceCheckList *cl, RtpSession
*rtp_session);
/**
* Get the local username fragment of an ICE check list.
*
* @param cl A pointer to a check list
* @return A pointer to the local username fragment of the check list
*/
MS2_PUBLIC const char * ice_check_list_local_ufrag(const IceCheckList *cl);
/**
* Get the local password of an ICE check list.
*
* @param cl A pointer to a check list
* @return A pointer to the local password of the check list
*/
MS2_PUBLIC const char * ice_check_list_local_pwd(const IceCheckList *cl);
/**
* Get the remote username fragment of an ICE check list.
*
* @param cl A pointer to a check list
* @return A pointer to the remote username fragment of the check list
*/
MS2_PUBLIC const char * ice_check_list_remote_ufrag(const IceCheckList *cl)
;
/**
* Get the remote password of an ICE check list.
*
* @param cl A pointer to a check list
* @return A pointer to the remote password of the check list
*/
MS2_PUBLIC const char * ice_check_list_remote_pwd(const IceCheckList *cl);
/**
* Get the mismatch property of an ICE check list.
*
* @param cl A pointer to a check list
* @return TRUE if there was a mismatch for the check list, FALSE otherwise
*/
MS2_PUBLIC bool_t ice_check_list_is_mismatch(const IceCheckList *cl);
/**
* Tell if remote credentials of an ICE check list have changed or not.
*
* @param cl A pointer to a check list
* @param ufrag The new remote username fragment
* @param pwd The new remote password
* @return TRUE if the remote credentials of the check list have changed, F
ALSE otherwise.
*/
MS2_PUBLIC bool_t ice_check_list_remote_credentials_changed(IceCheckList *c
l, const char *ufrag, const char *pwd);
/**
* Set the remote credentials of an ICE check list.
*
* @param cl A pointer to a check list
* @param ufrag The remote username fragment
* @param pwd The remote password
*
* This function is to be called once the remote credentials have been rece
ived via SDP.
*/
MS2_PUBLIC void ice_check_list_set_remote_credentials(IceCheckList *cl, con
st char *ufrag, const char *pwd);
/**
* Get the default local candidate for an ICE check list.
*
* @param cl A pointer to a check list
* @param rtp_addr A pointer to store the RTP address
* @param rtp_port A pointer to store the RTP port
* @param rtcp_addr A pointer to store the RTCP address
* @param rtcp_port A pointer to store the RTCP port
* @return TRUE if the information have been successfully retrieved, FALSE
otherwise
*/
MS2_PUBLIC bool_t ice_check_list_default_local_candidate(const IceCheckList
*cl, const char **rtp_addr, int *rtp_port, const char **rtcp_addr, int *rt
cp_port);
/**
* Get the selected valid local candidate for an ICE check list.
*
* @param cl A pointer to a check list
* @param rtp_addr A pointer to store the RTP address
* @param rtp_port A pointer to store the RTP port
* @param rtcp_addr A pointer to store the RTCP address
* @param rtcp_port A pointer to store the RTCP port
* @return TRUE if the information have been successfully retrieved, FALSE
otherwise
*/
MS2_PUBLIC bool_t ice_check_list_selected_valid_local_candidate(const IceCh
eckList *cl, const char **rtp_addr, int *rtp_port, const char **rtcp_addr,
int *rtcp_port);
/**
* Get the selected valid remote candidate for an ICE check list.
*
* @param cl A pointer to a check list
* @param rtp_addr A pointer to store the RTP address
* @param rtp_port A pointer to store the RTP port
* @param rtcp_addr A pointer to store the RTCP address
* @param rtcp_port A pointer to store the RTCP port
* @return TRUE if the information have been successfully retrieved, FALSE
otherwise
*/
MS2_PUBLIC bool_t ice_check_list_selected_valid_remote_candidate(const IceC
heckList *cl, const char **rtp_addr, int *rtp_port, const char **rtcp_addr,
int *rtcp_port);
/**
* Get the type of the selected valid candidate for an ICE check list.
*
* @param cl A pointer to a check list
* @return The type of the selected valid candidate
*/
MS2_PUBLIC IceCandidateType ice_check_list_selected_valid_candidate_type(co
nst IceCheckList *cl);
/**
* Check if an ICE check list can be set in the Completed state after handl
ing losing pairs.
*
* @param cl A pointer to a check list
*/
MS2_PUBLIC void ice_check_list_check_completed(IceCheckList *cl);
/**
* Get the candidate type as a string.
*
* @param candidate A pointer to a candidate
* @return A pointer to the candidate type as a string
*/
MS2_PUBLIC const char * ice_candidate_type(const IceCandidate *candidate);
/**
* Add a local candidate to an ICE check list.
*
* @param cl A pointer to a check list
* @param type The type of the local candidate to add as a string (must be
one of: "host", "srflx", "prflx" or "relay")
* @param ip The IP address of the local candidate as a string (eg. 192.168
.0.10)
* @param port The port of the local candidate
* @param componentID The component ID of the local candidate (usually 1 fo
r RTP and 2 for RTCP)
* @param base A pointer to the base candidate of the candidate to add.
*
* This function is to be called when gathering local candidates.
*/
MS2_PUBLIC IceCandidate * ice_add_local_candidate(IceCheckList *cl, const c
har *type, const char *ip, int port, uint16_t componentID, IceCandidate *ba
se);
/**
* Add a remote candidate to an ICE check list.
*
* @param cl A pointer to a check list
* @param type The type of the remote candidate to add as a string (must be
one of: "host", "srflx", "prflx" or "relay")
* @param ip The IP address of the remote candidate as a string (eg. 192.16
8.0.10)
* @param port The port of the remote candidate
* @param componentID The component ID of the remote candidate (usually 1 f
or RTP and 2 for RTCP)
* @param priority The priority of the remote candidate
* @param foundation The foundation of the remote candidate
* @param is_default Boolean value telling whether the remote candidate is
a default candidate or not
*
* This function is to be called once the remote candidate list has been re
ceived via SDP.
*/
MS2_PUBLIC IceCandidate * ice_add_remote_candidate(IceCheckList *cl, const
char *type, const char *ip, int port, uint16_t componentID, uint32_t priori
ty, const char * const foundation, bool_t is_default);
/**
* Add a losing pair to an ICE check list.
*
* @param cl A pointer to a check list
* @param componentID The component ID of the candidates of the pair to add
* @param local_addr The address of the local candidate of the pair to add
* @param local_port The port of the local candidate of the pair to add
* @param remote_addr The address of the remote candidate of the pair to ad
d
* @param remote_port The port of the remote candidate of the pair to add
*
* This function is to be called when a RE-INVITE with an SDP containing a
remote-candidates attribute is received.
*/
MS2_PUBLIC void ice_add_losing_pair(IceCheckList *cl, uint16_t componentID,
const char *local_addr, int local_port, const char *remote_addr, int remot
e_port);
/**
* Get the number of losing candidate pairs for an ICE session.
*
* @param session A pointer to a session
* @return The number of losing candidate pairs for the session.
*/
MS2_PUBLIC int ice_session_nb_losing_pairs(const IceSession *session);
/**
* Unselect the previously selected valid pairs.
*
* @param cl A pointer to a check list
*
* This function is to be used to use the pairs given by the remote control
ling agent instead of the pairs we found ourselves.
*/
MS2_PUBLIC void ice_check_list_unselect_valid_pairs(IceCheckList *cl);
/**
* Set the base for the local server reflexive candidates of an ICE session
.
*
* This function SHOULD not be used. However, it is used by mediastream for
testing purpose to
* work around the fact that it does not use candidates gathering.
* It is to be called automatically when the gathering process finishes.
*/
MS2_PUBLIC void ice_session_set_base_for_srflx_candidates(IceSession *sessi
on);
/**
* Compute the foundations of the local candidates of an ICE session.
*
* @param session A pointer to a session
*
* This function is to be called at the end of the local candidates gatheri
ng process, before sending
* the SDP to the remote agent.
*/
MS2_PUBLIC void ice_session_compute_candidates_foundations(IceSession *sess
ion);
/**
* Eliminate the redundant candidates of an ICE session.
*
* @param session A pointer to a session
*
* This function is to be called at the end of the local candidates gatheri
ng process, before sending
* the SDP to the remote agent.
*/
MS2_PUBLIC void ice_session_eliminate_redundant_candidates(IceSession *sess
ion);
/**
* Choose the default candidates of an ICE session.
*
* @param session A pointer to a session
*
* This function is to be called at the end of the local candidates gatheri
ng process, before sending
* the SDP to the remote agent.
*/
MS2_PUBLIC void ice_session_choose_default_candidates(IceSession *session);
/**
* Choose the default remote candidates of an ICE session.
*
* This function SHOULD not be used. Instead, the default remote candidates
MUST be defined as default
* when creating them with ice_add_remote_candidate().
* However, this function is used by mediastream for testing purpose.
*/
MS2_PUBLIC void ice_session_choose_default_remote_candidates(IceSession *se
ssion);
/**
* Pair the local and the remote candidates for an ICE session and start se
nding connectivity checks.
*
* @param session A pointer to a session
*/
MS2_PUBLIC void ice_session_start_connectivity_checks(IceSession *session);
/**
* Check whether all the ICE check lists of the session includes a default
candidate for each component ID in its remote candidates list.
*
* @param session A pointer to a session
*/
MS2_PUBLIC void ice_session_check_mismatch(IceSession *session);
/**
* Core ICE check list processing.
*
* This function is called from the audiostream or the videostream and is N
OT to be called by the user.
*/
void ice_check_list_process(IceCheckList* cl, RtpSession* rtp_session);
/**
* Handle a STUN packet that has been received.
*
* This function is called from the audiostream or the videostream and is N
OT to be called by the user.
*/
void ice_handle_stun_packet(IceCheckList* cl, RtpSession* rtp_session, cons
t OrtpEventData* evt_data);
/**
* Get the remote address, RTP port and RTCP port to use to send the stream
once the ICE process has finished successfully.
*
* @param cl A pointer to a check list
* @param rtp_addr A pointer to the buffer to use to store the remote RTP a
ddress
* @param rtp_port A pointer to the location to store the RTP port to
* @param rtcp_aadr A pointer to the buffer to use to store the remote RTCP
address
* @param rtcp_port A pointer to the location to store the RTCP port to
* @param addr_len The size of the buffer to use to store the remote addres
ses
*
* This function will usually be called from within the success callback de
fined while creating the ICE check list with ice_check_list_new().
*/
MS2_PUBLIC void ice_get_remote_addr_and_ports_from_valid_pairs(const IceChe
ckList *cl, char *rtp_addr, int *rtp_port, char *rtcp_addr, int *rtcp_port,
int addr_len);
/**
* Print the route used to send the stream if the ICE process has finished
successfully.
*
* @param cl A pointer to a check list
* @param message A message to print before the route
*/
MS2_PUBLIC void ice_check_list_print_route(const IceCheckList *cl, const ch
ar *message);
/**
* Dump an ICE session in the traces (debug function).
*/
MS2_PUBLIC void ice_dump_session(const IceSession *session);
/**
* Dump the candidates of an ICE check list in the traces (debug function).
*/
MS2_PUBLIC void ice_dump_candidates(const IceCheckList *cl);
/**
* Dump the candidate pairs of an ICE check list in the traces (debug funct
ion).
*/
MS2_PUBLIC void ice_dump_candidate_pairs(const IceCheckList *cl);
/**
* Dump the valid list of an ICE check list in the traces (debug function).
*/
MS2_PUBLIC void ice_dump_valid_list(const IceCheckList *cl);
/**
* Dump the list of candidate pair foundations of an ICE check list in the
traces (debug function).
*/
MS2_PUBLIC void ice_dump_candidate_pairs_foundations(const IceCheckList *cl
);
/**
* Dump the list of component IDs of an ICE check list in the traces (debug
function).
*/
MS2_PUBLIC void ice_dump_componentIDs(const IceCheckList *cl);
/**
* Dump an ICE check list in the traces (debug function).
*/
MS2_PUBLIC void ice_dump_check_list(const IceCheckList *cl);
/**
* Dump the triggered checks queue of an ICE check list in the traces (debu
g function).
*/
MS2_PUBLIC void ice_dump_triggered_checks_queue(const IceCheckList *cl);
extern MSFilterDesc ms_ice_desc; #ifdef __cplusplus
}
#endif
#endif #endif
 End of changes. 6 change blocks. 
71 lines changed or deleted 944 lines changed or added


 linphonecore.h   linphonecore.h 
skipping to change at line 40 skipping to change at line 40
#include "linphone/sipsetup.h" #include "linphone/sipsetup.h"
#endif #endif
#define LINPHONE_IPADDR_SIZE 64 #define LINPHONE_IPADDR_SIZE 64
#define LINPHONE_HOSTNAME_SIZE 128 #define LINPHONE_HOSTNAME_SIZE 128
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
struct _MSSndCard;
struct _LinphoneCore; struct _LinphoneCore;
/** /**
* Linphone core main object created by function linphone_core_new() . * Linphone core main object created by function linphone_core_new() .
* @ingroup initializing * @ingroup initializing
*/ */
typedef struct _LinphoneCore LinphoneCore; typedef struct _LinphoneCore LinphoneCore;
struct SalOp;
struct _LpConfig; struct _LpConfig;
struct _LCSipTransports{ /**
* Linphone core SIP transport ports.
* Use with #linphone_core_set_sip_transports
* @ingroup initializing
*/
typedef struct _LCSipTransports{
/**
* udp port to listening on, negative value if not set
* */
int udp_port; int udp_port;
/**
* tcp port to listening on, negative value if not set
* */
int tcp_port; int tcp_port;
/**
* dtls port to listening on, negative value if not set
* */
int dtls_port; int dtls_port;
/**
* tls port to listening on, negative value if not set
* */
int tls_port; int tls_port;
}; } LCSipTransports;
typedef struct _LCSipTransports LCSipTransports;
/** /**
* Object that represents a SIP address. * Object that represents a SIP address.
* *
* The LinphoneAddress is an opaque object to represents SIP addresses, ie * The LinphoneAddress is an opaque object to represents SIP addresses, ie
* the content of SIP's 'from' and 'to' headers. * the content of SIP's 'from' and 'to' headers.
* A SIP address is made of display name, username, domain name, port, and various * A SIP address is made of display name, username, domain name, port, and various
* uri headers (such as tags). It looks like 'Alice <sip:alice@example.net> '. * uri headers (such as tags). It looks like 'Alice <sip:alice@example.net> '.
* The LinphoneAddress has methods to extract and manipulate all parts of t he address. * The LinphoneAddress has methods to extract and manipulate all parts of t he address.
* When some part of the address (for example the username) is empty, the a ccessor methods * When some part of the address (for example the username) is empty, the a ccessor methods
skipping to change at line 142 skipping to change at line 155
LinphoneCallMissed, /**< The call was missed (unanswered)*/ LinphoneCallMissed, /**< The call was missed (unanswered)*/
LinphoneCallDeclined /**< The call was declined, either locally or b y remote end*/ LinphoneCallDeclined /**< The call was declined, either locally or b y remote end*/
} LinphoneCallStatus; } LinphoneCallStatus;
/** /**
* Structure representing a call log. * Structure representing a call log.
* *
* @ingroup call_logs * @ingroup call_logs
* *
**/ **/
typedef struct _LinphoneCallLog{ typedef struct _LinphoneCallLog LinphoneCallLog;
LinphoneCallDir dir; /**< The direction of the call*/
LinphoneCallStatus status; /**< The status of the call*/
LinphoneAddress *from; /**<Originator of the call as a LinphoneAddre
ss object*/
LinphoneAddress *to; /**<Destination of the call as a LinphoneAddres
s object*/
char start_date[128]; /**<Human readable string containg the start d
ate*/
int duration; /**<Duration of the call in seconds*/
char *refkey;
void *user_pointer;
rtp_stats_t local_stats;
rtp_stats_t remote_stats;
float quality;
struct _LinphoneCore *lc;
} LinphoneCallLog;
/**
* Enum describing type of media encryption types.
**/
enum LinphoneMediaEncryption { enum LinphoneMediaEncryption {
LinphoneMediaEncryptionNone, LinphoneMediaEncryptionNone,
LinphoneMediaEncryptionSRTP, LinphoneMediaEncryptionSRTP,
LinphoneMediaEncryptionZRTP LinphoneMediaEncryptionZRTP
}; };
/**
* Enum describing type of media encryption types.
**/
typedef enum LinphoneMediaEncryption LinphoneMediaEncryption; typedef enum LinphoneMediaEncryption LinphoneMediaEncryption;
/*public: */ /*public: */
LinphoneAddress *linphone_call_log_get_from(LinphoneCallLog *cl);
LinphoneAddress *linphone_call_log_get_to(LinphoneCallLog *cl);
LinphoneAddress *linphone_call_log_get_remote_address(LinphoneCallLog *cl);
LinphoneCallDir linphone_call_log_get_dir(LinphoneCallLog *cl);
LinphoneCallStatus linphone_call_log_get_status(LinphoneCallLog *cl);
LinphoneCallStatus linphone_call_log_video_enabled(LinphoneCallLog *cl);
time_t linphone_call_log_get_start_date(LinphoneCallLog *cl);
int linphone_call_log_get_duration(LinphoneCallLog *cl);
float linphone_call_log_get_quality(LinphoneCallLog *cl);
void linphone_call_log_set_user_pointer(LinphoneCallLog *cl, void *up); void linphone_call_log_set_user_pointer(LinphoneCallLog *cl, void *up);
void *linphone_call_log_get_user_pointer(const LinphoneCallLog *cl); void *linphone_call_log_get_user_pointer(const LinphoneCallLog *cl);
void linphone_call_log_set_ref_key(LinphoneCallLog *cl, const char *refkey) ; void linphone_call_log_set_ref_key(LinphoneCallLog *cl, const char *refkey) ;
const char *linphone_call_log_get_ref_key(const LinphoneCallLog *cl); const char *linphone_call_log_get_ref_key(const LinphoneCallLog *cl);
const rtp_stats_t *linphone_call_log_get_local_stats(const LinphoneCallLog *cl); const rtp_stats_t *linphone_call_log_get_local_stats(const LinphoneCallLog *cl);
const rtp_stats_t *linphone_call_log_get_remote_stats(const LinphoneCallLog *cl); const rtp_stats_t *linphone_call_log_get_remote_stats(const LinphoneCallLog *cl);
const char *linphone_call_log_get_call_id(const LinphoneCallLog *cl);
char * linphone_call_log_to_str(LinphoneCallLog *cl); char * linphone_call_log_to_str(LinphoneCallLog *cl);
struct _LinphoneCallParams;
/** /**
* The LinphoneCallParams is an object containing various call related para meters. * The LinphoneCallParams is an object containing various call related para meters.
* It can be used to retrieve parameters from a currently running call or m odify the call's characteristics * It can be used to retrieve parameters from a currently running call or m odify the call's characteristics
* dynamically. * dynamically.
**/ **/
struct _LinphoneCallParams;
typedef struct _LinphoneCallParams LinphoneCallParams; typedef struct _LinphoneCallParams LinphoneCallParams;
const PayloadType* linphone_call_params_get_used_audio_codec(const Linphone
CallParams *cp);
const PayloadType* linphone_call_params_get_used_video_codec(const Linphone
CallParams *cp);
LinphoneCallParams * linphone_call_params_copy(const LinphoneCallParams *cp ); LinphoneCallParams * linphone_call_params_copy(const LinphoneCallParams *cp );
void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabl ed); void linphone_call_params_enable_video(LinphoneCallParams *cp, bool_t enabl ed);
bool_t linphone_call_params_video_enabled(const LinphoneCallParams *cp); bool_t linphone_call_params_video_enabled(const LinphoneCallParams *cp);
LinphoneMediaEncryption linphone_call_params_get_media_encryption(const Lin phoneCallParams *cp); LinphoneMediaEncryption linphone_call_params_get_media_encryption(const Lin phoneCallParams *cp);
void linphone_call_params_set_media_encryption(LinphoneCallParams *cp, Linp honeMediaEncryption e); void linphone_call_params_set_media_encryption(LinphoneCallParams *cp, Linp honeMediaEncryption e);
void linphone_call_params_enable_early_media_sending(LinphoneCallParams *cp , bool_t enabled); void linphone_call_params_enable_early_media_sending(LinphoneCallParams *cp , bool_t enabled);
bool_t linphone_call_params_early_media_sending_enabled(const LinphoneCallP arams *cp); bool_t linphone_call_params_early_media_sending_enabled(const LinphoneCallP arams *cp);
bool_t linphone_call_params_local_conference_mode(const LinphoneCallParams *cp); bool_t linphone_call_params_local_conference_mode(const LinphoneCallParams *cp);
void linphone_call_params_set_audio_bandwidth_limit(LinphoneCallParams *cp, int bw); void linphone_call_params_set_audio_bandwidth_limit(LinphoneCallParams *cp, int bw);
void linphone_call_params_destroy(LinphoneCallParams *cp); void linphone_call_params_destroy(LinphoneCallParams *cp);
bool_t linphone_call_params_low_bandwidth_enabled(const LinphoneCallParams
*cp);
void linphone_call_params_enable_low_bandwidth(LinphoneCallParams *cp, bool
_t enabled);
void linphone_call_params_set_record_file(LinphoneCallParams *cp, const cha
r *path);
const char *linphone_call_params_get_record_file(const LinphoneCallParams *
cp);
void linphone_call_params_add_custom_header(LinphoneCallParams *params, con
st char *header_name, const char *header_value);
const char *linphone_call_params_get_custom_header(const LinphoneCallParams
*params, const char *header_name);
/** /**
* Enum describing failure reasons. * Enum describing failure reasons.
* @ingroup initializing * @ingroup initializing
**/ **/
enum _LinphoneReason{ enum _LinphoneReason{
LinphoneReasonNone, LinphoneReasonNone,
LinphoneReasonNoResponse, /**<No response received from remote*/ LinphoneReasonNoResponse, /**<No response received from remote*/
LinphoneReasonBadCredentials, /**<Authentication failed due to bad o r missing credentials*/ LinphoneReasonBadCredentials, /**<Authentication failed due to bad o r missing credentials*/
LinphoneReasonDeclined, /**<The call has been declined*/ LinphoneReasonDeclined, /**<The call has been declined*/
LinphoneReasonNotFound, LinphoneReasonNotFound, /**<Destination of the calls was not found.*
/
LinphoneReasonNotAnswered, /**<The call was not answered in time*/
LinphoneReasonBusy /**<Phone line was busy */
}; };
/**
* Enum describing failure reasons.
* @ingroup initializing
**/
typedef enum _LinphoneReason LinphoneReason; typedef enum _LinphoneReason LinphoneReason;
const char *linphone_reason_to_string(LinphoneReason err); const char *linphone_reason_to_string(LinphoneReason err);
/** /**
* Structure describing policy regarding video streams establishments.
* @ingroup media_parameters
**/
struct _LinphoneVideoPolicy{
bool_t automatically_initiate; /**<Whether video shall be automatica
lly proposed for outgoing calls.*/
bool_t automatically_accept; /**<Whether video shall be automaticall
y accepted for incoming calls*/
bool_t unused[2];
};
/**
* Structure describing policy regarding video streams establishments.
* @ingroup media_parameters
**/
typedef struct _LinphoneVideoPolicy LinphoneVideoPolicy;
/**
* The LinphoneCall object represents a call issued or received by the Linp honeCore * The LinphoneCall object represents a call issued or received by the Linp honeCore
* @ingroup call_control
**/ **/
struct _LinphoneCall; struct _LinphoneCall;
/**
* The LinphoneCall object represents a call issued or received by the Linp
honeCore
* @ingroup call_control
**/
typedef struct _LinphoneCall LinphoneCall; typedef struct _LinphoneCall LinphoneCall;
/** /**
* @addtogroup call_misc
* @{
**/
#define LINPHONE_CALL_STATS_AUDIO 0
#define LINPHONE_CALL_STATS_VIDEO 1
/**
* Enum describing ICE states.
* @ingroup initializing
**/
enum _LinphoneIceState{
LinphoneIceStateNotActivated, /**< ICE has not been activated for th
is call */
LinphoneIceStateFailed, /**< ICE processing has failed */
LinphoneIceStateInProgress, /**< ICE process is in progress */
LinphoneIceStateHostConnection, /**< ICE has established a direct co
nnection to the remote host */
LinphoneIceStateReflexiveConnection, /**< ICE has established a conn
ection to the remote host through one or several NATs */
LinphoneIceStateRelayConnection /**< ICE has established a connectio
n through a relay */
};
/**
* Enum describing Ice states.
* @ingroup initializing
**/
typedef enum _LinphoneIceState LinphoneIceState;
/**
* Enum describing uPnP states.
* @ingroup initializing
**/
enum _LinphoneUpnpState{
LinphoneUpnpStateIdle, /**< uPnP is not activate */
LinphoneUpnpStatePending, /**< uPnP process is in progress */
LinphoneUpnpStateAdding, /**< Internal use: Only used by port bind
ing */
LinphoneUpnpStateRemoving, /**< Internal use: Only used by port bind
ing */
LinphoneUpnpStateNotAvailable, /**< uPnP is not available */
LinphoneUpnpStateOk, /**< uPnP is enabled */
LinphoneUpnpStateKo, /**< uPnP processing has failed */
};
/**
* Enum describing uPnP states.
* @ingroup initializing
**/
typedef enum _LinphoneUpnpState LinphoneUpnpState;
/**
* The LinphoneCallStats objects carries various statistic informations reg
arding quality of audio or video streams.
*
* To receive these informations periodically and as soon as they are compu
ted, the application is invited to place a #CallStatsUpdated callback in th
e LinphoneCoreVTable structure
* it passes for instanciating the LinphoneCore object (see linphone_core_n
ew() ).
*
* At any time, the application can access last computed statistics using l
inphone_call_get_audio_stats() or linphone_call_get_video_stats().
**/
typedef struct _LinphoneCallStats LinphoneCallStats;
/**
* The LinphoneCallStats objects carries various statistic informations reg
arding quality of audio or video streams.
*
* To receive these informations periodically and as soon as they are compu
ted, the application is invited to place a #CallStatsUpdated callback in th
e LinphoneCoreVTable structure
* it passes for instanciating the LinphoneCore object (see linphone_core_n
ew() ).
*
* At any time, the application can access last computed statistics using l
inphone_call_get_audio_stats() or linphone_call_get_video_stats().
**/
struct _LinphoneCallStats {
int type; /**< Can be either LINPHONE_CALL_STATS_AUDIO o
r LINPHONE_CALL_STATS_VIDEO*/
jitter_stats_t jitter_stats; /**<jitter buffer statistics, see oRTP
documentation for details */
mblk_t* received_rtcp; /**<Last RTCP packet received, as a m
blk_t structure. See oRTP documentation for details how to extract informat
ion from it*/
mblk_t* sent_rtcp;/**<Last RTCP packet sent, as a mblk_t str
ucture. See oRTP documentation for details how to extract information from
it*/
float round_trip_delay; /**<Round trip propagation time in
seconds if known, -1 if unknown.*/
LinphoneIceState ice_state; /**< State of ICE processing. */
LinphoneUpnpState upnp_state; /**< State of uPnP processing. *
/
float download_bandwidth; /**<Download bandwidth measurement of rece
ived stream, expressed in kbit/s, including IP/UDP/RTP headers*/
float upload_bandwidth; /**<Download bandwidth measurement of sent s
tream, expressed in kbit/s, including IP/UDP/RTP headers*/
float local_late_rate; /**<percentage of packet received too late ov
er last second*/
float local_loss_rate; /**<percentage of lost packet over last secon
d*/
};
/**
* @}
**/
const LinphoneCallStats *linphone_call_get_audio_stats(LinphoneCall *call);
const LinphoneCallStats *linphone_call_get_video_stats(LinphoneCall *call);
/** Callback prototype */
typedef void (*LinphoneCallCbFunc)(struct _LinphoneCall *call,void * user_d
ata);
/**
* LinphoneCallState enum represents the different state a call can reach i nto. * LinphoneCallState enum represents the different state a call can reach i nto.
* The application is notified of state changes through the LinphoneCoreVTa ble::call_state_changed callback. * The application is notified of state changes through the LinphoneCoreVTa ble::call_state_changed callback.
* @ingroup call_control * @ingroup call_control
**/ **/
typedef enum _LinphoneCallState{ typedef enum _LinphoneCallState{
LinphoneCallIdle, /**<Initial call state */ LinphoneCallIdle, /**<Initial call state */
LinphoneCallIncomingReceived, /**<This is a new incoming call */ LinphoneCallIncomingReceived, /**<This is a new incoming call */
LinphoneCallOutgoingInit, /**<An outgoing call is started */ LinphoneCallOutgoingInit, /**<An outgoing call is started */
LinphoneCallOutgoingProgress, /**<An outgoing call is in progress */ LinphoneCallOutgoingProgress, /**<An outgoing call is in progress */
LinphoneCallOutgoingRinging, /**<An outgoing call is ringing at remo te end */ LinphoneCallOutgoingRinging, /**<An outgoing call is ringing at remo te end */
LinphoneCallOutgoingEarlyMedia, /**<An outgoing call is proposed ear ly media */ LinphoneCallOutgoingEarlyMedia, /**<An outgoing call is proposed ear ly media */
LinphoneCallConnected, /**<Connected, the call is answered */ LinphoneCallConnected, /**<Connected, the call is answered */
LinphoneCallStreamsRunning, /**<The media streams are established an d running*/ LinphoneCallStreamsRunning, /**<The media streams are established an d running*/
LinphoneCallPausing, /**<The call is pausing at the initiative of lo cal end */ LinphoneCallPausing, /**<The call is pausing at the initiative of lo cal end */
LinphoneCallPaused, /**< The call is paused, remote end has accepted the pause */ LinphoneCallPaused, /**< The call is paused, remote end has accepted the pause */
LinphoneCallResuming, /**<The call is being resumed by local end*/ LinphoneCallResuming, /**<The call is being resumed by local end*/
LinphoneCallRefered, /**<The call is being transfered to another par ty, resulting in a new outgoing call to follow immediately*/ LinphoneCallRefered, /**<The call is being transfered to another par ty, resulting in a new outgoing call to follow immediately*/
LinphoneCallError, /**<The call encountered an error*/ LinphoneCallError, /**<The call encountered an error*/
LinphoneCallEnd, /**<The call ended normally*/ LinphoneCallEnd, /**<The call ended normally*/
LinphoneCallPausedByRemote, /**<The call is paused by remote end*/ LinphoneCallPausedByRemote, /**<The call is paused by remote end*/
LinphoneCallUpdatedByRemote, /**<The call's parameters are updated, used for example when video is asked by remote */ LinphoneCallUpdatedByRemote, /**<The call's parameters change is req uested by remote end, used for example when video is added by remote */
LinphoneCallIncomingEarlyMedia, /**<We are proposing early media to an incoming call */ LinphoneCallIncomingEarlyMedia, /**<We are proposing early media to an incoming call */
LinphoneCallUpdated, /**<The remote accepted the call update initiat ed by us */ LinphoneCallUpdating, /**<A call update has been initiated by us */
LinphoneCallReleased /**< The call object is no more retained by the core */ LinphoneCallReleased /**< The call object is no more retained by the core */
} LinphoneCallState; } LinphoneCallState;
const char *linphone_call_state_to_string(LinphoneCallState cs); const char *linphone_call_state_to_string(LinphoneCallState cs);
LinphoneCore *linphone_call_get_core(const LinphoneCall *call); LinphoneCore *linphone_call_get_core(const LinphoneCall *call);
LinphoneCallState linphone_call_get_state(const LinphoneCall *call); LinphoneCallState linphone_call_get_state(const LinphoneCall *call);
bool_t linphone_call_asked_to_autoanswer(LinphoneCall *call); bool_t linphone_call_asked_to_autoanswer(LinphoneCall *call);
const LinphoneAddress * linphone_core_get_current_call_remote_address(struc t _LinphoneCore *lc); const LinphoneAddress * linphone_core_get_current_call_remote_address(struc t _LinphoneCore *lc);
const LinphoneAddress * linphone_call_get_remote_address(const LinphoneCall *call); const LinphoneAddress * linphone_call_get_remote_address(const LinphoneCall *call);
char *linphone_call_get_remote_address_as_string(const LinphoneCall *call); char *linphone_call_get_remote_address_as_string(const LinphoneCall *call);
LinphoneCallDir linphone_call_get_dir(const LinphoneCall *call); LinphoneCallDir linphone_call_get_dir(const LinphoneCall *call);
LinphoneCall * linphone_call_ref(LinphoneCall *call); LinphoneCall * linphone_call_ref(LinphoneCall *call);
void linphone_call_unref(LinphoneCall *call); void linphone_call_unref(LinphoneCall *call);
LinphoneCallLog *linphone_call_get_call_log(const LinphoneCall *call); LinphoneCallLog *linphone_call_get_call_log(const LinphoneCall *call);
const char *linphone_call_get_refer_to(const LinphoneCall *call); const char *linphone_call_get_refer_to(const LinphoneCall *call);
bool_t linphone_call_has_transfer_pending(const LinphoneCall *call); bool_t linphone_call_has_transfer_pending(const LinphoneCall *call);
LinphoneCall *linphone_call_get_replaced_call(LinphoneCall *call); LinphoneCall *linphone_call_get_replaced_call(LinphoneCall *call);
int linphone_call_get_duration(const LinphoneCall *call); int linphone_call_get_duration(const LinphoneCall *call);
const LinphoneCallParams * linphone_call_get_current_params(const LinphoneC const LinphoneCallParams * linphone_call_get_current_params(LinphoneCall *c
all *call); all);
const LinphoneCallParams * linphone_call_get_remote_params(LinphoneCall *ca
ll);
void linphone_call_enable_camera(LinphoneCall *lc, bool_t enabled); void linphone_call_enable_camera(LinphoneCall *lc, bool_t enabled);
bool_t linphone_call_camera_enabled(const LinphoneCall *lc); bool_t linphone_call_camera_enabled(const LinphoneCall *lc);
int linphone_call_take_video_snapshot(LinphoneCall *call, const char *file) ; int linphone_call_take_video_snapshot(LinphoneCall *call, const char *file) ;
LinphoneReason linphone_call_get_reason(const LinphoneCall *call); LinphoneReason linphone_call_get_reason(const LinphoneCall *call);
const char *linphone_call_get_remote_user_agent(LinphoneCall *call); const char *linphone_call_get_remote_user_agent(LinphoneCall *call);
const char *linphone_call_get_remote_contact(LinphoneCall *call);
float linphone_call_get_play_volume(LinphoneCall *call); float linphone_call_get_play_volume(LinphoneCall *call);
float linphone_call_get_record_volume(LinphoneCall *call); float linphone_call_get_record_volume(LinphoneCall *call);
float linphone_call_get_current_quality(LinphoneCall *call); float linphone_call_get_current_quality(LinphoneCall *call);
float linphone_call_get_average_quality(LinphoneCall *call); float linphone_call_get_average_quality(LinphoneCall *call);
const char* linphone_call_get_authentication_token(LinphoneCall *call); const char* linphone_call_get_authentication_token(LinphoneCall *call);
bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call); bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call);
void linphone_call_set_authentication_token_verified(LinphoneCall *call, bo ol_t verified); void linphone_call_set_authentication_token_verified(LinphoneCall *call, bo ol_t verified);
void linphone_call_send_vfu_request(LinphoneCall *call); void linphone_call_send_vfu_request(LinphoneCall *call);
void *linphone_call_get_user_pointer(LinphoneCall *call); void *linphone_call_get_user_pointer(LinphoneCall *call);
void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer) ; void linphone_call_set_user_pointer(LinphoneCall *call, void *user_pointer) ;
void linphone_call_set_next_video_frame_decoded_callback(LinphoneCall *call
, LinphoneCallCbFunc cb, void* user_data);
LinphoneCallState linphone_call_get_transfer_state(LinphoneCall *call);
void linphone_call_zoom_video(LinphoneCall* call, float zoom_factor, float*
cx, float* cy);
void linphone_call_start_recording(LinphoneCall *call);
void linphone_call_stop_recording(LinphoneCall *call);
/**
* Return TRUE if this call is currently part of a conference
*@param call #LinphoneCall
*@return TRUE if part of a conference.
*
@ingroup call_control
*/
bool_t linphone_call_is_in_conference(const LinphoneCall *call);
/** /**
* Enables or disable echo cancellation for this call * Enables or disable echo cancellation for this call
* @param call * @param call
* @param val * @param val
* *
* @ingroup media_parameters * @ingroup media_parameters
**/ **/
void linphone_call_enable_echo_cancellation(LinphoneCall *call, bool_t val) ; void linphone_call_enable_echo_cancellation(LinphoneCall *call, bool_t val) ;
/** /**
* Returns TRUE if echo cancellation is enabled. * Returns TRUE if echo cancellation is enabled.
skipping to change at line 304 skipping to change at line 459
**/ **/
void linphone_call_enable_echo_limiter(LinphoneCall *call, bool_t val); void linphone_call_enable_echo_limiter(LinphoneCall *call, bool_t val);
/** /**
* Returns TRUE if echo limiter is enabled. * Returns TRUE if echo limiter is enabled.
* *
* @ingroup media_parameters * @ingroup media_parameters
**/ **/
bool_t linphone_call_echo_limiter_enabled(const LinphoneCall *call); bool_t linphone_call_echo_limiter_enabled(const LinphoneCall *call);
/*keep this in sync with mediastreamer2/msvolume.h*/ /*keep this in sync with mediastreamer2/msvolume.h*/
#define LINPHONE_VOLUME_DB_LOWEST (-120) /**< Lowest measured that can be r
eturned.*/ /**
* Lowest volume measurement that can be returned by linphone_call_get_play
_volume() or linphone_call_get_record_volume(), corresponding to pure silen
ce.
* @ingroup call_misc
**/
#define LINPHONE_VOLUME_DB_LOWEST (-120)
/** /**
* @addtogroup proxies * @addtogroup proxies
* @{ * @{
**/ **/
/** /**
* The LinphoneProxyConfig object represents a proxy configuration to be us ed * The LinphoneProxyConfig object represents a proxy configuration to be us ed
* by the LinphoneCore object. * by the LinphoneCore object.
* Its fields must not be used directly in favour of the accessors methods. * Its fields must not be used directly in favour of the accessors methods.
* Once created and filled properly the LinphoneProxyConfig can be given to * Once created and filled properly the LinphoneProxyConfig can be given to
skipping to change at line 382 skipping to change at line 542
bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj); bool_t linphone_proxy_config_is_registered(const LinphoneProxyConfig *obj);
const char *linphone_proxy_config_get_domain(const LinphoneProxyConfig *cfg ); const char *linphone_proxy_config_get_domain(const LinphoneProxyConfig *cfg );
const char *linphone_proxy_config_get_route(const LinphoneProxyConfig *obj) ; const char *linphone_proxy_config_get_route(const LinphoneProxyConfig *obj) ;
const char *linphone_proxy_config_get_identity(const LinphoneProxyConfig *o bj); const char *linphone_proxy_config_get_identity(const LinphoneProxyConfig *o bj);
bool_t linphone_proxy_config_publish_enabled(const LinphoneProxyConfig *obj ); bool_t linphone_proxy_config_publish_enabled(const LinphoneProxyConfig *obj );
const char *linphone_proxy_config_get_addr(const LinphoneProxyConfig *obj); const char *linphone_proxy_config_get_addr(const LinphoneProxyConfig *obj);
int linphone_proxy_config_get_expires(const LinphoneProxyConfig *obj); int linphone_proxy_config_get_expires(const LinphoneProxyConfig *obj);
bool_t linphone_proxy_config_register_enabled(const LinphoneProxyConfig *ob j); bool_t linphone_proxy_config_register_enabled(const LinphoneProxyConfig *ob j);
void linphone_proxy_config_refresh_register(LinphoneProxyConfig *obj); void linphone_proxy_config_refresh_register(LinphoneProxyConfig *obj);
const char *linphone_proxy_config_get_contact_parameters(const LinphoneProx
yConfig *obj);
void linphone_proxy_config_set_contact_parameters(LinphoneProxyConfig *obj,
const char *contact_params);
struct _LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyCo nfig *obj); struct _LinphoneCore * linphone_proxy_config_get_core(const LinphoneProxyCo nfig *obj);
bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg); bool_t linphone_proxy_config_get_dial_escape_plus(const LinphoneProxyConfig *cfg);
const char * linphone_proxy_config_get_dial_prefix(const LinphoneProxyConfi g *cfg); const char * linphone_proxy_config_get_dial_prefix(const LinphoneProxyConfi g *cfg);
LinphoneReason linphone_proxy_config_get_error(const LinphoneProxyConfig *c fg); LinphoneReason linphone_proxy_config_get_error(const LinphoneProxyConfig *c fg);
/* destruction is called automatically when removing the proxy config */ /* destruction is called automatically when removing the proxy config */
void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg); void linphone_proxy_config_destroy(LinphoneProxyConfig *cfg);
void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const ch ar *type); void linphone_proxy_config_set_sip_setup(LinphoneProxyConfig *cfg, const ch ar *type);
skipping to change at line 470 skipping to change at line 632
* transactions and retry them with authentication headers. * transactions and retry them with authentication headers.
* *
**/ **/
typedef struct _LinphoneAuthInfo LinphoneAuthInfo; typedef struct _LinphoneAuthInfo LinphoneAuthInfo;
LinphoneAuthInfo *linphone_auth_info_new(const char *username, const char * userid, LinphoneAuthInfo *linphone_auth_info_new(const char *username, const char * userid,
const char *passwd, const char *ha1,const char *realm); const char *passwd, const char *ha1,const char *realm);
void linphone_auth_info_set_passwd(LinphoneAuthInfo *info, const char *pass wd); void linphone_auth_info_set_passwd(LinphoneAuthInfo *info, const char *pass wd);
void linphone_auth_info_set_username(LinphoneAuthInfo *info, const char *us ername); void linphone_auth_info_set_username(LinphoneAuthInfo *info, const char *us ername);
void linphone_auth_info_set_userid(LinphoneAuthInfo *info, const char *user id); void linphone_auth_info_set_userid(LinphoneAuthInfo *info, const char *user id);
void linphone_auth_info_set_realm(LinphoneAuthInfo *info, const char *realm
);
void linphone_auth_info_set_ha1(LinphoneAuthInfo *info, const char *ha1);
const char *linphone_auth_info_get_username(const LinphoneAuthInfo *i); const char *linphone_auth_info_get_username(const LinphoneAuthInfo *i);
const char *linphone_auth_info_get_passwd(const LinphoneAuthInfo *i); const char *linphone_auth_info_get_passwd(const LinphoneAuthInfo *i);
const char *linphone_auth_info_get_userid(const LinphoneAuthInfo *i); const char *linphone_auth_info_get_userid(const LinphoneAuthInfo *i);
const char *linphone_auth_info_get_realm(const LinphoneAuthInfo *i);
const char *linphone_auth_info_get_ha1(const LinphoneAuthInfo *i);
/* you don't need those function*/ /* you don't need those function*/
void linphone_auth_info_destroy(LinphoneAuthInfo *info); void linphone_auth_info_destroy(LinphoneAuthInfo *info);
LinphoneAuthInfo * linphone_auth_info_new_from_config_file(struct _LpConfig *config, int pos); LinphoneAuthInfo * linphone_auth_info_new_from_config_file(struct _LpConfig *config, int pos);
struct _LinphoneChatRoom; struct _LinphoneChatRoom;
/** /**
* @addtogroup chatroom * @addtogroup chatroom
* @{ * @{
*/ */
/**
* A chat room message to old content to be sent.
* <br> Can be created by linphone_chat_room_create_message().
*/
typedef struct _LinphoneChatMessage LinphoneChatMessage;
/** /**
* A chat room is the place where text messages are exchanged. * A chat room is the place where text messages are exchanged.
* <br> Can be created by linphone_core_create_chat_room(). * <br> Can be created by linphone_core_create_chat_room().
*/ */
typedef struct _LinphoneChatRoom LinphoneChatRoom; typedef struct _LinphoneChatRoom LinphoneChatRoom;
/** /**
* Create a new chat room for messaging from a sip uri like sip:joe@sip.lin *LinphoneChatMessageState is used to notify if messages have been succesfu
phone.org lly delivered or not.
* @param lc #LinphoneCore object
* @param to destination address for messages
* @return #LinphoneChatRoom where messaging can take place.
*/
LinphoneChatRoom * linphone_core_create_chat_room(LinphoneCore *lc, const c
har *to);
/**
* Destructor
* @param cr #LinphoneChatRoom object
*/ */
void linphone_chat_room_destroy(LinphoneChatRoom *cr); typedef enum _LinphoneChatMessageStates {
LinphoneChatMessageStateIdle, /**<initial state*/
LinphoneChatMessageStateInProgress, /**<delivery in progress**/
LinphoneChatMessageStateDelivered, /**<message succesffully delivere
d an acknoleged by remote end point*/
LinphoneChatMessageStateNotDelivered /**<message was not delivered*/
}LinphoneChatMessageState;
/** /**
* get peer address \link linphone_core_create_chat_room() associated to \e * Call back used to notify message delivery status
ndlink this #LinphoneChatRoom *@param msg #LinphoneChatMessage object
* @param cr #LinphoneChatRoom object *@param status LinphoneChatMessageState
* @return #LinphoneAddress peer address *@param ud application user data
*/ */
typedef void (*LinphoneChatMessageStateChangeCb)(LinphoneChatMessage* msg,L
inphoneChatMessageState state,void* ud);
void linphone_core_set_chat_database_path(LinphoneCore *lc, const char *pat
h);
LinphoneChatRoom * linphone_core_create_chat_room(LinphoneCore *lc, const c
har *to);
LinphoneChatRoom *linphone_core_get_chat_room(LinphoneCore *lc, const Linph
oneAddress *addr);
void linphone_chat_room_destroy(LinphoneChatRoom *cr);
LinphoneChatMessage* linphone_chat_room_create_message(LinphoneChatRoom *cr
,const char* message);
const LinphoneAddress* linphone_chat_room_get_peer_address(LinphoneChatRoom *cr); const LinphoneAddress* linphone_chat_room_get_peer_address(LinphoneChatRoom *cr);
/**
* send a message to peer member of this chat room.
* @param cr #LinphoneChatRoom object
* @param msg message to be sent
*/
void linphone_chat_room_send_message(LinphoneChatRoom *cr, const char *msg) ; void linphone_chat_room_send_message(LinphoneChatRoom *cr, const char *msg) ;
void linphone_chat_room_send_message2(LinphoneChatRoom *cr, LinphoneChatMes
sage* msg,LinphoneChatMessageStateChangeCb status_cb,void* ud);
MSList *linphone_chat_room_get_history(LinphoneChatRoom *cr,int nb_message)
;
void linphone_chat_room_mark_as_read(LinphoneChatRoom *cr);
void linphone_chat_room_delete_history(LinphoneChatRoom *cr);
int linphone_chat_room_get_unread_messages_count(LinphoneChatRoom *cr);
LinphoneCore* linphone_chat_room_get_lc(LinphoneChatRoom *cr);
void linphone_chat_room_set_user_data(LinphoneChatRoom *cr, void * ud); void linphone_chat_room_set_user_data(LinphoneChatRoom *cr, void * ud);
void * linphone_chat_room_get_user_data(LinphoneChatRoom *cr); void * linphone_chat_room_get_user_data(LinphoneChatRoom *cr);
LinphoneChatMessageState linphone_chat_message_get_state(const LinphoneChat
Message* message);
const char* linphone_chat_message_state_to_string(const LinphoneChatMessage
State state);
LinphoneChatMessage* linphone_chat_message_clone(const LinphoneChatMessage*
message);
void linphone_chat_message_destroy(LinphoneChatMessage* msg);
void linphone_chat_message_set_from(LinphoneChatMessage* message, const Lin
phoneAddress* from);
const LinphoneAddress* linphone_chat_message_get_from(const LinphoneChatMes
sage* message);
const LinphoneAddress* linphone_chat_message_get_to(const LinphoneChatMessa
ge* message);
const char* linphone_chat_message_get_external_body_url(const LinphoneChatM
essage* message);
void linphone_chat_message_set_external_body_url(LinphoneChatMessage* messa
ge,const char* url);
const char * linphone_chat_message_get_text(const LinphoneChatMessage* mess
age);
time_t linphone_chat_message_get_time(const LinphoneChatMessage* message);
void* linphone_chat_message_get_user_data(const LinphoneChatMessage* messag
e);
void linphone_chat_message_set_user_data(LinphoneChatMessage* message,void*
);
LinphoneChatRoom* linphone_chat_message_get_chat_room(LinphoneChatMessage *
msg);
const LinphoneAddress* linphone_chat_message_get_peer_address(LinphoneChatM
essage *msg);
LinphoneAddress *linphone_chat_message_get_local_address(const LinphoneChat
Message* message);
void linphone_chat_message_add_custom_header(LinphoneChatMessage* message,
const char *header_name, const char *header_value);
const char * linphone_chat_message_get_custom_header(LinphoneChatMessage* m
essage, const char *header_name);
/** /**
* @} * @}
*/ */
/** /**
* @addtogroup initializing * @addtogroup initializing
* @{ * @{
**/ **/
/** /**
skipping to change at line 584 skipping to change at line 782
* @param url of the subscriber * @param url of the subscriber
* Callback prototype * Callback prototype
* */ * */
typedef void (*NewSubscribtionRequestCb)(struct _LinphoneCore *lc, Linphone Friend *lf, const char *url); typedef void (*NewSubscribtionRequestCb)(struct _LinphoneCore *lc, Linphone Friend *lf, const char *url);
/** Callback prototype */ /** Callback prototype */
typedef void (*AuthInfoRequested)(struct _LinphoneCore *lc, const char *rea lm, const char *username); typedef void (*AuthInfoRequested)(struct _LinphoneCore *lc, const char *rea lm, const char *username);
/** Callback prototype */ /** Callback prototype */
typedef void (*CallLogUpdated)(struct _LinphoneCore *lc, struct _LinphoneCa llLog *newcl); typedef void (*CallLogUpdated)(struct _LinphoneCore *lc, struct _LinphoneCa llLog *newcl);
/** /**
* Callback prototype * Callback prototype
* @deprecated use #MessageReceived instead.
* *
* @param lc #LinphoneCore object * @param lc #LinphoneCore object
* @param room #LinphoneChatRoom involved in this conversation. Can be be c reated by the framework in case \link #LinphoneAddress the from \endlink is not present in any chat room. * @param room #LinphoneChatRoom involved in this conversation. Can be be c reated by the framework in case \link #LinphoneAddress the from \endlink is not present in any chat room.
* @param from #LinphoneAddress from * @param from #LinphoneAddress from
* @param message incoming message * @param message incoming message
* */ * */
typedef void (*TextMessageReceived)(LinphoneCore *lc, LinphoneChatRoom *roo m, const LinphoneAddress *from, const char *message); typedef void (*TextMessageReceived)(LinphoneCore *lc, LinphoneChatRoom *roo m, const LinphoneAddress *from, const char *message);
/**
* Chat message callback prototype
*
* @param lc #LinphoneCore object
* @param room #LinphoneChatRoom involved in this conversation. Can be be c
reated by the framework in case \link #LinphoneAddress the from \endlink is
not present in any chat room.
* @param LinphoneChatMessage incoming message
* */
typedef void (*MessageReceived)(LinphoneCore *lc, LinphoneChatRoom *room, L
inphoneChatMessage *message);
/** Callback prototype */ /** Callback prototype */
typedef void (*DtmfReceived)(struct _LinphoneCore* lc, LinphoneCall *call, int dtmf); typedef void (*DtmfReceived)(struct _LinphoneCore* lc, LinphoneCall *call, int dtmf);
/** Callback prototype */ /** Callback prototype */
typedef void (*ReferReceived)(struct _LinphoneCore *lc, const char *refer_t o); typedef void (*ReferReceived)(struct _LinphoneCore *lc, const char *refer_t o);
/** Callback prototype */ /** Callback prototype */
typedef void (*BuddyInfoUpdated)(struct _LinphoneCore *lc, LinphoneFriend * lf); typedef void (*BuddyInfoUpdated)(struct _LinphoneCore *lc, LinphoneFriend * lf);
/** Callback prototype for in progress transfers. The new_call_state is the
state of the call resulting of the transfer, at the other party. */
typedef void (*LinphoneTransferStateChanged)(struct _LinphoneCore *lc, Linp
honeCall *transfered, LinphoneCallState new_call_state);
/** Callback prototype for receiving quality statistics for calls*/
typedef void (*CallStatsUpdated)(struct _LinphoneCore *lc, LinphoneCall *ca
ll, const LinphoneCallStats *stats);
/** /**
* This structure holds all callbacks that the application should implement . * This structure holds all callbacks that the application should implement .
* None is mandatory. * None is mandatory.
**/ **/
typedef struct _LinphoneVTable{ typedef struct _LinphoneVTable{
LinphoneGlobalStateCb global_state_changed; /**<Notifies globlal sta te changes*/ LinphoneGlobalStateCb global_state_changed; /**<Notifies globlal sta te changes*/
LinphoneRegistrationStateCb registration_state_changed;/**<Notifies registration state changes*/ LinphoneRegistrationStateCb registration_state_changed;/**<Notifies registration state changes*/
LinphoneCallStateCb call_state_changed;/**<Notifies call state chang es*/ LinphoneCallStateCb call_state_changed;/**<Notifies call state chang es*/
NotifyPresenceReceivedCb notify_presence_recv; /**< Notify received presence events*/ NotifyPresenceReceivedCb notify_presence_recv; /**< Notify received presence events*/
NewSubscribtionRequestCb new_subscription_request; /**< Notify about pending subscription request */ NewSubscribtionRequestCb new_subscription_request; /**< Notify about pending subscription request */
AuthInfoRequested auth_info_requested; /**< Ask the application some authentication information */ AuthInfoRequested auth_info_requested; /**< Ask the application some authentication information */
CallLogUpdated call_log_updated; /**< Notifies that call log list ha s been updated */ CallLogUpdated call_log_updated; /**< Notifies that call log list ha s been updated */
TextMessageReceived text_received; /**< A text message has been rece TextMessageReceived text_received; /** @deprecated, use #message_rec
ived */ eived instead <br> A text message has been received */
MessageReceived message_received; /** a message is received, can be
text or external body*/
DtmfReceived dtmf_received; /**< A dtmf has been received received * / DtmfReceived dtmf_received; /**< A dtmf has been received received * /
ReferReceived refer_received; /**< An out of call refer was received */ ReferReceived refer_received; /**< An out of call refer was received */
CallEncryptionChangedCb call_encryption_changed; /**<Notifies on cha
nge in the encryption of call streams */
LinphoneTransferStateChanged transfer_state_changed; /**<Notifies wh
en a transfer is in progress */
BuddyInfoUpdated buddy_info_updated; /**< a LinphoneFriend's BuddyIn fo has changed*/ BuddyInfoUpdated buddy_info_updated; /**< a LinphoneFriend's BuddyIn fo has changed*/
NotifyReceivedCb notify_recv; /**< Other notifications*/ NotifyReceivedCb notify_recv; /**< Other notifications*/
DisplayStatusCb display_status; /**< Callback that notifies various CallStatsUpdated call_stats_updated; /**<Notifies on refreshing of c
events with human readable text.*/ all's statistics. */
DisplayMessageCb display_message;/**< Callback to display a message DisplayStatusCb display_status; /**< DEPRECATED Callback that notifi
to the user */ es various events with human readable text.*/
DisplayMessageCb display_warning;/** Callback to display a warning t DisplayMessageCb display_message;/**< DEPRECATED Callback to display
o the user */ a message to the user */
DisplayUrlCb display_url; DisplayMessageCb display_warning;/**< DEPRECATED Callback to display
ShowInterfaceCb show; /**< Notifies the application that it should s a warning to the user */
how up*/ DisplayUrlCb display_url; /**< DEPRECATED */
CallEncryptionChangedCb call_encryption_changed; /**<Notifies on cha ShowInterfaceCb show; /**< DEPRECATED Notifies the application that
nge in the encryption of call streams */ it should show up*/
} LinphoneCoreVTable; } LinphoneCoreVTable;
/** /**
* @} * @}
**/ **/
typedef struct _LCCallbackObj typedef struct _LCCallbackObj
{ {
LinphoneCoreCbFunc _func; LinphoneCoreCbFunc _func;
void * _user_data; void * _user_data;
}LCCallbackObj; }LCCallbackObj;
typedef enum _LinphoneFirewallPolicy{ typedef enum _LinphoneFirewallPolicy{
LinphonePolicyNoFirewall, LinphonePolicyNoFirewall,
LinphonePolicyUseNatAddress, LinphonePolicyUseNatAddress,
LinphonePolicyUseStun LinphonePolicyUseStun,
LinphonePolicyUseIce,
LinphonePolicyUseUpnp,
} LinphoneFirewallPolicy; } LinphoneFirewallPolicy;
typedef enum _LinphoneWaitingState{ typedef enum _LinphoneWaitingState{
LinphoneWaitingStart, LinphoneWaitingStart,
LinphoneWaitingProgress, LinphoneWaitingProgress,
LinphoneWaitingFinished LinphoneWaitingFinished
} LinphoneWaitingState; } LinphoneWaitingState;
typedef void * (*LinphoneWaitingCallback)(struct _LinphoneCore *lc, void *c ontext, LinphoneWaitingState ws, const char *purpose, float progress); typedef void * (*LinphoneWaitingCallback)(struct _LinphoneCore *lc, void *c ontext, LinphoneWaitingState ws, const char *purpose, float progress);
/* THE main API */ /* THE main API */
/**
* Define a log handler.
*
* @ingroup misc
*
* @param logfunc The function pointer of the log handler.
*/
void linphone_core_set_log_handler(OrtpLogFunc logfunc);
/**
* Define a log file.
*
* @ingroup misc
*
* If the file pointer passed as an argument is NULL, stdout is used instea
d.
*
* @param file A pointer to the FILE structure of the file to write to.
*/
void linphone_core_set_log_file(FILE *file);
/**
* Define the log level.
*
* @ingroup misc
*
* The loglevel parameter is a bitmask parameter. Therefore to enable only
warning and error
* messages, use ORTP_WARNING | ORTP_ERROR. To disable logs, simply set log
level to 0.
*
* @param loglevel A bitmask of the log levels to set.
*/
void linphone_core_set_log_level(OrtpLogLevel loglevel);
void linphone_core_enable_logs(FILE *file); void linphone_core_enable_logs(FILE *file);
void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc); void linphone_core_enable_logs_with_cb(OrtpLogFunc logfunc);
void linphone_core_disable_logs(void); void linphone_core_disable_logs(void);
/*sets the user-agent string in sip messages, must be set before linphone_c
ore_new() or linphone_core_init() */
void linphone_core_set_user_agent(const char *ua_name, const char *version)
;
const char *linphone_core_get_version(void); const char *linphone_core_get_version(void);
const char *linphone_core_get_user_agent_name(void);
const char *linphone_core_get_user_agent_version(void);
LinphoneCore *linphone_core_new(const LinphoneCoreVTable *vtable, LinphoneCore *linphone_core_new(const LinphoneCoreVTable *vtable,
const char *config_path, con st char *factory_config, void* userdata); const char *config_path, con st char *factory_config, void* userdata);
/**
* Instantiates a LinphoneCore object with a given LpConfig.
* @ingroup initializing
*
* The LinphoneCore object is the primary handle for doing all phone action
s.
* It should be unique within your application.
* @param vtable a LinphoneCoreVTable structure holding your application ca
llbacks
* @param config a pointer to an LpConfig object holding the configuration
of the LinphoneCore to be instantiated.
* @param userdata an opaque user pointer that can be retrieved at any time
(for example in
* callbacks) using linphone_core_get_user_data().
* @see linphone_core_new
**/
LinphoneCore *linphone_core_new_with_config(const LinphoneCoreVTable *vtabl
e, struct _LpConfig *config, void *userdata);
/* function to be periodically called in a main loop */ /* function to be periodically called in a main loop */
/* For ICE to work properly it should be called every 20ms */
void linphone_core_iterate(LinphoneCore *lc); void linphone_core_iterate(LinphoneCore *lc);
#if 0 /*not implemented yet*/
/**
* @ingroup initializing
* Provide Linphone Core with an unique identifier. This be later used to i
dentified contact address coming from this device.
* Value is not saved.
* @param lc object
* @param string identifying the device, can be EMEI or UDID
*
*/
void linphone_core_set_device_identifier(LinphoneCore *lc,const char* devic
e_id);
/**
* @ingroup initializing
* get Linphone unique identifier
*
*/
const char* linphone_core_get_device_identifier(const LinphoneCore *lc);
#endif
/*sets the user-agent string in sip messages, ideally called just after lin
phone_core_new() or linphone_core_init() */
void linphone_core_set_user_agent(LinphoneCore *lc, const char *ua_name, co
nst char *version);
LinphoneAddress * linphone_core_interpret_url(LinphoneCore *lc, const char *url); LinphoneAddress * linphone_core_interpret_url(LinphoneCore *lc, const char *url);
LinphoneCall * linphone_core_invite(LinphoneCore *lc, const char *url); LinphoneCall * linphone_core_invite(LinphoneCore *lc, const char *url);
LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const Linphon eAddress *addr); LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const Linphon eAddress *addr);
LinphoneCall * linphone_core_invite_with_params(LinphoneCore *lc, const cha r *url, const LinphoneCallParams *params); LinphoneCall * linphone_core_invite_with_params(LinphoneCore *lc, const cha r *url, const LinphoneCallParams *params);
LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, c onst LinphoneAddress *addr, const LinphoneCallParams *params); LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, c onst LinphoneAddress *addr, const LinphoneCallParams *params);
skipping to change at line 683 skipping to change at line 965
int linphone_core_transfer_call_to_another(LinphoneCore *lc, LinphoneCall * call, LinphoneCall *dest); int linphone_core_transfer_call_to_another(LinphoneCore *lc, LinphoneCall * call, LinphoneCall *dest);
bool_t linphone_core_inc_invite_pending(LinphoneCore*lc); bool_t linphone_core_inc_invite_pending(LinphoneCore*lc);
bool_t linphone_core_in_call(const LinphoneCore *lc); bool_t linphone_core_in_call(const LinphoneCore *lc);
LinphoneCall *linphone_core_get_current_call(const LinphoneCore *lc); LinphoneCall *linphone_core_get_current_call(const LinphoneCore *lc);
int linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call); int linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call);
int linphone_core_accept_call_with_params(LinphoneCore *lc, LinphoneCall *c
all, const LinphoneCallParams *params);
int linphone_core_terminate_call(LinphoneCore *lc, LinphoneCall *call); int linphone_core_terminate_call(LinphoneCore *lc, LinphoneCall *call);
int linphone_core_redirect_call(LinphoneCore *lc, LinphoneCall *call, const char *redirect_uri); int linphone_core_redirect_call(LinphoneCore *lc, LinphoneCall *call, const char *redirect_uri);
int linphone_core_decline_call(LinphoneCore *lc, LinphoneCall * call, Linph
oneReason reason);
int linphone_core_terminate_all_calls(LinphoneCore *lc); int linphone_core_terminate_all_calls(LinphoneCore *lc);
int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *call); int linphone_core_pause_call(LinphoneCore *lc, LinphoneCall *call);
int linphone_core_pause_all_calls(LinphoneCore *lc); int linphone_core_pause_all_calls(LinphoneCore *lc);
int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *call); int linphone_core_resume_call(LinphoneCore *lc, LinphoneCall *call);
int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const L inphoneCallParams *params); int linphone_core_update_call(LinphoneCore *lc, LinphoneCall *call, const L inphoneCallParams *params);
int linphone_core_defer_call_update(LinphoneCore *lc, LinphoneCall *call);
int linphone_core_accept_call_update(LinphoneCore *lc, LinphoneCall *call,
const LinphoneCallParams *params);
/**
* @ingroup media_parameters
* Get default call parameters reflecting current linphone core configurati
on
* @param LinphoneCore object
* @return LinphoneCallParams
*/
LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCo re *lc); LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCo re *lc);
LinphoneCall *linphone_core_get_call_by_remote_address(LinphoneCore *lc, co nst char *remote_address); LinphoneCall *linphone_core_get_call_by_remote_address(LinphoneCore *lc, co nst char *remote_address);
void linphone_core_send_dtmf(LinphoneCore *lc,char dtmf); void linphone_core_send_dtmf(LinphoneCore *lc,char dtmf);
int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact ); int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact );
const char *linphone_core_get_primary_contact(LinphoneCore *lc); const char *linphone_core_get_primary_contact(LinphoneCore *lc);
skipping to change at line 726 skipping to change at line 1021
const char * linphone_core_get_identity(LinphoneCore *lc); const char * linphone_core_get_identity(LinphoneCore *lc);
/*0= no bandwidth limit*/ /*0= no bandwidth limit*/
void linphone_core_set_download_bandwidth(LinphoneCore *lc, int bw); void linphone_core_set_download_bandwidth(LinphoneCore *lc, int bw);
void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw); void linphone_core_set_upload_bandwidth(LinphoneCore *lc, int bw);
int linphone_core_get_download_bandwidth(const LinphoneCore *lc); int linphone_core_get_download_bandwidth(const LinphoneCore *lc);
int linphone_core_get_upload_bandwidth(const LinphoneCore *lc); int linphone_core_get_upload_bandwidth(const LinphoneCore *lc);
void linphone_core_enable_adaptive_rate_control(LinphoneCore *lc, bool_t en abled); void linphone_core_enable_adaptive_rate_control(LinphoneCore *lc, bool_t en abled);
bool_t linphone_core_adaptive_rate_control_enabled(const LinphoneCore *lc); bool_t linphone_core_adaptive_rate_control_enabled(const LinphoneCore *lc);
/**
* set audio packetization time linphone expect to receive from peer
* @ingroup media_parameters
*
*/
void linphone_core_set_download_ptime(LinphoneCore *lc, int ptime); void linphone_core_set_download_ptime(LinphoneCore *lc, int ptime);
/**
* get audio packetization time linphone expect to receive from peer, 0 mea
ns unspecified
* @ingroup media_parameters
*/
int linphone_core_get_download_ptime(LinphoneCore *lc); int linphone_core_get_download_ptime(LinphoneCore *lc);
void linphone_core_set_upload_ptime(LinphoneCore *lc, int ptime); void linphone_core_set_upload_ptime(LinphoneCore *lc, int ptime);
int linphone_core_get_upload_ptime(LinphoneCore *lc); int linphone_core_get_upload_ptime(LinphoneCore *lc);
/* returns a MSList of PayloadType */ /* returns a MSList of PayloadType */
const MSList *linphone_core_get_audio_codecs(const LinphoneCore *lc); const MSList *linphone_core_get_audio_codecs(const LinphoneCore *lc);
int linphone_core_set_audio_codecs(LinphoneCore *lc, MSList *codecs); int linphone_core_set_audio_codecs(LinphoneCore *lc, MSList *codecs);
/* returns a MSList of PayloadType */ /* returns a MSList of PayloadType */
const MSList *linphone_core_get_video_codecs(const LinphoneCore *lc); const MSList *linphone_core_get_video_codecs(const LinphoneCore *lc);
int linphone_core_set_video_codecs(LinphoneCore *lc, MSList *codecs); int linphone_core_set_video_codecs(LinphoneCore *lc, MSList *codecs);
bool_t linphone_core_payload_type_enabled(LinphoneCore *lc, PayloadType *pt bool_t linphone_core_payload_type_enabled(LinphoneCore *lc, const PayloadTy
); pe *pt);
/**
* Enable payload type
* @param linphone core
* @param pt payload type to enable, can be retrieve from #linphone_core_fi
nd_payload_type
* @param TRUE if enabled
* @return 0 if succed
*
*/
int linphone_core_enable_payload_type(LinphoneCore *lc, PayloadType *pt, bo ol_t enable); int linphone_core_enable_payload_type(LinphoneCore *lc, PayloadType *pt, bo ol_t enable);
PayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char* /**
type, int rate) ; * Wildcard value used by #linphone_core_find_payload_type to ignore rate i
n search algorithm
* @ingroup media_parameters
*/
#define LINPHONE_FIND_PAYLOAD_IGNORE_RATE -1
/**
* Wildcard value used by #linphone_core_find_payload_type to ignore channe
l in search algorithm
* @ingroup media_parameters
*/
#define LINPHONE_FIND_PAYLOAD_IGNORE_CHANNELS -1
/**
* Get payload type from mime type and clock rate
* @ingroup media_parameters
* This function searches in audio and video codecs for the given payload t
ype name and clockrate.
* @param lc #LinphoneCore object
* @param type payload mime type (I.E SPEEX, PCMU, VP8)
* @param rate can be #LINPHONE_FIND_PAYLOAD_IGNORE_RATE
* @param channels number of channels, can be #LINPHONE_FIND_PAYLOAD_IGNOR
E_CHANNELS
* @return Returns NULL if not found.
*/
PayloadType* linphone_core_find_payload_type(LinphoneCore* lc, const char*
type, int rate, int channels) ;
int linphone_core_get_payload_type_number(LinphoneCore *lc, const PayloadTy
pe *pt);
const char *linphone_core_get_payload_type_description(LinphoneCore *lc, Pa yloadType *pt); const char *linphone_core_get_payload_type_description(LinphoneCore *lc, Pa yloadType *pt);
bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, Payload Type *pt); bool_t linphone_core_check_payload_type_usability(LinphoneCore *lc, Payload Type *pt);
/**
* @ingroup proxy
*Create a proxy config with default value from Linphone core.
*@param lc #LinphoneCore object
*@return #LinphoneProxyConfig with defualt value set
*/
LinphoneProxyConfig * linphone_core_create_proxy_config(LinphoneCore *lc);
int linphone_core_add_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *c onfig); int linphone_core_add_proxy_config(LinphoneCore *lc, LinphoneProxyConfig *c onfig);
void linphone_core_clear_proxy_config(LinphoneCore *lc); void linphone_core_clear_proxy_config(LinphoneCore *lc);
void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfi g *config); void linphone_core_remove_proxy_config(LinphoneCore *lc, LinphoneProxyConfi g *config);
const MSList *linphone_core_get_proxy_config_list(const LinphoneCore *lc); const MSList *linphone_core_get_proxy_config_list(const LinphoneCore *lc);
void linphone_core_set_default_proxy(LinphoneCore *lc, LinphoneProxyConfig *config); void linphone_core_set_default_proxy(LinphoneCore *lc, LinphoneProxyConfig *config);
skipping to change at line 787 skipping to change at line 1111
void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInf o *info); void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInf o *info);
const MSList *linphone_core_get_auth_info_list(const LinphoneCore *lc); const MSList *linphone_core_get_auth_info_list(const LinphoneCore *lc);
const LinphoneAuthInfo *linphone_core_find_auth_info(LinphoneCore *lc, cons t char *realm, const char *username); const LinphoneAuthInfo *linphone_core_find_auth_info(LinphoneCore *lc, cons t char *realm, const char *username);
void linphone_core_abort_authentication(LinphoneCore *lc, LinphoneAuthInfo *info); void linphone_core_abort_authentication(LinphoneCore *lc, LinphoneAuthInfo *info);
void linphone_core_clear_all_auth_info(LinphoneCore *lc); void linphone_core_clear_all_auth_info(LinphoneCore *lc);
void linphone_core_enable_audio_adaptive_jittcomp(LinphoneCore *lc, bool_t
enable);
bool_t linphone_core_audio_adaptive_jittcomp_enabled(LinphoneCore *lc);
int linphone_core_get_audio_jittcomp(LinphoneCore *lc); int linphone_core_get_audio_jittcomp(LinphoneCore *lc);
void linphone_core_set_audio_jittcomp(LinphoneCore *lc, int value); void linphone_core_set_audio_jittcomp(LinphoneCore *lc, int value);
void linphone_core_enable_video_adaptive_jittcomp(LinphoneCore *lc, bool_t
enable);
bool_t linphone_core_video_adaptive_jittcomp_enabled(LinphoneCore *lc);
int linphone_core_get_video_jittcomp(LinphoneCore *lc);
void linphone_core_set_video_jittcomp(LinphoneCore *lc, int value);
int linphone_core_get_audio_port(const LinphoneCore *lc); int linphone_core_get_audio_port(const LinphoneCore *lc);
void linphone_core_get_audio_port_range(const LinphoneCore *lc, int *min_po
rt, int *max_port);
int linphone_core_get_video_port(const LinphoneCore *lc); int linphone_core_get_video_port(const LinphoneCore *lc);
void linphone_core_get_video_port_range(const LinphoneCore *lc, int *min_po
rt, int *max_port);
int linphone_core_get_nortp_timeout(const LinphoneCore *lc); int linphone_core_get_nortp_timeout(const LinphoneCore *lc);
void linphone_core_set_audio_port(LinphoneCore *lc, int port); void linphone_core_set_audio_port(LinphoneCore *lc, int port);
void linphone_core_set_audio_port_range(LinphoneCore *lc, int min_port, int
max_port);
void linphone_core_set_video_port(LinphoneCore *lc, int port); void linphone_core_set_video_port(LinphoneCore *lc, int port);
void linphone_core_set_video_port_range(LinphoneCore *lc, int min_port, int
max_port);
void linphone_core_set_nortp_timeout(LinphoneCore *lc, int port); void linphone_core_set_nortp_timeout(LinphoneCore *lc, int port);
void linphone_core_set_use_info_for_dtmf(LinphoneCore *lc, bool_t use_info) ; void linphone_core_set_use_info_for_dtmf(LinphoneCore *lc, bool_t use_info) ;
bool_t linphone_core_get_use_info_for_dtmf(LinphoneCore *lc); bool_t linphone_core_get_use_info_for_dtmf(LinphoneCore *lc);
void linphone_core_set_use_rfc2833_for_dtmf(LinphoneCore *lc,bool_t use_rfc 2833); void linphone_core_set_use_rfc2833_for_dtmf(LinphoneCore *lc,bool_t use_rfc 2833);
bool_t linphone_core_get_use_rfc2833_for_dtmf(LinphoneCore *lc); bool_t linphone_core_get_use_rfc2833_for_dtmf(LinphoneCore *lc);
skipping to change at line 830 skipping to change at line 1174
* Give access to the UDP sip socket. Can be useful to configure this socke t as persistent I.E kCFStreamNetworkServiceType set to kCFStreamNetworkServ iceTypeVoIP) * Give access to the UDP sip socket. Can be useful to configure this socke t as persistent I.E kCFStreamNetworkServiceType set to kCFStreamNetworkServ iceTypeVoIP)
* @param lc #LinphoneCore * @param lc #LinphoneCore
* @return socket file descriptor * @return socket file descriptor
*/ */
ortp_socket_t linphone_core_get_sip_socket(LinphoneCore *lc); ortp_socket_t linphone_core_get_sip_socket(LinphoneCore *lc);
void linphone_core_set_inc_timeout(LinphoneCore *lc, int seconds); void linphone_core_set_inc_timeout(LinphoneCore *lc, int seconds);
int linphone_core_get_inc_timeout(LinphoneCore *lc); int linphone_core_get_inc_timeout(LinphoneCore *lc);
void linphone_core_set_in_call_timeout(LinphoneCore *lc, int seconds);
int linphone_core_get_in_call_timeout(LinphoneCore *lc);
void linphone_core_set_delayed_timeout(LinphoneCore *lc, int seconds);
int linphone_core_get_delayed_timeout(LinphoneCore *lc);
void linphone_core_set_stun_server(LinphoneCore *lc, const char *server); void linphone_core_set_stun_server(LinphoneCore *lc, const char *server);
const char * linphone_core_get_stun_server(const LinphoneCore *lc); const char * linphone_core_get_stun_server(const LinphoneCore *lc);
/**
* @ingroup network_parameters
* Return the availability of uPnP.
*
* @return true if uPnP is available otherwise return false.
*/
bool_t linphone_core_upnp_available();
/**
* @ingroup network_parameters
* Return the internal state of uPnP.
*
* @param lc #LinphoneCore
* @return an LinphoneUpnpState.
*/
LinphoneUpnpState linphone_core_get_upnp_state(const LinphoneCore *lc);
/**
* @ingroup network_parameters
* Return the external ip address of router.
* In some cases the uPnP can have an external ip address but not a usable
uPnP
* (state different of Ok).
*
* @param lc #LinphoneCore
* @return a null terminated string containing the external ip address. If
the
* the external ip address is not available return null.
*/
const char * linphone_core_get_upnp_external_ipaddress(const LinphoneCore *
lc);
void linphone_core_set_nat_address(LinphoneCore *lc, const char *addr); void linphone_core_set_nat_address(LinphoneCore *lc, const char *addr);
const char *linphone_core_get_nat_address(const LinphoneCore *lc); const char *linphone_core_get_nat_address(const LinphoneCore *lc);
void linphone_core_set_firewall_policy(LinphoneCore *lc, LinphoneFirewallPo licy pol); void linphone_core_set_firewall_policy(LinphoneCore *lc, LinphoneFirewallPo licy pol);
LinphoneFirewallPolicy linphone_core_get_firewall_policy(const LinphoneCore *lc); LinphoneFirewallPolicy linphone_core_get_firewall_policy(const LinphoneCore *lc);
const char * linphone_core_get_relay_addr(const LinphoneCore *lc); const char * linphone_core_get_relay_addr(const LinphoneCore *lc);
int linphone_core_set_relay_addr(LinphoneCore *lc, const char *addr); int linphone_core_set_relay_addr(LinphoneCore *lc, const char *addr);
/* sound functions */ /* sound functions */
/* returns a null terminated static array of string describing the sound de vices */ /* returns a null terminated static array of string describing the sound de vices */
const char** linphone_core_get_sound_devices(LinphoneCore *lc); const char** linphone_core_get_sound_devices(LinphoneCore *lc);
void linphone_core_reload_sound_devices(LinphoneCore *lc);
bool_t linphone_core_sound_device_can_capture(LinphoneCore *lc, const char *device); bool_t linphone_core_sound_device_can_capture(LinphoneCore *lc, const char *device);
bool_t linphone_core_sound_device_can_playback(LinphoneCore *lc, const char *device); bool_t linphone_core_sound_device_can_playback(LinphoneCore *lc, const char *device);
int linphone_core_get_ring_level(LinphoneCore *lc); int linphone_core_get_ring_level(LinphoneCore *lc);
int linphone_core_get_play_level(LinphoneCore *lc); int linphone_core_get_play_level(LinphoneCore *lc);
int linphone_core_get_rec_level(LinphoneCore *lc); int linphone_core_get_rec_level(LinphoneCore *lc);
void linphone_core_set_ring_level(LinphoneCore *lc, int level); void linphone_core_set_ring_level(LinphoneCore *lc, int level);
void linphone_core_set_play_level(LinphoneCore *lc, int level); void linphone_core_set_play_level(LinphoneCore *lc, int level);
void linphone_core_set_mic_gain_db(LinphoneCore *lc, float level);
float linphone_core_get_mic_gain_db(LinphoneCore *lc);
void linphone_core_set_playback_gain_db(LinphoneCore *lc, float level); void linphone_core_set_playback_gain_db(LinphoneCore *lc, float level);
float linphone_core_get_playback_gain_db(LinphoneCore *lc); float linphone_core_get_playback_gain_db(LinphoneCore *lc);
void linphone_core_set_rec_level(LinphoneCore *lc, int level); void linphone_core_set_rec_level(LinphoneCore *lc, int level);
const char * linphone_core_get_ringer_device(LinphoneCore *lc); const char * linphone_core_get_ringer_device(LinphoneCore *lc);
const char * linphone_core_get_playback_device(LinphoneCore *lc); const char * linphone_core_get_playback_device(LinphoneCore *lc);
const char * linphone_core_get_capture_device(LinphoneCore *lc); const char * linphone_core_get_capture_device(LinphoneCore *lc);
int linphone_core_set_ringer_device(LinphoneCore *lc, const char * devid); int linphone_core_set_ringer_device(LinphoneCore *lc, const char * devid);
int linphone_core_set_playback_device(LinphoneCore *lc, const char * devid) ; int linphone_core_set_playback_device(LinphoneCore *lc, const char * devid) ;
int linphone_core_set_capture_device(LinphoneCore *lc, const char * devid); int linphone_core_set_capture_device(LinphoneCore *lc, const char * devid);
char linphone_core_get_sound_source(LinphoneCore *lc); char linphone_core_get_sound_source(LinphoneCore *lc);
void linphone_core_set_sound_source(LinphoneCore *lc, char source); void linphone_core_set_sound_source(LinphoneCore *lc, char source);
void linphone_core_set_ring(LinphoneCore *lc, const char *path); void linphone_core_set_ring(LinphoneCore *lc, const char *path);
const char *linphone_core_get_ring(const LinphoneCore *lc); const char *linphone_core_get_ring(const LinphoneCore *lc);
void linphone_core_verify_server_certificates(LinphoneCore *lc, bool_t yesn o); void linphone_core_verify_server_certificates(LinphoneCore *lc, bool_t yesn o);
void linphone_core_verify_server_cn(LinphoneCore *lc, bool_t yesno);
void linphone_core_set_root_ca(LinphoneCore *lc, const char *path); void linphone_core_set_root_ca(LinphoneCore *lc, const char *path);
const char *linphone_core_get_root_ca(LinphoneCore *lc);
void linphone_core_set_ringback(LinphoneCore *lc, const char *path); void linphone_core_set_ringback(LinphoneCore *lc, const char *path);
const char * linphone_core_get_ringback(const LinphoneCore *lc); const char * linphone_core_get_ringback(const LinphoneCore *lc);
void linphone_core_set_remote_ringback_tone(LinphoneCore *lc,const char *); void linphone_core_set_remote_ringback_tone(LinphoneCore *lc,const char *);
const char *linphone_core_get_remote_ringback_tone(const LinphoneCore *lc); const char *linphone_core_get_remote_ringback_tone(const LinphoneCore *lc);
int linphone_core_preview_ring(LinphoneCore *lc, const char *ring,LinphoneC oreCbFunc func,void * userdata); int linphone_core_preview_ring(LinphoneCore *lc, const char *ring,LinphoneC oreCbFunc func,void * userdata);
void linphone_core_enable_echo_cancellation(LinphoneCore *lc, bool_t val); void linphone_core_enable_echo_cancellation(LinphoneCore *lc, bool_t val);
bool_t linphone_core_echo_cancellation_enabled(LinphoneCore *lc); bool_t linphone_core_echo_cancellation_enabled(LinphoneCore *lc);
skipping to change at line 897 skipping to change at line 1283
bool_t linphone_core_agc_enabled(const LinphoneCore *lc); bool_t linphone_core_agc_enabled(const LinphoneCore *lc);
void linphone_core_mute_mic(LinphoneCore *lc, bool_t muted); void linphone_core_mute_mic(LinphoneCore *lc, bool_t muted);
/** /**
* return mic state. * return mic state.
* *
* @ingroup media_parameters * @ingroup media_parameters
**/ **/
bool_t linphone_core_is_mic_muted(LinphoneCore *lc); bool_t linphone_core_is_mic_muted(LinphoneCore *lc);
bool_t linphone_core_is_audio_muted(LinphoneCore *lc);
bool_t linphone_core_is_rtp_muted(LinphoneCore *lc); bool_t linphone_core_is_rtp_muted(LinphoneCore *lc);
bool_t linphone_core_get_rtp_no_xmit_on_audio_mute(const LinphoneCore *lc); bool_t linphone_core_get_rtp_no_xmit_on_audio_mute(const LinphoneCore *lc);
void linphone_core_set_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, bool_t v al); void linphone_core_set_rtp_no_xmit_on_audio_mute(LinphoneCore *lc, bool_t v al);
/* returns a list of LinphoneCallLog */ /* returns a list of LinphoneCallLog */
const MSList * linphone_core_get_call_logs(LinphoneCore *lc); const MSList * linphone_core_get_call_logs(LinphoneCore *lc);
void linphone_core_clear_call_logs(LinphoneCore *lc); void linphone_core_clear_call_logs(LinphoneCore *lc);
int linphone_core_get_missed_calls_count(LinphoneCore *lc);
void linphone_core_reset_missed_calls_count(LinphoneCore *lc);
void linphone_core_remove_call_log(LinphoneCore *lc, LinphoneCallLog *call_
log);
/* video support */ /* video support */
bool_t linphone_core_video_supported(LinphoneCore *lc);
void linphone_core_enable_video(LinphoneCore *lc, bool_t vcap_enabled, bool _t display_enabled); void linphone_core_enable_video(LinphoneCore *lc, bool_t vcap_enabled, bool _t display_enabled);
bool_t linphone_core_video_enabled(LinphoneCore *lc); bool_t linphone_core_video_enabled(LinphoneCore *lc);
void linphone_core_set_video_policy(LinphoneCore *lc, const LinphoneVideoPo
licy *policy);
const LinphoneVideoPolicy *linphone_core_get_video_policy(LinphoneCore *lc)
;
typedef struct MSVideoSizeDef{ typedef struct MSVideoSizeDef{
MSVideoSize vsize; MSVideoSize vsize;
const char *name; const char *name;
}MSVideoSizeDef; }MSVideoSizeDef;
/* returns a zero terminated table of MSVideoSizeDef*/ /* returns a zero terminated table of MSVideoSizeDef*/
const MSVideoSizeDef *linphone_core_get_supported_video_sizes(LinphoneCore *lc); const MSVideoSizeDef *linphone_core_get_supported_video_sizes(LinphoneCore *lc);
void linphone_core_set_preferred_video_size(LinphoneCore *lc, MSVideoSize v size); void linphone_core_set_preferred_video_size(LinphoneCore *lc, MSVideoSize v size);
MSVideoSize linphone_core_get_preferred_video_size(LinphoneCore *lc); MSVideoSize linphone_core_get_preferred_video_size(LinphoneCore *lc);
void linphone_core_set_preferred_video_size_by_name(LinphoneCore *lc, const char *name); void linphone_core_set_preferred_video_size_by_name(LinphoneCore *lc, const char *name);
void linphone_core_enable_video_preview(LinphoneCore *lc, bool_t val); void linphone_core_enable_video_preview(LinphoneCore *lc, bool_t val);
bool_t linphone_core_video_preview_enabled(const LinphoneCore *lc); bool_t linphone_core_video_preview_enabled(const LinphoneCore *lc);
void linphone_core_enable_self_view(LinphoneCore *lc, bool_t val); void linphone_core_enable_self_view(LinphoneCore *lc, bool_t val);
bool_t linphone_core_self_view_enabled(const LinphoneCore *lc); bool_t linphone_core_self_view_enabled(const LinphoneCore *lc);
/* returns a null terminated static array of string describing the webcams */ /* returns a null terminated static array of string describing the webcams */
void linphone_core_reload_video_devices(LinphoneCore *lc);
const char** linphone_core_get_video_devices(const LinphoneCore *lc); const char** linphone_core_get_video_devices(const LinphoneCore *lc);
int linphone_core_set_video_device(LinphoneCore *lc, const char *id); int linphone_core_set_video_device(LinphoneCore *lc, const char *id);
const char *linphone_core_get_video_device(const LinphoneCore *lc); const char *linphone_core_get_video_device(const LinphoneCore *lc);
/* Set static picture to be used when "Static picture" is the video device */ /* Set and get static picture to be used when "Static picture" is the video device */
int linphone_core_set_static_picture(LinphoneCore *lc, const char *path); int linphone_core_set_static_picture(LinphoneCore *lc, const char *path);
const char *linphone_core_get_static_picture(LinphoneCore *lc);
/* Set and get frame rate for static picture */ /* Set and get frame rate for static picture */
int linphone_core_set_static_picture_fps(LinphoneCore *lc, float fps); int linphone_core_set_static_picture_fps(LinphoneCore *lc, float fps);
float linphone_core_get_static_picture_fps(LinphoneCore *lc); float linphone_core_get_static_picture_fps(LinphoneCore *lc);
/*function to be used for eventually setting window decorations (icons, tit le...)*/ /*function to be used for eventually setting window decorations (icons, tit le...)*/
unsigned long linphone_core_get_native_video_window_id(const LinphoneCore * lc); unsigned long linphone_core_get_native_video_window_id(const LinphoneCore * lc);
void linphone_core_set_native_video_window_id(LinphoneCore *lc, unsigned lo ng id); void linphone_core_set_native_video_window_id(LinphoneCore *lc, unsigned lo ng id);
unsigned long linphone_core_get_native_preview_window_id(const LinphoneCore *lc); unsigned long linphone_core_get_native_preview_window_id(const LinphoneCore *lc);
void linphone_core_set_native_preview_window_id(LinphoneCore *lc, unsigned long id); void linphone_core_set_native_preview_window_id(LinphoneCore *lc, unsigned long id);
void linphone_core_use_preview_window(LinphoneCore *lc, bool_t yesno); void linphone_core_use_preview_window(LinphoneCore *lc, bool_t yesno);
int linphone_core_get_device_rotation(LinphoneCore *lc ); int linphone_core_get_device_rotation(LinphoneCore *lc );
void linphone_core_set_device_rotation(LinphoneCore *lc, int rotation); void linphone_core_set_device_rotation(LinphoneCore *lc, int rotation);
/**
* @brief Get the camera sensor rotation.
*
* This is needed on some mobile platforms to get the number of degrees the
camera sensor
* is rotated relative to the screen.
*
* @param lc The linphone core related to the operation
* @return The camera sensor rotation in degrees (0 to 360) or -1 if it cou
ld not be retrieved
*/
int linphone_core_get_camera_sensor_rotation(LinphoneCore *lc);
/* start or stop streaming video in case of embedded window */ /* start or stop streaming video in case of embedded window */
void linphone_core_show_video(LinphoneCore *lc, bool_t show); void linphone_core_show_video(LinphoneCore *lc, bool_t show);
/*play/record support: use files instead of soundcard*/ /*play/record support: use files instead of soundcard*/
void linphone_core_use_files(LinphoneCore *lc, bool_t yesno); void linphone_core_use_files(LinphoneCore *lc, bool_t yesno);
void linphone_core_set_play_file(LinphoneCore *lc, const char *file); void linphone_core_set_play_file(LinphoneCore *lc, const char *file);
void linphone_core_set_record_file(LinphoneCore *lc, const char *file); void linphone_core_set_record_file(LinphoneCore *lc, const char *file);
void linphone_core_play_dtmf(LinphoneCore *lc, char dtmf, int duration_ms); void linphone_core_play_dtmf(LinphoneCore *lc, char dtmf, int duration_ms);
void linphone_core_stop_dtmf(LinphoneCore *lc); void linphone_core_stop_dtmf(LinphoneCore *lc);
int linphone_core_get_current_call_duration(const LinphoneCore *lc); int linphone_core_get_current_call_duration(const LinphoneCore *lc);
int linphone_core_get_mtu(const LinphoneCore *lc); int linphone_core_get_mtu(const LinphoneCore *lc);
void linphone_core_set_mtu(LinphoneCore *lc, int mtu); void linphone_core_set_mtu(LinphoneCore *lc, int mtu);
/** /**
* @ingroup network_parameters * @ingroup network_parameters
* This method is called by the application to notify the linphone core lib rary when network is reachable. * This method is called by the application to notify the linphone core lib rary when network is reachable.
* Calling this method with true trigger linphone to initiate a registratio * Calling this method with true trigger linphone to initiate a registratio
n process for all proxy n process for all proxies.
* configuration with parameter register set to enable. * Calling this method disables the automatic network detection mode. It me
* This method disable the automatic registration mode. It means you must c ans you must call this method after each network state changes.
all this method after each network state changes
*
*/ */
void linphone_core_set_network_reachable(LinphoneCore* lc,bool_t value); void linphone_core_set_network_reachable(LinphoneCore* lc,bool_t value);
/** /**
* @ingroup network_parameters * @ingroup network_parameters
* return network state either as positioned by the application or by linph one * return network state either as positioned by the application or by linph one itself.
*/ */
bool_t linphone_core_is_network_reachabled(LinphoneCore* lc); bool_t linphone_core_is_network_reachable(LinphoneCore* lc);
/** /**
* @ingroup network_parameters * @ingroup network_parameters
* enable signaling keep alive. small udp packet sent periodically to keep udp NAT association * enable signaling keep alive. small udp packet sent periodically to keep udp NAT association
*/ */
void linphone_core_enable_keep_alive(LinphoneCore* lc,bool_t enable); void linphone_core_enable_keep_alive(LinphoneCore* lc,bool_t enable);
/** /**
* @ingroup network_parameters * @ingroup network_parameters
* Is signaling keep alive * Is signaling keep alive
*/ */
bool_t linphone_core_keep_alive_enabled(LinphoneCore* lc); bool_t linphone_core_keep_alive_enabled(LinphoneCore* lc);
void *linphone_core_get_user_data(LinphoneCore *lc); void *linphone_core_get_user_data(LinphoneCore *lc);
void linphone_core_set_user_data(LinphoneCore *lc, void *userdata);
/* returns LpConfig object to read/write to the config file: usefull if you wish to extend /* returns LpConfig object to read/write to the config file: usefull if you wish to extend
the config file with your own sections */ the config file with your own sections */
struct _LpConfig *linphone_core_get_config(LinphoneCore *lc); struct _LpConfig *linphone_core_get_config(LinphoneCore *lc);
/*set a callback for some blocking operations, it takes you informed of the progress of the operation*/ /*set a callback for some blocking operations, it takes you informed of the progress of the operation*/
void linphone_core_set_waiting_callback(LinphoneCore *lc, LinphoneWaitingCa llback cb, void *user_context); void linphone_core_set_waiting_callback(LinphoneCore *lc, LinphoneWaitingCa llback cb, void *user_context);
/*returns the list of registered SipSetup (linphonecore plugins) */ /*returns the list of registered SipSetup (linphonecore plugins) */
const MSList * linphone_core_get_sip_setups(LinphoneCore *lc); const MSList * linphone_core_get_sip_setups(LinphoneCore *lc);
skipping to change at line 1024 skipping to change at line 1427
void *video_rtp_func_data; void *video_rtp_func_data;
LinphoneRtpTransportFactoryFunc video_rtcp_func; LinphoneRtpTransportFactoryFunc video_rtcp_func;
void *video_rtcp_func_data; void *video_rtcp_func_data;
}; };
typedef struct _LinphoneRtpTransportFactories LinphoneRtpTransportFactories ; typedef struct _LinphoneRtpTransportFactories LinphoneRtpTransportFactories ;
void linphone_core_set_rtp_transport_factories(LinphoneCore* lc, LinphoneRt pTransportFactories *factories); void linphone_core_set_rtp_transport_factories(LinphoneCore* lc, LinphoneRt pTransportFactories *factories);
int linphone_core_get_current_call_stats(LinphoneCore *lc, rtp_stats_t *loc al, rtp_stats_t *remote); int linphone_core_get_current_call_stats(LinphoneCore *lc, rtp_stats_t *loc al, rtp_stats_t *remote);
int linphone_core_get_calls_nb(const LinphoneCore *lc);
const MSList *linphone_core_get_calls(LinphoneCore *lc); const MSList *linphone_core_get_calls(LinphoneCore *lc);
LinphoneGlobalState linphone_core_get_global_state(const LinphoneCore *lc); LinphoneGlobalState linphone_core_get_global_state(const LinphoneCore *lc);
/** /**
* force registration refresh to be initiated upon next iterate * force registration refresh to be initiated upon next iterate
* @ingroup proxies * @ingroup proxies
*/ */
void linphone_core_refresh_registers(LinphoneCore* lc); void linphone_core_refresh_registers(LinphoneCore* lc);
/* Path to the file storing secrets cache */ /* Path to the file storing secrets cache */
void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file ); void linphone_core_set_zrtp_secrets_file(LinphoneCore *lc, const char* file );
const char *linphone_core_get_zrtp_secrets_file(LinphoneCore *lc);
/**
* Search from the list of current calls if a remote address match uri
* @ingroup call_control
* @param lc
* @param uri which should match call remote uri
* @return LinphoneCall or NULL is no match is found
*/
const LinphoneCall* linphone_core_find_call_from_uri(LinphoneCore *lc, cons t char *uri); const LinphoneCall* linphone_core_find_call_from_uri(LinphoneCore *lc, cons t char *uri);
int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call); int linphone_core_add_to_conference(LinphoneCore *lc, LinphoneCall *call);
int linphone_core_add_all_to_conference(LinphoneCore *lc); int linphone_core_add_all_to_conference(LinphoneCore *lc);
int linphone_core_remove_from_conference(LinphoneCore *lc, LinphoneCall *ca ll); int linphone_core_remove_from_conference(LinphoneCore *lc, LinphoneCall *ca ll);
bool_t linphone_core_is_in_conference(const LinphoneCore *lc); bool_t linphone_core_is_in_conference(const LinphoneCore *lc);
int linphone_core_enter_conference(LinphoneCore *lc); int linphone_core_enter_conference(LinphoneCore *lc);
int linphone_core_leave_conference(LinphoneCore *lc); int linphone_core_leave_conference(LinphoneCore *lc);
float linphone_core_get_conference_local_input_volume(LinphoneCore *lc); float linphone_core_get_conference_local_input_volume(LinphoneCore *lc);
int linphone_core_terminate_conference(LinphoneCore *lc); int linphone_core_terminate_conference(LinphoneCore *lc);
int linphone_core_get_conference_size(LinphoneCore *lc); int linphone_core_get_conference_size(LinphoneCore *lc);
int linphone_core_start_conference_recording(LinphoneCore *lc, const char *
path);
int linphone_core_stop_conference_recording(LinphoneCore *lc);
/**
* Get the maximum number of simultaneous calls Linphone core can manage at
a time. All new call above this limit are declined with a busy answer
* @ingroup initializing
* @param lc core
* @return max number of simultaneous calls
*/
int linphone_core_get_max_calls(LinphoneCore *lc); int linphone_core_get_max_calls(LinphoneCore *lc);
/**
* Set the maximum number of simultaneous calls Linphone core can manage at
a time. All new call above this limit are declined with a busy answer
* @ingroup initializing
* @param lc core
* @param max number of simultaneous calls
*/
void linphone_core_set_max_calls(LinphoneCore *lc, int max); void linphone_core_set_max_calls(LinphoneCore *lc, int max);
bool_t linphone_core_sound_resources_locked(LinphoneCore *lc); bool_t linphone_core_sound_resources_locked(LinphoneCore *lc);
bool_t linphone_core_media_encryption_supported(const LinphoneCore *lc, Lin phoneMediaEncryption menc); bool_t linphone_core_media_encryption_supported(const LinphoneCore *lc, Lin phoneMediaEncryption menc);
/** /**
* Choose media encryption policy to be used for RTP packets * Choose media encryption policy to be used for RTP packets
*/ */
int linphone_core_set_media_encryption(LinphoneCore *lc, enum LinphoneMedia Encryption menc); int linphone_core_set_media_encryption(LinphoneCore *lc, enum LinphoneMedia Encryption menc);
skipping to change at line 1079 skipping to change at line 1504
/** /**
* Init call params using LinphoneCore's current configuration * Init call params using LinphoneCore's current configuration
*/ */
void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *params); void linphone_core_init_default_params(LinphoneCore*lc, LinphoneCallParams *params);
/** /**
* True if tunnel support was compiled. * True if tunnel support was compiled.
*/ */
bool_t linphone_core_tunnel_available(void); bool_t linphone_core_tunnel_available(void);
typedef struct LinphoneTunnel LinphoneTunnel; typedef struct _LinphoneTunnel LinphoneTunnel;
/** /**
* get tunnel instance if available * get tunnel instance if available
*/ */
LinphoneTunnel *linphone_core_get_tunnel(LinphoneCore *lc); LinphoneTunnel *linphone_core_get_tunnel(LinphoneCore *lc);
void linphone_core_set_sip_dscp(LinphoneCore *lc, int dscp);
int linphone_core_get_sip_dscp(const LinphoneCore *lc);
void linphone_core_set_audio_dscp(LinphoneCore *lc, int dscp);
int linphone_core_get_audio_dscp(const LinphoneCore *lc);
void linphone_core_set_video_dscp(LinphoneCore *lc, int dscp);
int linphone_core_get_video_dscp(const LinphoneCore *lc);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 93 change blocks. 
101 lines changed or deleted 647 lines changed or added


 linphonecore_utils.h   linphonecore_utils.h 
skipping to change at line 59 skipping to change at line 59
void linphone_sound_daemon_release_player(LinphoneSoundDaemon *lsd, LsdPlay er *lsdplayer); void linphone_sound_daemon_release_player(LinphoneSoundDaemon *lsd, LsdPlay er *lsdplayer);
void linphone_sound_daemon_stop_all_players(LinphoneSoundDaemon *obj); void linphone_sound_daemon_stop_all_players(LinphoneSoundDaemon *obj);
void linphone_sound_daemon_release_all_players(LinphoneSoundDaemon *obj); void linphone_sound_daemon_release_all_players(LinphoneSoundDaemon *obj);
void linphone_core_use_sound_daemon(LinphoneCore *lc, LinphoneSoundDaemon * lsd); void linphone_core_use_sound_daemon(LinphoneCore *lc, LinphoneSoundDaemon * lsd);
void linphone_sound_daemon_destroy(LinphoneSoundDaemon *obj); void linphone_sound_daemon_destroy(LinphoneSoundDaemon *obj);
/** /**
* Enum describing the result of the echo canceller calibration process. * Enum describing the result of the echo canceller calibration process.
**/ **/
typedef enum { typedef enum {
LinphoneEcCalibratorInProgress, LinphoneEcCalibratorInProgress, /**< The echo canceller calibration
LinphoneEcCalibratorDone, process is on going. */
LinphoneEcCalibratorFailed LinphoneEcCalibratorDone, /**< The echo canceller calibration
has been performed and produced an echo delay measure. */
LinphoneEcCalibratorFailed, /**< The echo canceller calibration
process has failed. */
LinphoneEcCalibratorDoneNoEcho /**< The echo canceller calibration
has been performed and no echo has been detected. */
}LinphoneEcCalibratorStatus; }LinphoneEcCalibratorStatus;
typedef void (*LinphoneEcCalibrationCallback)(LinphoneCore *lc, LinphoneEcC alibratorStatus status, int delay_ms, void *data); typedef void (*LinphoneEcCalibrationCallback)(LinphoneCore *lc, LinphoneEcC alibratorStatus status, int delay_ms, void *data);
typedef void (*LinphoneEcCalibrationAudioInit)(void *data);
typedef void (*LinphoneEcCalibrationAudioUninit)(void *data);
/** /**
* *
* Start an echo calibration of the sound devices, in order to find adequat e settings for the echo canceller automatically. * Start an echo calibration of the sound devices, in order to find adequat e settings for the echo canceller automatically.
**/ **/
int linphone_core_start_echo_calibration(LinphoneCore *lc, LinphoneEcCalibr int linphone_core_start_echo_calibration(LinphoneCore *lc, LinphoneEcCalibr
ationCallback cb, void *cb_data); ationCallback cb,
LinphoneEcCalibrationAudioInit audi
o_init_cb, LinphoneEcCalibrationAudioUninit audio_uninit_cb, void *cb_data)
;
/** /**
* @ingroup IOS * @ingroup IOS
* Special function to warm up dtmf feeback stream. #linphone_core_stop_dt mf_stream must() be called before entering FG mode * Special function to warm up dtmf feeback stream. #linphone_core_stop_dt mf_stream must() be called before entering FG mode
*/ */
void linphone_core_start_dtmf_stream(LinphoneCore* lc); void linphone_core_start_dtmf_stream(LinphoneCore* lc);
/** /**
* @ingroup IOS * @ingroup IOS
* Special function to stop dtmf feed back function. Must be called before entering BG mode * Special function to stop dtmf feed back function. Must be called before entering BG mode
*/ */
void linphone_core_stop_dtmf_stream(LinphoneCore* lc); void linphone_core_stop_dtmf_stream(LinphoneCore* lc);
typedef bool_t (*LinphoneCoreIterateHook)(void *data); typedef bool_t (*LinphoneCoreIterateHook)(void *data);
void linphone_core_add_iterate_hook(LinphoneCore *lc, LinphoneCoreIterateHo ok hook, void *hook_data); void linphone_core_add_iterate_hook(LinphoneCore *lc, LinphoneCoreIterateHo ok hook, void *hook_data);
void linphone_core_remove_iterate_hook(LinphoneCore *lc, LinphoneCoreIterat eHook hook, void *hook_data); void linphone_core_remove_iterate_hook(LinphoneCore *lc, LinphoneCoreIterat eHook hook, void *hook_data);
/**
* @ingroup misc
*Function to get call country code from ISO 3166-1 alpha-2 code, ex: FR
returns 33
*@param iso country code alpha2
*@return call country code or -1 if not found
*/
int linphone_dial_plan_lookup_ccc_from_iso(const char* iso);
/**
* @ingroup misc
*Function to get call country code from an e164 number, ex: +33952650121
will return 33
*@param e164 phone number
*@return call country code or -1 if not found
*/
int linphone_dial_plan_lookup_ccc_from_e164(const char* e164);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 4 change blocks. 
5 lines changed or deleted 31 lines changed or added


 linphonefriend.h   linphonefriend.h 
skipping to change at line 135 skipping to change at line 135
void linphone_friend_destroy(LinphoneFriend *lf); void linphone_friend_destroy(LinphoneFriend *lf);
/** /**
* set #LinphoneAddress for this friend * set #LinphoneAddress for this friend
* @param fr #LinphoneFriend object * @param fr #LinphoneFriend object
* @param address #LinphoneAddress * @param address #LinphoneAddress
*/ */
int linphone_friend_set_addr(LinphoneFriend *fr, const LinphoneAddress* add ress); int linphone_friend_set_addr(LinphoneFriend *fr, const LinphoneAddress* add ress);
/** /**
* set the display name for this friend
* @param lf #LinphoneFriend object
* @param name
*/
int linphone_friend_set_name(LinphoneFriend *lf, const char *name);
/**
* get address of this friend * get address of this friend
* @param lf #LinphoneFriend object * @param lf #LinphoneFriend object
* @return #LinphoneAddress * @return #LinphoneAddress
*/ */
const LinphoneAddress *linphone_friend_get_address(const LinphoneFriend *lf ); const LinphoneAddress *linphone_friend_get_address(const LinphoneFriend *lf );
/** /**
* get subscription flag value * get subscription flag value
* @param lf #LinphoneFriend object * @param lf #LinphoneFriend object
* @return returns true is subscription is activated for this friend * @return returns true is subscription is activated for this friend
* *
 End of changes. 1 change blocks. 
0 lines changed or deleted 7 lines changed or added


 lpconfig.h   lpconfig.h 
skipping to change at line 28 skipping to change at line 28
* GNU Library General Public License for more details. * GNU Library General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, U SA.
*/ */
#ifndef LPCONFIG_H #ifndef LPCONFIG_H
#define LPCONFIG_H #define LPCONFIG_H
#include <ortp/port.h>
/** /**
* The LpConfig object is used to manipulate a configuration file. * The LpConfig object is used to manipulate a configuration file.
* *
* @ingroup misc * @ingroup misc
* The format of the configuration file is a .ini like format: * The format of the configuration file is a .ini like format:
* - sections are defined in [] * - sections are defined in []
* - each section contains a sequence of key=value pairs. * - each section contains a sequence of key=value pairs.
* *
* Example: * Example:
* @code * @code
skipping to change at line 52 skipping to change at line 54
* [video] * [video]
* enabled=1 * enabled=1
* @endcode * @endcode
**/ **/
typedef struct _LpConfig LpConfig; typedef struct _LpConfig LpConfig;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#define LP_CONFIG_DEFAULT_STRING(config, name, default) \
(config) ? (lp_config_get_string(config, "default_values", name, def
ault)) : (default)
#define LP_CONFIG_DEFAULT_INT(config, name, default) \
(config) ? (lp_config_get_int(config, "default_values", name, defaul
t)) : (default)
#define LP_CONFIG_DEFAULT_INT64(config, name, default) \
(config) ? (lp_config_get_int64(config, "default_values", name, defa
ult)) : (default)
#define LP_CONFIG_DEFAULT_FLOAT(config, name, default) \
(config) ? (lp_config_get_float(config, "default_values", name, defa
ult)) : (default)
/**
* Instantiates a LpConfig object from a user config file.
*
* @ingroup misc
* @param filename the filename of the config file to read to fill the inst
antiated LpConfig
* @see lp_config_new_with_factory
*/
LpConfig * lp_config_new(const char *filename); LpConfig * lp_config_new(const char *filename);
/**
* Instantiates a LpConfig object from a user config file and a factory con
fig file.
*
* @ingroup misc
* @param config_filename the filename of the user config file to read to f
ill the instantiated LpConfig
* @param factory_config_filename the filename of the factory config file t
o read to fill the instantiated LpConfig
* @see lp_config_new
*
* The user config file is read first to fill the LpConfig and then the fac
tory config file is read.
* Therefore the configuration parameters defined in the user config file w
ill be overwritten by the parameters
* defined in the factory config file.
*/
LpConfig * lp_config_new_with_factory(const char *config_filename, const ch
ar *factory_config_filename);
int lp_config_read_file(LpConfig *lpconfig, const char *filename); int lp_config_read_file(LpConfig *lpconfig, const char *filename);
/** /**
* Retrieves a configuration item as a string, given its section, key, and default value. * Retrieves a configuration item as a string, given its section, key, and default value.
* *
* @ingroup misc * @ingroup misc
* The default value string is returned if the config item isn't found. * The default value string is returned if the config item isn't found.
**/ **/
const char *lp_config_get_string(LpConfig *lpconfig, const char *section, c onst char *key, const char *default_string); const char *lp_config_get_string(const LpConfig *lpconfig, const char *sect ion, const char *key, const char *default_string);
int lp_config_read_file(LpConfig *lpconfig, const char *filename); int lp_config_read_file(LpConfig *lpconfig, const char *filename);
/** /**
* Retrieves a configuration item as a range, given its section, key, and d
efault min and max values.
*
* @ingroup misc
* @return TRUE if the value is successfully parsed as a range, FALSE other
wise.
* If FALSE is returned, min and max are filled respectively with default_m
in and default_max values.
*/
bool_t lp_config_get_range(const LpConfig *lpconfig, const char *section, c
onst char *key, int *min, int *max, int default_min, int default_max);
/**
* Retrieves a configuration item as an integer, given its section, key, an d default value. * Retrieves a configuration item as an integer, given its section, key, an d default value.
* *
* @ingroup misc * @ingroup misc
* The default integer value is returned if the config item isn't found. * The default integer value is returned if the config item isn't found.
**/ **/
int lp_config_get_int(LpConfig *lpconfig,const char *section, const char *k int lp_config_get_int(const LpConfig *lpconfig,const char *section, const c
ey, int default_value); har *key, int default_value);
/**
* Retrieves a configuration item as a 64 bit integer, given its section, k
ey, and default value.
*
* @ingroup misc
* The default integer value is returned if the config item isn't found.
**/
int64_t lp_config_get_int64(const LpConfig *lpconfig,const char *section, c
onst char *key, int64_t default_value);
int lp_config_read_file(LpConfig *lpconfig, const char *filename); int lp_config_read_file(LpConfig *lpconfig, const char *filename);
/** /**
* Retrieves a configuration item as a float, given its section, key, and d efault value. * Retrieves a configuration item as a float, given its section, key, and d efault value.
* *
* @ingroup misc * @ingroup misc
* The default float value is returned if the config item isn't found. * The default float value is returned if the config item isn't found.
**/ **/
float lp_config_get_float(LpConfig *lpconfig,const char *section, const cha r *key, float default_value); float lp_config_get_float(const LpConfig *lpconfig,const char *section, con st char *key, float default_value);
/** /**
* Sets a string config item * Sets a string config item
* *
* @ingroup misc * @ingroup misc
**/ **/
void lp_config_set_string(LpConfig *lpconfig,const char *section, const cha r *key, const char *value); void lp_config_set_string(LpConfig *lpconfig,const char *section, const cha r *key, const char *value);
/** /**
* Sets a range config item
*
* @ingroup misc
*/
void lp_config_set_range(LpConfig *lpconfig, const char *section, const cha
r *key, int min_value, int max_value);
/**
* Sets an integer config item * Sets an integer config item
* *
* @ingroup misc * @ingroup misc
**/ **/
void lp_config_set_int(LpConfig *lpconfig,const char *section, const char * key, int value); void lp_config_set_int(LpConfig *lpconfig,const char *section, const char * key, int value);
/**
* Sets an integer config item, but store it as hexadecimal
*
* @ingroup misc
**/
void lp_config_set_int_hex(LpConfig *lpconfig,const char *section, const ch
ar *key, int value);
/**
* Sets a 64 bits integer config item
*
* @ingroup misc
**/
void lp_config_set_int64(LpConfig *lpconfig,const char *section, const char
*key, int64_t value);
/** /**
* Sets a float config item * Sets a float config item
* *
* @ingroup misc * @ingroup misc
**/ **/
void lp_config_set_float(LpConfig *lpconfig,const char *section, const char *key, float value); void lp_config_set_float(LpConfig *lpconfig,const char *section, const char *key, float value);
/** /**
* Writes the config file to disk. * Writes the config file to disk.
* *
* @ingroup misc * @ingroup misc
**/ **/
int lp_config_sync(LpConfig *lpconfig); int lp_config_sync(LpConfig *lpconfig);
/** /**
* Returns 1 if a given section is present in the configuration. * Returns 1 if a given section is present in the configuration.
* *
* @ingroup misc * @ingroup misc
**/ **/
int lp_config_has_section(LpConfig *lpconfig, const char *section); int lp_config_has_section(const LpConfig *lpconfig, const char *section);
/** /**
* Removes every pair of key,value in a section and remove the section. * Removes every pair of key,value in a section and remove the section.
* *
* @ingroup misc * @ingroup misc
**/ **/
void lp_config_clean_section(LpConfig *lpconfig, const char *section); void lp_config_clean_section(LpConfig *lpconfig, const char *section);
/**
* Call a function for each section present in the configuration.
*
* @ingroup misc
**/
void lp_config_for_each_section(const LpConfig *lpconfig, void (*callback)(
const char *section, void *ctx), void *ctx);
/**
* Call a function for each entry present in a section configuration.
*
* @ingroup misc
**/
void lp_config_for_each_entry(const LpConfig *lpconfig, const char *section
, void (*callback)(const char *entry, void *ctx), void *ctx);
/*tells whether uncommited (with lp_config_sync()) modifications exist*/ /*tells whether uncommited (with lp_config_sync()) modifications exist*/
int lp_config_needs_commit(const LpConfig *lpconfig); int lp_config_needs_commit(const LpConfig *lpconfig);
void lp_config_destroy(LpConfig *cfg); void lp_config_destroy(LpConfig *cfg);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 11 change blocks. 
5 lines changed or deleted 114 lines changed or added


 mediastream.h   mediastream.h 
skipping to change at line 30 skipping to change at line 30
#ifndef MEDIASTREAM_H #ifndef MEDIASTREAM_H
#define MEDIASTREAM_H #define MEDIASTREAM_H
#include <mediastreamer2/msfilter.h> #include <mediastreamer2/msfilter.h>
#include <mediastreamer2/msticker.h> #include <mediastreamer2/msticker.h>
#include <mediastreamer2/mssndcard.h> #include <mediastreamer2/mssndcard.h>
#include <mediastreamer2/mswebcam.h> #include <mediastreamer2/mswebcam.h>
#include <mediastreamer2/msvideo.h> #include <mediastreamer2/msvideo.h>
#include <mediastreamer2/bitratecontrol.h> #include <mediastreamer2/bitratecontrol.h>
#include <mediastreamer2/qualityindicator.h> #include <mediastreamer2/qualityindicator.h>
#include <mediastreamer2/ice.h>
#include <ortp/ortp.h> #include <ortp/ortp.h>
#include <ortp/event.h> #include <ortp/event.h>
#include <ortp/zrtp.h> #include <ortp/zrtp.h>
#include <ortp/ortp_srtp.h> #include <ortp/ortp_srtp.h>
#include <ortp/zrtp.h> #include <ortp/zrtp.h>
#define PAYLOAD_TYPE_FLAG_CAN_RECV PAYLOAD_TYPE_USER_FLAG_1 #define PAYLOAD_TYPE_FLAG_CAN_RECV PAYLOAD_TYPE_USER_FLAG_1
#define PAYLOAD_TYPE_FLAG_CAN_SEND PAYLOAD_TYPE_USER_FLAG_2 #define PAYLOAD_TYPE_FLAG_CAN_SEND PAYLOAD_TYPE_USER_FLAG_2
#ifdef __cplusplus
extern "C" {
#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, MSSndCa
rd *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 {
AudioStreamType,
VideoStreamType
} StreamType;
struct _MediaStream {
StreamType type;
MSTicker *ticker;
RtpSession *session;
OrtpEvQueue *evq;
MSFilter *rtprecv;
MSFilter *rtpsend;
MSFilter *encoder;
MSFilter *decoder;
MSFilter *voidsink;
MSBitrateController *rc;
MSQualityIndicator *qi;
IceCheckList *ice_check_list;
OrtpZrtpContext *zrtp_context;
srtp_t srtp_session;
time_t start_time;
time_t last_iterate_time;
bool_t use_rc;
bool_t is_beginning;
bool_t pad[2];
};
typedef struct _MediaStream MediaStream;
MS2_PUBLIC void media_stream_set_rtcp_information(MediaStream *stream, cons
t char *cname, const char *tool);
MS2_PUBLIC void media_stream_get_local_rtp_stats(MediaStream *stream, rtp_s
tats_t *stats);
MS2_PUBLIC int media_stream_set_dscp(MediaStream *stream, int dscp);
MS2_PUBLIC void media_stream_enable_adaptive_bitrate_control(MediaStream *s
tream, 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_s
rtp_crypto_suite_t suite, const char* snd_key, const char* rcv_key);
MS2_PUBLIC const MSQualityIndicator *media_stream_get_quality_indicator(Med
iaStream *stream);
MS2_PUBLIC float media_stream_get_quality_rating(MediaStream *stream);
MS2_PUBLIC float media_stream_get_average_quality_rating(MediaStream *strea
m);
/*shall only called internally*/
void media_stream_iterate(MediaStream * stream);
/**
* @addtogroup audio_stream_api
* @{
**/
typedef enum EchoLimiterType{ typedef enum EchoLimiterType{
ELInactive, ELInactive,
ELControlMic, ELControlMic,
ELControlFull ELControlFull
} EchoLimiterType; } EchoLimiterType;
struct _AudioStream struct _AudioStream
{ {
MSTicker *ticker; MediaStream ms;
RtpSession *session;
MSFilter *soundread; MSFilter *soundread;
MSFilter *soundwrite; MSFilter *soundwrite;
MSFilter *encoder;
MSFilter *decoder;
MSFilter *rtprecv;
MSFilter *rtpsend;
MSFilter *dtmfgen; MSFilter *dtmfgen;
MSFilter *dtmfgen_rtp; MSFilter *dtmfgen_rtp;
MSFilter *plc;
MSFilter *ec;/*echo canceler*/ MSFilter *ec;/*echo canceler*/
MSFilter *volsend,*volrecv; /*MSVolumes*/ MSFilter *volsend,*volrecv; /*MSVolumes*/
MSFilter *read_resampler; MSFilter *read_resampler;
MSFilter *write_resampler; MSFilter *write_resampler;
MSFilter *equalizer; MSFilter *equalizer;
MSFilter *dummy;
MSFilter *send_tee;
MSFilter *recv_tee;
MSFilter *recorder_mixer;
MSFilter *recorder;
char *recorder_file;
uint64_t last_packet_count; uint64_t last_packet_count;
time_t last_packet_time; time_t last_packet_time;
EchoLimiterType el_type; /*use echo limiter: two MSVolume, measured input level controlling local output level*/ EchoLimiterType el_type; /*use echo limiter: two MSVolume, measured input level controlling local output level*/
OrtpEvQueue *evq; uint32_t features;
MSBitrateController *rc;
MSQualityIndicator *qi;
time_t start_time;
bool_t play_dtmfs; bool_t play_dtmfs;
bool_t use_gc; bool_t use_gc;
bool_t use_agc; bool_t use_agc;
bool_t eq_active; bool_t eq_active;
bool_t use_ng;/*noise gate*/ bool_t use_ng;/*noise gate*/
bool_t use_rc; bool_t is_ec_delay_set;
bool_t is_beginning;
OrtpZrtpContext *ortpZrtpContext;
srtp_t srtp_session;
}; };
#ifdef __cplusplus
extern "C" {
#endif
/**
* @addtogroup audio_stream_api
* @{
**/
/** /**
* The AudioStream holds all resources to create and run typical VoIP audio stream. * The AudioStream holds all resources to create and run typical VoIP audio stream.
**/ **/
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,
int remport, int payload_type, int jitt_com p, bool_t echo_cancel); int remport, int payload_type, int jitt_com p, bool_t echo_cancel);
MS2_PUBLIC AudioStream *audio_stream_start_with_sndcards(RtpProfile * prof, int locport, const char *remip4, int remport, int payload_type, int jitt_c omp, MSSndCard *playcard, MSSndCard *captcard, bool_t echocancel); MS2_PUBLIC AudioStream *audio_stream_start_with_sndcards(RtpProfile * prof, int locport, const char *remip4, int remport, int payload_type, int jitt_c omp, MSSndCard *playcard, MSSndCard *captcard, bool_t echocancel);
MS2_PUBLIC int audio_stream_start_with_files (AudioStream * stream, RtpProf ile * prof, MS2_PUBLIC int audio_stream_start_with_files (AudioStream * stream, RtpProf ile * prof,
const char *remip, int remport, int rem_rtcp_port, const char *remip, int remport, int rem_rtcp_port,
int pt, int jitt_comp, int pt, int jitt_comp,
const char * infile, const char * outfile); const char * infile, const char * outfile);
/** /**
* Starts an audio stream from/to local wav files or soundcards. * Starts an audio stream from/to local wav files or soundcards.
* *
* This method starts the processing of the audio stream, that is playing f rom wav file or soundcard, voice processing, encoding, * This method starts the processing of the audio stream, that is playing f rom wav file or soundcard, voice processing, encoding,
* sending through RTP, receiving from RTP, decoding, voice processing and wav file recording or soundcard playback. * 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 stream an AudioStream previously created with audio_stream_new().
* @param prof a RtpProfile containing all PayloadType possible during the audio session. * @param prof a RtpProfile containing all PayloadType possible during the audio session.
* @param remip remote IP address where to send the encoded audio. * @param rem_rtp_ip remote IP address where to send the encoded audio.
* @param remport remote IP port 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.
* @param rem_rtcp_port remote port for RTCP. * @param rem_rtcp_port remote port for RTCP.
* @param payload_type payload type index to use for the sending stream. Th is index must point to a valid PayloadType in the RtpProfile. * @param payload_type payload type index to use for the sending stream. Th is index must point to a valid PayloadType in the RtpProfile.
* @param jitt_comp Nominal jitter buffer size in milliseconds. * @param jitt_comp Nominal jitter buffer size in milliseconds.
* @param infile path to wav file to play out (can be NULL) * @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 outfile path to wav file to record into (can be NULL)
* @param playcard The soundcard to be used for playback (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 captcard The soundcard to be used for catpure. (can be NULL)
* @param echo_cancel whether echo cancellation is to be performed. * @param echo_cancel whether echo cancellation is to be performed.
* @returns 0 if sucessful, -1 otherwise. * @returns 0 if sucessful, -1 otherwise.
**/ **/
MS2_PUBLIC int audio_stream_start_full(AudioStream *stream, RtpProfile *pro MS2_PUBLIC int audio_stream_start_full(AudioStream *stream, RtpProfile *pro
file, const char *remip,int remport, file, const char *rem_rtp_ip,int rem_rtp_port,
int rem_rtcp_port, int payload,int jitt_comp, const char *infile, co const char *rem_rtcp_ip, int rem_rtcp_port, int payload,int jitt_com
nst char *outfile, p, const char *infile, const char *outfile,
MSSndCard *playcard, MSSndCard *captcard, bool_t use_ec); MSSndCard *playcard, MSSndCard *captcard, bool_t use_ec);
MS2_PUBLIC void audio_stream_play(AudioStream *st, const char *name); MS2_PUBLIC void audio_stream_play(AudioStream *st, const char *name);
MS2_PUBLIC void audio_stream_record(AudioStream *st, const char *name); MS2_PUBLIC void audio_stream_record(AudioStream *st, const char *name);
MS2_PUBLIC void audio_stream_set_rtcp_information(AudioStream *st, const ch static inline void audio_stream_set_rtcp_information(AudioStream *st, const
ar *cname, const char *tool); char *cname, const char *tool) {
media_stream_set_rtcp_information(&st->ms, cname, tool);
}
MS2_PUBLIC void audio_stream_play_received_dtmfs(AudioStream *st, bool_t ye sno); MS2_PUBLIC void audio_stream_play_received_dtmfs(AudioStream *st, bool_t ye sno);
/** /**
* Creates an AudioStream object listening on a RTP port. * Creates an AudioStream object listening on a RTP port.
* @param locport the local UDP port to listen for RTP packets. * @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
* @param ipv6 TRUE if ipv6 must be used. * @param ipv6 TRUE if ipv6 must be used.
* @returns a new AudioStream. * @returns a new AudioStream.
**/ **/
MS2_PUBLIC AudioStream *audio_stream_new(int locport, bool_t ipv6); MS2_PUBLIC AudioStream *audio_stream_new(int loc_rtp_port, int loc_rtcp_por
t, bool_t ipv6);
#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)
#define AUDIO_STREAM_FEATURE_MIXED_RECORDING (1 << 7)
#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 |\
AUDIO_STREAM_FEATURE_MIXED_RECORDING
\
)
MS2_PUBLIC uint32_t audio_stream_get_features(AudioStream *st);
MS2_PUBLIC void audio_stream_set_features(AudioStream *st, uint32_t feature
s);
MS2_PUBLIC void audio_stream_prepare_sound(AudioStream *st, MSSndCard *play
card, MSSndCard *captcard);
MS2_PUBLIC void audio_stream_unprepare_sound(AudioStream *st);
MS2_PUBLIC bool_t audio_stream_started(AudioStream *stream);
/** /**
* Starts an audio stream from local soundcards. * Starts an audio stream from local soundcards.
* *
* This method starts the processing of the audio stream, that is capture f rom soundcard, voice processing, encoding, * This method starts the processing of the audio stream, that is capture f rom soundcard, voice processing, encoding,
* sending through RTP, receiving from RTP, decoding, voice processing and soundcard playback. * sending through RTP, receiving from RTP, decoding, voice processing and soundcard playback.
* *
* @param stream an AudioStream previously created with audio_stream_new(). * @param stream an AudioStream previously created with audio_stream_new().
* @param prof a RtpProfile containing all PayloadType possible during the audio session. * @param prof a RtpProfile containing all PayloadType possible during the audio session.
* @param remip remote IP address where to send the encoded audio. * @param remip remote IP address where to send the encoded audio.
* @param remport remote IP port where to send the encoded audio * @param remport remote IP port where to send the encoded audio
skipping to change at line 197 skipping to change at line 287
/*enable gain control, to be done before start() */ /*enable gain control, to be done before start() */
MS2_PUBLIC void audio_stream_enable_gain_control(AudioStream *stream, bool_ t val); MS2_PUBLIC void audio_stream_enable_gain_control(AudioStream *stream, bool_ t val);
/*enable automatic gain control, to be done before start() */ /*enable automatic gain control, to be done before start() */
MS2_PUBLIC void audio_stream_enable_automatic_gain_control(AudioStream *str eam, bool_t val); MS2_PUBLIC void audio_stream_enable_automatic_gain_control(AudioStream *str eam, bool_t val);
/*to be done before start */ /*to be done before start */
MS2_PUBLIC void audio_stream_set_echo_canceller_params(AudioStream *st, int tail_len_ms, int delay_ms, int framesize); MS2_PUBLIC void audio_stream_set_echo_canceller_params(AudioStream *st, int tail_len_ms, int delay_ms, int framesize);
/*enable adaptive rate control */ /*enable adaptive rate control */
MS2_PUBLIC void audio_stream_enable_adaptive_bitrate_control(AudioStream *s static inline void audio_stream_enable_adaptive_bitrate_control(AudioStream
t, bool_t enabled); *stream, bool_t enabled) {
media_stream_enable_adaptive_bitrate_control(&stream->ms, enabled);
}
/* Enable adaptive jitter compensation */
static inline void audio_stream_enable_adaptive_jittcomp(AudioStream *strea
m, bool_t enabled) {
media_stream_enable_adaptive_jittcomp(&stream->ms, enabled);
}
MS2_PUBLIC void audio_stream_set_mic_gain(AudioStream *stream, float gain); MS2_PUBLIC void audio_stream_set_mic_gain(AudioStream *stream, float gain);
/* enable/disable rtp stream */ /* enable/disable rtp stream */
MS2_PUBLIC void audio_stream_mute_rtp(AudioStream *stream, bool_t val); MS2_PUBLIC void audio_stream_mute_rtp(AudioStream *stream, bool_t val);
/*enable noise gate, must be done before start()*/ /*enable noise gate, must be done before start()*/
MS2_PUBLIC void audio_stream_enable_noise_gate(AudioStream *stream, bool_t val); MS2_PUBLIC void audio_stream_enable_noise_gate(AudioStream *stream, bool_t val);
/*enable parametric equalizer in the stream that goes to the speaker*/ /*enable parametric equalizer in the stream that goes to the speaker*/
MS2_PUBLIC void audio_stream_enable_equalizer(AudioStream *stream, bool_t e nabled); MS2_PUBLIC void audio_stream_enable_equalizer(AudioStream *stream, bool_t e nabled);
MS2_PUBLIC void audio_stream_equalizer_set_gain(AudioStream *stream, int fr equency, float gain, int freq_width); MS2_PUBLIC void audio_stream_equalizer_set_gain(AudioStream *stream, int fr equency, float gain, int freq_width);
/* 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, MSSndCa
rd *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);
MS2_PUBLIC int audio_stream_mixed_record_open(AudioStream *st, const char*f
ilename);
MS2_PUBLIC int audio_stream_mixed_record_start(AudioStream *st);
MS2_PUBLIC int audio_stream_mixed_record_stop(AudioStream *st);
MS2_PUBLIC void audio_stream_set_default_card(int cardindex); MS2_PUBLIC void audio_stream_set_default_card(int cardindex);
/* retrieve RTP statistics*/ /* retrieve RTP statistics*/
MS2_PUBLIC void audio_stream_get_local_rtp_stats(AudioStream *stream, rtp_s static inline void audio_stream_get_local_rtp_stats(AudioStream *stream, rt
tats_t *stats); p_stats_t *stats) {
media_stream_get_local_rtp_stats(&stream->ms, stats);
}
/* returns a realtime indicator of the stream quality between 0 and 5 */ /* returns a realtime indicator of the stream quality between 0 and 5 */
MS2_PUBLIC float audio_stream_get_quality_rating(AudioStream *stream); MS2_PUBLIC float audio_stream_get_quality_rating(AudioStream *stream);
/* returns the quality rating as an average since the start of the streamin g session.*/ /* returns the quality rating as an average since the start of the streamin g session.*/
MS2_PUBLIC float audio_stream_get_average_quality_rating(AudioStream *strea m); MS2_PUBLIC float audio_stream_get_average_quality_rating(AudioStream *strea m);
/* enable ZRTP on the audio stream */ /* enable ZRTP on the audio stream */
MS2_PUBLIC void audio_stream_enable_zrtp(AudioStream *stream, OrtpZrtpParam s *params); MS2_PUBLIC void audio_stream_enable_zrtp(AudioStream *stream, OrtpZrtpParam s *params);
/* enable SRTP on the audio stream */ /* enable SRTP on the audio stream */
MS2_PUBLIC bool_t audio_stream_enable_strp(AudioStream* stream, enum ortp_s static inline bool_t audio_stream_enable_srtp(AudioStream* stream, enum ort
rtp_crypto_suite_t suite, const char* snd_key, const char* rcv_key); p_srtp_crypto_suite_t suite, const char* snd_key, const char* rcv_key) {
return media_stream_enable_srtp(&stream->ms, suite, snd_key, rcv_key
);
}
/***************** static inline int audio_stream_set_dscp(AudioStream *stream, int dscp) {
Video Support return media_stream_set_dscp(&stream->ms, dscp);
*****************/ }
/**
* @}
**/
/**
* @addtogroup video_stream_api
* @{
**/
typedef void (*VideoStreamRenderCallback)(void *user_pointer, const MSPictu re *local_view, const MSPicture *remote_view); typedef void (*VideoStreamRenderCallback)(void *user_pointer, const MSPictu re *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,
VideoStreamRecvOnly VideoStreamRecvOnly
}VideoStreamDir; }VideoStreamDir;
struct _VideoStream struct _VideoStream
{ {
MSTicker *ticker; MediaStream ms;
RtpSession *session;
MSFilter *source; MSFilter *source;
MSFilter *pixconv; MSFilter *pixconv;
MSFilter *sizeconv; MSFilter *sizeconv;
MSFilter *tee; MSFilter *tee;
MSFilter *output; MSFilter *output;
MSFilter *encoder;
MSFilter *decoder;
MSFilter *rtprecv;
MSFilter *rtpsend;
MSFilter *tee2; MSFilter *tee2;
MSFilter *jpegwriter; MSFilter *jpegwriter;
MSFilter *output2; MSFilter *output2;
OrtpEvQueue *evq;
MSVideoSize sent_vsize; MSVideoSize sent_vsize;
int corner; /*for selfview*/ int corner; /*for selfview*/
VideoStreamRenderCallback rendercb; VideoStreamRenderCallback rendercb;
void *render_pointer; void *render_pointer;
VideoStreamEventCallback eventcb; VideoStreamEventCallback eventcb;
void *event_pointer; void *event_pointer;
char *display_name; char *display_name;
unsigned long window_id; unsigned long window_id;
unsigned long preview_window_id; unsigned long preview_window_id;
VideoStreamDir dir; VideoStreamDir dir;
MSWebCam *cam; MSWebCam *cam;
bool_t use_preview_window;
bool_t use_rc;
bool_t pad[2];
int device_orientation; /* warning: meaning of this variable depends on the platform (Android, iOS, ...) */ int device_orientation; /* warning: meaning of this variable depends on the platform (Android, iOS, ...) */
OrtpZrtpContext *ortpZrtpContext; bool_t use_preview_window;
srtp_t srtp_session; bool_t display_filter_auto_rotate_enabled;
MSBitrateController *rc; bool_t prepare_ongoing;
bool_t source_performs_encoding;
bool_t output_performs_decoding;
}; };
typedef struct _VideoStream VideoStream; typedef struct _VideoStream VideoStream;
MS2_PUBLIC VideoStream *video_stream_new(int locport, bool_t use_ipv6); MS2_PUBLIC VideoStream *video_stream_new(int loc_rtp_port, int loc_rtcp_por t, 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 void video_stream_enable_adaptive_bitrate_control(VideoStream *s static inline void video_stream_enable_adaptive_bitrate_control(VideoStream
, bool_t yesno); *stream, bool_t enabled) {
media_stream_enable_adaptive_bitrate_control(&stream->ms, enabled);
}
static inline void video_stream_enable_adaptive_jittcomp(VideoStream *strea
m, bool_t enabled) {
media_stream_enable_adaptive_jittcomp(&stream->ms, enabled);
}
MS2_PUBLIC void video_stream_set_render_callback(VideoStream *s, VideoStrea mRenderCallback cb, void *user_pointer); MS2_PUBLIC void video_stream_set_render_callback(VideoStream *s, VideoStrea mRenderCallback cb, void *user_pointer);
MS2_PUBLIC void video_stream_set_event_callback(VideoStream *s, VideoStream EventCallback cb, void *user_pointer); MS2_PUBLIC void video_stream_set_event_callback(VideoStream *s, VideoStream EventCallback cb, void *user_pointer);
MS2_PUBLIC void video_stream_set_display_filter_name(VideoStream *s, const char *fname); MS2_PUBLIC void video_stream_set_display_filter_name(VideoStream *s, const char *fname);
MS2_PUBLIC int video_stream_start(VideoStream * stream, RtpProfile *profile , const char *remip, int remport, int rem_rtcp_port, 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 re m_rtcp_port,
int payload, int jitt_comp, MSWebCam *device); int payload, int jitt_comp, MSWebCam *device);
MS2_PUBLIC void video_stream_prepare_video(VideoStream *stream);
MS2_PUBLIC void video_stream_unprepare_video(VideoStream *stream);
MS2_PUBLIC void video_stream_set_relay_session_id(VideoStream *stream, cons t char *relay_session_id); MS2_PUBLIC void video_stream_set_relay_session_id(VideoStream *stream, cons t char *relay_session_id);
MS2_PUBLIC void video_stream_set_rtcp_information(VideoStream *st, const ch static inline void video_stream_set_rtcp_information(VideoStream *st, const
ar *cname, const char *tool); char *cname, const char *tool) {
media_stream_set_rtcp_information(&st->ms, cname, tool);
}
MS2_PUBLIC void video_stream_change_camera(VideoStream *stream, MSWebCam *c am); MS2_PUBLIC void video_stream_change_camera(VideoStream *stream, MSWebCam *c am);
/* Calling video_stream_set_sent_video_size() or changing the bitrate value in the used PayloadType during a stream is running does nothing. /* 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 redraw ing the sending graph*/ The following function allows to take into account new parameters by redraw ing the sending graph*/
MS2_PUBLIC void video_stream_update_video_params(VideoStream *stream); MS2_PUBLIC void video_stream_update_video_params(VideoStream *stream);
/*function to call periodically to handle various events */ /*function to call periodically to handle various events */
MS2_PUBLIC void video_stream_iterate(VideoStream *stream); MS2_PUBLIC void video_stream_iterate(VideoStream *stream);
MS2_PUBLIC void video_stream_send_vfu(VideoStream *stream); MS2_PUBLIC void video_stream_send_vfu(VideoStream *stream);
MS2_PUBLIC void video_stream_stop(VideoStream * stream); MS2_PUBLIC void video_stream_stop(VideoStream * stream);
MS2_PUBLIC void video_stream_set_sent_video_size(VideoStream *stream, MSVid eoSize vsize); MS2_PUBLIC void video_stream_set_sent_video_size(VideoStream *stream, MSVid eoSize vsize);
MS2_PUBLIC void video_stream_enable_self_view(VideoStream *stream, bool_t v al); MS2_PUBLIC void video_stream_enable_self_view(VideoStream *stream, bool_t v al);
MS2_PUBLIC unsigned long video_stream_get_native_window_id(VideoStream *str eam); MS2_PUBLIC unsigned long video_stream_get_native_window_id(VideoStream *str eam);
MS2_PUBLIC void video_stream_set_native_window_id(VideoStream *stream, unsi gned long id); MS2_PUBLIC void video_stream_set_native_window_id(VideoStream *stream, unsi gned long id);
MS2_PUBLIC void video_stream_set_native_preview_window_id(VideoStream *stre am, unsigned long id); MS2_PUBLIC void video_stream_set_native_preview_window_id(VideoStream *stre am, unsigned long id);
MS2_PUBLIC unsigned long video_stream_get_native_preview_window_id(VideoStr eam *stream); MS2_PUBLIC unsigned long video_stream_get_native_preview_window_id(VideoStr eam *stream);
MS2_PUBLIC void video_stream_use_preview_video_window(VideoStream *stream, bool_t yesno); MS2_PUBLIC void video_stream_use_preview_video_window(VideoStream *stream, bool_t yesno);
MS2_PUBLIC void video_stream_set_device_rotation(VideoStream *stream, int o rientation); MS2_PUBLIC void video_stream_set_device_rotation(VideoStream *stream, int o rientation);
MS2_PUBLIC void video_stream_show_video(VideoStream *stream, bool_t show); MS2_PUBLIC void video_stream_show_video(VideoStream *stream, bool_t show);
/**
* @brief Gets the camera sensor rotation.
*
* This is needed on some mobile platforms to get the number of degrees the
camera sensor
* is rotated relative to the screen.
*
* @param stream The video stream related to the operation
* @return The camera sensor rotation in degrees (0 to 360) or -1 if it cou
ld not be retrieved
*/
MS2_PUBLIC int video_stream_get_camera_sensor_rotation(VideoStream *stream)
;
/*provided for compatibility, use video_stream_set_direction() instead */ /*provided for compatibility, use video_stream_set_direction() instead */
MS2_PUBLIC int video_stream_recv_only_start(VideoStream *videostream, RtpPr ofile *profile, const char *addr, int port, int used_pt, int jitt_comp); MS2_PUBLIC int video_stream_recv_only_start(VideoStream *videostream, RtpPr ofile *profile, const char *addr, int port, int used_pt, int jitt_comp);
MS2_PUBLIC int video_stream_send_only_start(VideoStream *videostream, MS2_PUBLIC int video_stream_send_only_start(VideoStream *videostream,
RtpProfile *profile, const char *addr, int p ort, int rtcp_port, RtpProfile *profile, const char *addr, int p ort, int rtcp_port,
int used_pt, int jitt_comp, MSWebCam *devic e); int used_pt, int jitt_comp, MSWebCam *devic e);
MS2_PUBLIC void video_stream_recv_only_stop(VideoStream *vs); MS2_PUBLIC void video_stream_recv_only_stop(VideoStream *vs);
MS2_PUBLIC void video_stream_send_only_stop(VideoStream *vs); MS2_PUBLIC void video_stream_send_only_stop(VideoStream *vs);
/* enable ZRTP on the video stream using information from the audio stream */ /* 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); MS2_PUBLIC void video_stream_enable_zrtp(VideoStream *vstream, AudioStream *astream, OrtpZrtpParams *param);
/* enable SRTP on the video stream */ /* enable SRTP on the video stream */
MS2_PUBLIC bool_t video_stream_enable_strp(VideoStream* stream, enum ortp_s static inline bool_t video_stream_enable_strp(VideoStream* stream, enum ort
rtp_crypto_suite_t suite, const char* snd_key, const char* rcv_key); p_srtp_crypto_suite_t suite, const char* snd_key, const char* rcv_key) {
return media_stream_enable_srtp(&stream->ms, suite, snd_key, rcv_key
);
}
/* if enabled, the display filter will internaly rotate the video, accordin
g to the device orientation */
MS2_PUBLIC void video_stream_enable_display_filter_auto_rotate(VideoStream*
stream, bool_t enable);
/* retrieve RTP statistics*/
static inline void video_stream_get_local_rtp_stats(VideoStream *stream, rt
p_stats_t *stats) {
media_stream_get_local_rtp_stats(&stream->ms, stats);
}
static inline int video_stream_set_dscp(VideoStream *stream, int dscp) {
return media_stream_set_dscp(&stream->ms, dscp);
}
/** /**
* Small API to display a local preview window. * Small API to display a local preview window.
**/ **/
typedef VideoStream VideoPreview; typedef VideoStream VideoPreview;
MS2_PUBLIC VideoPreview * video_preview_new(); MS2_PUBLIC VideoPreview * video_preview_new();
#define video_preview_set_size(p,s) video_stream_set_sent_video_size(p,s) #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_dis play_filter_name(p,dt) #define video_preview_set_display_filter_name(p,dt) video_stream_set_dis play_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_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) #define video_preview_get_native_window_id(p) video_stream _get_native_preview_window_id (p)
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);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/**
* @}
**/
#endif #endif
 End of changes. 35 change blocks. 
84 lines changed or deleted 245 lines changed or added


 mscodecutils.h   mscodecutils.h 
skipping to change at line 60 skipping to change at line 60
* @param obj the concealer object * @param obj the concealer object
* @param current_time the current time in milliseconds, as pointed by f->t icker->time. * @param current_time the current time in milliseconds, as pointed by f->t icker->time.
* @param time_increment the number of milliseconds of audio decoded. * @param time_increment the number of milliseconds of audio decoded.
* @param got_packet set to 1 if a real frame was decoded, 0 if it was a PL C frame. * @param got_packet set to 1 if a real frame was decoded, 0 if it was a PL C frame.
* @returns if a PLC period terminates, returns the duration of this PLC pe riod in milliseconds, 0 otherwise. * @returns if a PLC period terminates, returns the duration of this PLC pe riod in milliseconds, 0 otherwise.
**/ **/
MS2_PUBLIC int ms_concealer_inc_sample_time(MSConcealerContext* obj, uint64 _t current_time, int time_increment, int got_packet); MS2_PUBLIC int ms_concealer_inc_sample_time(MSConcealerContext* obj, uint64 _t current_time, int time_increment, int got_packet);
MS2_PUBLIC unsigned long ms_concealer_context_get_total_number_of_plc(MSCon cealerContext* obj); MS2_PUBLIC unsigned long ms_concealer_context_get_total_number_of_plc(MSCon cealerContext* obj);
/**
* Helper object for audio decoders to determine whether PLC (packet loss c
oncealment is needed), based on timestamp information.
**/
typedef struct _MSConcealerTsContext MSConcealerTsContext;
/**
* Creates a new concealer object.
* @param max_plc_count maximum duration of PLC allowed, expressed in times
tamp units.
**/
MS2_PUBLIC MSConcealerTsContext* ms_concealer_ts_context_new(unsigned int m
ax_plc_ts);
/**
* Destroys a concealer object.
**/
MS2_PUBLIC void ms_concealer_ts_context_destroy(MSConcealerTsContext* conte
xt);
/**
* Returns 1 when PLC is needed, 0 otherwise.
* @param obj the concealer object
* @param current_ts the current time converted in timestamp units, usually
(f->ticker->time*clock_rate)/1000 .
**/
MS2_PUBLIC unsigned int ms_concealer_ts_context_is_concealement_required(MS
ConcealerTsContext* obj,uint64_t current_ts);
/**
* Call this function whenever you decoded a packet, for true or in PLC mod
e, to inform the concealer
* of how the audio stream is going.
* @param obj the concealer object
* @param current_ts the current time converted in timestamp units, usually
(f->ticker->time*clock_rate)/1000
* @param ts_increment the duration of audio decoded expressed in timestamp
units
* @param got_packet set to 1 if a real frame was decoded, 0 if it was a PL
C frame.
* @returns if a PLC period terminates, returns the duration of this PLC pe
riod in timestamp units, 0 otherwise.
**/
MS2_PUBLIC int ms_concealer_ts_context_inc_sample_ts(MSConcealerTsContext*
obj, uint64_t current_ts, int ts_increment, int got_packet);
MS2_PUBLIC unsigned long ms_concealer_ts_context_get_total_number_of_plc(MS
ConcealerTsContext* obj);
/*FEC API*/ /*FEC API*/
typedef struct _MSRtpPayloadPickerContext MSRtpPayloadPickerContext; typedef struct _MSRtpPayloadPickerContext MSRtpPayloadPickerContext;
typedef mblk_t* (*RtpPayloadPicker)(MSRtpPayloadPickerContext* context,unsi gned int sequence_number); typedef mblk_t* (*RtpPayloadPicker)(MSRtpPayloadPickerContext* context,unsi gned int sequence_number);
struct _MSRtpPayloadPickerContext { struct _MSRtpPayloadPickerContext {
void* filter_graph_manager; /*I.E stream*/ void* filter_graph_manager; /*I.E stream*/
RtpPayloadPicker picker; RtpPayloadPicker picker;
}; };
#endif #endif
 End of changes. 1 change blocks. 
0 lines changed or deleted 48 lines changed or added


 mscommon.h   mscommon.h 
skipping to change at line 22 skipping to change at line 22
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details. GNU General Public License for more details.
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef mscommon_h #ifndef mscommon_h
#define mscommon_h #define mscommon_h
#include <ortp/ortp.h> #include <ortp/logging.h>
#include <ortp/port.h>
#include <ortp/str_utils.h>
#include <ortp/payloadtype.h>
#include <time.h> #include <time.h>
#if defined(__APPLE__) #if defined(__APPLE__)
#include "TargetConditionals.h" #include "TargetConditionals.h"
#endif #endif
#define MS_UNUSED(x) ((void)(x))
#define ms_malloc ortp_malloc #define ms_malloc ortp_malloc
#define ms_malloc0 ortp_malloc0 #define ms_malloc0 ortp_malloc0
#define ms_realloc ortp_realloc #define ms_realloc ortp_realloc
#define ms_new ortp_new #define ms_new ortp_new
#define ms_new0 ortp_new0 #define ms_new0 ortp_new0
#define ms_free ortp_free #define ms_free ortp_free
#define ms_strdup ortp_strdup #define ms_strdup ortp_strdup
#define ms_strdup_printf ortp_strdup_printf #define ms_strdup_printf ortp_strdup_printf
#define ms_mutex_t ortp_mutex_t #define ms_mutex_t ortp_mutex_t
skipping to change at line 99 skipping to change at line 104
#define ms_return_val_if_fail(_expr_,_ret_)\ #define ms_return_val_if_fail(_expr_,_ret_)\
if (!(_expr_)) { ms_error("assert "#_expr_ "failed"); return (_ret_) ;} if (!(_expr_)) { ms_error("assert "#_expr_ "failed"); return (_ret_) ;}
#define ms_return_if_fail(_expr_) \ #define ms_return_if_fail(_expr_) \
if (!(_expr_)){ ms_error("assert "#_expr_ "failed"); return ;} if (!(_expr_)){ ms_error("assert "#_expr_ "failed"); return ;}
#define ms_thread_t ortp_thread_t #define ms_thread_t ortp_thread_t
#define ms_thread_create ortp_thread_create #define ms_thread_create ortp_thread_create
#define ms_thread_join ortp_thread_join #define ms_thread_join ortp_thread_join
typedef struct MSTimeSpec{ typedef ortpTimeSpec MSTimeSpec;
int64_t tv_sec;
int64_t tv_nsec; #define ms_get_cur_time ortp_get_cur_time
}MSTimeSpec;
struct _MSList { struct _MSList {
struct _MSList *next; struct _MSList *next;
struct _MSList *prev; struct _MSList *prev;
void *data; void *data;
}; };
typedef struct _MSList MSList; typedef struct _MSList MSList;
#define ms_list_next(elem) ((elem)->next) #define ms_list_next(elem) ((elem)->next)
typedef int (*MSCompareFunc)(const void *a, const void *b); typedef int (*MSCompareFunc)(const void *a, const void *b);
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
void ms_thread_exit(void* ret_val); MS2_PUBLIC void ms_thread_exit(void* ret_val);
MS2_PUBLIC void ms_get_cur_time(MSTimeSpec *ret);
MS2_PUBLIC MSList * ms_list_append(MSList *elem, void * data); MS2_PUBLIC MSList * ms_list_append(MSList *elem, void * data);
MS2_PUBLIC MSList *ms_list_append_link(MSList *elem, MSList *new_elem);
MS2_PUBLIC MSList * ms_list_prepend(MSList *elem, void * data); MS2_PUBLIC MSList * ms_list_prepend(MSList *elem, void * data);
MS2_PUBLIC MSList * ms_list_free(MSList *elem); MS2_PUBLIC MSList * ms_list_free(MSList *elem);
MS2_PUBLIC MSList * ms_list_concat(MSList *first, MSList *second); MS2_PUBLIC MSList * ms_list_concat(MSList *first, MSList *second);
MS2_PUBLIC MSList * ms_list_remove(MSList *first, void *data); MS2_PUBLIC MSList * ms_list_remove(MSList *first, void *data);
MS2_PUBLIC int ms_list_size(const MSList *first); MS2_PUBLIC int ms_list_size(const MSList *first);
MS2_PUBLIC void ms_list_for_each(const MSList *list, void (*func)(void *)); MS2_PUBLIC void ms_list_for_each(const MSList *list, void (*func)(void *));
MS2_PUBLIC void ms_list_for_each2(const MSList *list, void (*func)(void *, void *), void *user_data); MS2_PUBLIC void ms_list_for_each2(const MSList *list, void (*func)(void *, void *), void *user_data);
MS2_PUBLIC MSList *ms_list_remove_link(MSList *list, MSList *elem); MS2_PUBLIC MSList *ms_list_remove_link(MSList *list, MSList *elem);
MS2_PUBLIC MSList *ms_list_find(MSList *list, void *data); MS2_PUBLIC MSList *ms_list_find(MSList *list, void *data);
MS2_PUBLIC MSList *ms_list_find_custom(MSList *list, MSCompareFunc compare_ func, const void *user_data); MS2_PUBLIC MSList *ms_list_find_custom(MSList *list, MSCompareFunc compare_ func, const void *user_data);
skipping to change at line 161 skipping to change at line 165
* *
*/ */
/** /**
* @defgroup mediastreamer2_init Init API - manage mediastreamer2 library. * @defgroup mediastreamer2_init Init API - manage mediastreamer2 library.
* @ingroup mediastreamer2_api * @ingroup mediastreamer2_api
* @{ * @{
*/ */
/** /**
* Initialize the mediastreamer2 library. * Helper macro for backward compatibility.
* Use ms_base_init() and ms_voip_init() instead.
*/
#define ms_init() ms_base_init(), ms_voip_init(), ms_plugins_init()
/**
* Helper macro for backward compatibility.
* Use ms_base_exit() and ms_voip_exit() instead.
*/
#define ms_exit() ms_voip_exit(), ms_base_exit()
/**
* Initialize the mediastreamer2 base library.
* *
* This must be called once before calling any other API. * This must be called once before calling any other API.
*/ */
MS2_PUBLIC void ms_init(void); MS2_PUBLIC void ms_base_init(void);
/**
* Initialize the mediastreamer2 VoIP library.
*
* This must be called one before calling any other API.
*/
MS2_PUBLIC void ms_voip_init(void);
/**
* Load the plugins from the default plugin directory.
*
* This is just a wrapper around ms_load_plugins().
* This must be called after ms_base_init() and after ms_voip_init().
*/
MS2_PUBLIC void ms_plugins_init(void);
/** /**
* Load plugins from a specific directory. * Load plugins from a specific directory.
* This method basically loads all libraries in the specified directory and attempts to call a C function called * This method basically loads all libraries in the specified directory and attempts to call a C function called
* \<libraryname\>_init. For example if a library 'libdummy.so' or 'libdumm y.dll' is found, then the loader tries to locate * \<libraryname\>_init. For example if a library 'libdummy.so' or 'libdumm y.dll' is found, then the loader tries to locate
* a C function called 'libdummy_init()' and calls it if it exists. * a C function called 'libdummy_init()' and calls it if it exists.
* ms_load_plugins() can be used to load non-mediastreamer2 plugins as it d oes not expect mediastreamer2 specific entry points. * ms_load_plugins() can be used to load non-mediastreamer2 plugins as it d oes not expect mediastreamer2 specific entry points.
* *
* @param directory A directory where plugins library are available. * @param directory A directory where plugins library are available.
* *
* Returns: >0 if successfull, 0 if not plugins loaded, -1 otherwise. * Returns: >0 if successfull, 0 if not plugins loaded, -1 otherwise.
*/ */
MS2_PUBLIC int ms_load_plugins(const char *directory); MS2_PUBLIC int ms_load_plugins(const char *directory);
/** /**
* Release resource allocated in the mediastreamer2 library. * Release resource allocated in the mediastreamer2 base library.
* *
* This must be called once before closing program. * This must be called once before closing program.
*/ */
MS2_PUBLIC void ms_exit(void); MS2_PUBLIC void ms_base_exit(void);
/**
* Release resource allocated in the mediastreamer2 VoIP library.
*
* This must be called once before closing program.
*/
MS2_PUBLIC void ms_voip_exit(void);
struct _MSSndCardDesc; struct _MSSndCardDesc;
MS2_PUBLIC void ms_sleep(int seconds); MS2_PUBLIC void ms_sleep(int seconds);
MS2_PUBLIC void ms_usleep(uint64_t usec); MS2_PUBLIC void ms_usleep(uint64_t usec);
/** /**
* The max payload size allowed. * The max payload size allowed.
* Filters that generate data that can be sent through RTP should make pack ets * Filters that generate data that can be sent through RTP should make pack ets
skipping to change at line 220 skipping to change at line 258
**/ **/
MS2_PUBLIC int ms_discover_mtu(const char *destination_host); MS2_PUBLIC int ms_discover_mtu(const char *destination_host);
/** /**
* Set mediastreamer default mtu, used to compute the default RTP max paylo ad size. * Set mediastreamer default mtu, used to compute the default RTP max paylo ad size.
* This function will call ms_set_payload_max_size(mtu-[ipv6 header size]). * This function will call ms_set_payload_max_size(mtu-[ipv6 header size]).
**/ **/
MS2_PUBLIC void ms_set_mtu(int mtu); MS2_PUBLIC void ms_set_mtu(int mtu);
/** /**
* Get mediastreamer default mtu, used to compute the default RTP max paylo
ad size.
**/
MS2_PUBLIC int ms_get_mtu(void);
/**
* Declare how many cpu (cores) are available on the platform * Declare how many cpu (cores) are available on the platform
*/ */
MS2_PUBLIC void ms_set_cpu_count(unsigned int c); MS2_PUBLIC void ms_set_cpu_count(unsigned int c);
MS2_PUBLIC unsigned int ms_get_cpu_count(); MS2_PUBLIC unsigned int ms_get_cpu_count();
/** @} */ /** @} */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#ifdef MS2_INTERNAL #ifdef MS2_INTERNAL
# ifdef HAVE_CONFIG_H # ifdef HAVE_CONFIG_H
# include "mediastreamer-config.h" /*necessary to know if ENABLE_NLS is th ere*/ # include "mediastreamer-config.h" /*necessary to know if ENABLE_NLS is th ere*/
# endif # endif
#ifdef WIN32
#include <malloc.h> //for alloca
#ifdef _MSC_VER
#define alloca _alloca
#endif
#endif
# if defined(ENABLE_NLS) # if defined(ENABLE_NLS)
# include <libintl.h> # include <libintl.h>
# define _(String) dgettext (GETTEXT_PACKAGE, String) # define _(String) dgettext (GETTEXT_PACKAGE, String)
# else # else
# define _(String) (String) # define _(String) (String)
# endif // ENABLE_NLS # endif // ENABLE_NLS
#define N_(String) (String) #define N_(String) (String)
#endif // MS2_INTERNAL #endif // MS2_INTERNAL
#ifdef ANDROID #ifdef ANDROID
 End of changes. 11 change blocks. 
11 lines changed or deleted 63 lines changed or added


 msconference.h   msconference.h 
skipping to change at line 147 skipping to change at line 147
* Then, create a MSAudioEndpoint representing this participant by calling ms_audio_endpoint_get_from_stream() with * Then, create a MSAudioEndpoint representing this participant by calling ms_audio_endpoint_get_from_stream() with
* is_remote=TRUE. * is_remote=TRUE.
* *
* To create a local participant, first create and start an AudioStream wit h audio_stream_new() and audio_stream_start_full(), * To create a local participant, first create and start an AudioStream wit h audio_stream_new() and audio_stream_start_full(),
* with real soundcard arguments. * with real soundcard arguments.
* Arguments controlling RTP should be filled with placeholders value and w ill not be used for conferencing. * Arguments controlling RTP should be filled with placeholders value and w ill not be used for conferencing.
* Then, create a MSAudioEndpoint representing this local participant by ca lling ms_audio_endpoint_get_from_stream() * Then, create a MSAudioEndpoint representing this local participant by ca lling ms_audio_endpoint_get_from_stream()
* with the audiostream and is_remote=FALSE.<br> * with the audiostream and is_remote=FALSE.<br>
* For example:<br> * For example:<br>
* <PRE> * <PRE>
* AudioStream *st=audio_stream_new(65000,FALSE); * AudioStream *st=audio_stream_new(65000,65001,FALSE);
* audio_stream_start_full(st, conf->local_dummy_profile, * audio_stream_start_full(st, conf->local_dummy_profile,
* "127.0.0.1", * "127.0.0.1",
* 65000, * 65000,
* "127.0.0.1",
* 65001, * 65001,
* 0, * 0,
* 40, * 40,
* NULL, * NULL,
* NULL, * NULL,
* playcard, * playcard,
* captcard, * captcard,
* needs_echocancellation, * needs_echocancellation,
* ); * );
* MSAudioEndpoint *local_endpoint=ms_audio_endpoint_get_from_stream(st,FAL SE); * MSAudioEndpoint *local_endpoint=ms_audio_endpoint_get_from_stream(st,FAL SE);
* </PRE> * </PRE>
**/ **/
MS2_PUBLIC MSAudioEndpoint * ms_audio_endpoint_get_from_stream(AudioStream *st, bool_t is_remote); MS2_PUBLIC MSAudioEndpoint * ms_audio_endpoint_get_from_stream(AudioStream *st, bool_t is_remote);
/** /**
* Destroys a MSAudioEndpoint that was created from an AudioStream with ms_ audio_endpoint_get_from_stream(). * Destroys a MSAudioEndpoint that was created from an AudioStream with ms_ audio_endpoint_get_from_stream().
* The AudioStream can then be destroyed if needed. * The AudioStream can then be destroyed if needed.
**/ **/
MS2_PUBLIC void ms_audio_endpoint_release_from_stream(MSAudioEndpoint *obj) ; MS2_PUBLIC void ms_audio_endpoint_release_from_stream(MSAudioEndpoint *obj) ;
/**
* Creates an audio endpoint (or virtual participant) to record the confere
nce into a wav file.
* @param path Path to the wav file to record.
**/
MS2_PUBLIC MSAudioEndpoint * ms_audio_endpoint_new_recorder(void);
/**
* Start audio recording.
* The endpoint must have been created by ms_audio_endpoint_new_recorder().
* @param ep the endpoint
* @param path path for the wav file where to record samples.
* @return 0 if successful, -1 if the path is invalid.
**/
MS2_PUBLIC int ms_audio_recorder_endpoint_start(MSAudioEndpoint *ep, const
char *path);
/**
* Stop audio recording.
* The endpoint must have been created by ms_audio_endpoint_new_recorder().
* @param ep the endpoint
* @return 0 if successful, -1 if the record wasn't started.
**/
MS2_PUBLIC int ms_audio_recorder_endpoint_stop(MSAudioEndpoint *ep);
/**
* Destroy an audio endpoint.
* @note Endpoints created by ms_audio_endpoint_get_from_stream() must be r
eleased by ms_audio_endpoint_release_from_stream().
**/
MS2_PUBLIC void ms_audio_endpoint_destroy(MSAudioEndpoint *ep);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** /**
* @} * @}
*/ */
#endif #endif
 End of changes. 3 change blocks. 
1 lines changed or deleted 34 lines changed or added


 msfilter.h   msfilter.h 
skipping to change at line 83 skipping to change at line 83
/** /**
* Filter's category * Filter's category
* *
*/ */
enum _MSFilterCategory{ enum _MSFilterCategory{
/**others*/ /**others*/
MS_FILTER_OTHER, MS_FILTER_OTHER,
/**used by encoders*/ /**used by encoders*/
MS_FILTER_ENCODER, MS_FILTER_ENCODER,
/**used by decoders*/ /**used by decoders*/
MS_FILTER_DECODER MS_FILTER_DECODER,
/**used by capture filters that perform encoding*/
MS_FILTER_ENCODING_CAPTURER,
/**used by render filters that perform decoding*/
MS_FILTER_DECODING_RENDERER
}; };
/** /**
* Structure to describe filter's category. * Structure to describe filter's category.
* <PRE> * <PRE>
* MS_FILTER_OTHER * MS_FILTER_OTHER
* MS_FILTER_ENCODER * MS_FILTER_ENCODER
* MS_FILTER_DECODER * MS_FILTER_DECODER
* MS_FILTER_ENCODING_CAPTURER
* MS_FILTER_DECODING_RENDERER
* </PRE> * </PRE>
* @var MSFilterCategory * @var MSFilterCategory
*/ */
typedef enum _MSFilterCategory MSFilterCategory; typedef enum _MSFilterCategory MSFilterCategory;
/**
* Filter's flags controlling special behaviours.
**/
enum _MSFilterFlags{ enum _MSFilterFlags{
MS_FILTER_IS_PUMP = 1 MS_FILTER_IS_PUMP = 1 /**< The filter must be called in process func tion every tick.*/
}; };
/**
* Filter's flags controlling special behaviours.
**/
typedef enum _MSFilterFlags MSFilterFlags; typedef enum _MSFilterFlags MSFilterFlags;
struct _MSFilterStats{ struct _MSFilterStats{
const char *name; /*<filter name*/ const char *name; /*<filter name*/
uint64_t elapsed; /*<cumulative number of nanoseconds elapsed */ uint64_t elapsed; /*<cumulative number of nanoseconds elapsed */
unsigned int count; /*<number of time the filter is called for proce ssing*/ unsigned int count; /*<number of time the filter is called for proce ssing*/
}; };
typedef struct _MSFilterStats MSFilterStats; typedef struct _MSFilterStats MSFilterStats;
struct _MSFilterDesc{ struct _MSFilterDesc{
MSFilterId id; /* the id declared in allfilters.h */ MSFilterId id; /**< the id declared in allfilters.h */
const char *name; /* filter name */ const char *name; /**< the filter name*/
const char *text; /*some descriptive text*/ const char *text; /**< short text describing the filter's function*/
MSFilterCategory category; MSFilterCategory category; /**< filter's category*/
const char *enc_fmt; /* must be set if MS_FILTER_ENCODER/MS_FILTER_D const char *enc_fmt; /**< sub-mime of the format, must be set if cat
ECODER */ egory is MS_FILTER_ENCODER or MS_FILTER_DECODER */
int ninputs; /*number of inputs */ int ninputs; /**< number of inputs */
int noutputs; /*number of outputs */ int noutputs; /**< number of outputs */
MSFilterFunc init; MSFilterFunc init; /**< Filter's init function*/
MSFilterFunc preprocess; /* called once before processing */ MSFilterFunc preprocess; /**< Filter's preprocess function, called o
MSFilterFunc process; /* called every tick to do the filte ne time before starting to process*/
r's job*/ MSFilterFunc process; /**< Filter's process function, called every t
MSFilterFunc postprocess; /*called once after processing */ ick by the MSTicker to do the filter's job*/
MSFilterFunc uninit; MSFilterFunc postprocess; /**< Filter's postprocess function, called
MSFilterMethod *methods; once after processing (the filter is no longer called in process() after)*
unsigned int flags; /
MSFilterFunc uninit; /**< Filter's uninit function, used to dealloca
te internal structures*/
MSFilterMethod *methods; /**<Filter's method table*/
unsigned int flags; /**<Filter's special flags, from the MSFilterFla
gs enum.*/
}; };
/** /**
* Structure for filter's description. * Structure for filter's description.
* @var MSFilterDesc * @var MSFilterDesc
*/ */
typedef struct _MSFilterDesc MSFilterDesc; typedef struct _MSFilterDesc MSFilterDesc;
struct _MSFilter{ struct _MSFilter{
MSFilterDesc *desc; MSFilterDesc *desc; /**<Back pointer to filter's descriptor.*/
/*protected attributes */ /*protected attributes */
ms_mutex_t lock; ms_mutex_t lock;
MSQueue **inputs; MSQueue **inputs; /**<Table of input queues.*/
MSQueue **outputs; MSQueue **outputs;/**<Table of output queues */
MSFilterNotifyFunc notify; MSFilterNotifyFunc notify;
void *notify_ud; void *notify_ud;
void *data; void *data; /**<Pointer used by the filter for internal state and co
struct _MSTicker *ticker; mputations.*/
struct _MSTicker *ticker; /**<Pointer to the ticker object. It is no
t NULL when being called process()*/
/*private attributes */ /*private attributes */
uint32_t last_tick; uint32_t last_tick;
MSFilterStats *stats; MSFilterStats *stats;
int postponed_task; /*number of postponed tasks*/
bool_t seen; bool_t seen;
}; };
/** /**
* Structure to create/link/unlink/destroy filter's object. * Structure of filter's object.
* @var MSFilter * @var MSFilter
*/ */
typedef struct _MSFilter MSFilter; typedef struct _MSFilter MSFilter;
struct _MSConnectionPoint{ struct _MSConnectionPoint{
MSFilter *filter; MSFilter *filter; /**<Pointer to filter*/
int pin; int pin; /**<Pin index on the filter*/
}; };
/** /**
* Structure that represents a connection point of a MSFilter * Structure that represents a connection point of a MSFilter
* @var MSConnectionPoint * @var MSConnectionPoint
*/ */
typedef struct _MSConnectionPoint MSConnectionPoint; typedef struct _MSConnectionPoint MSConnectionPoint;
struct _MSConnectionHelper{ struct _MSConnectionHelper{
MSConnectionPoint last; MSConnectionPoint last;
skipping to change at line 200 skipping to change at line 213
* ms_filter_create_encoder, ms_filter_create_decoder * ms_filter_create_encoder, ms_filter_create_decoder
* and ms_filter_codec_supported * and ms_filter_codec_supported
* can then be used as if the codec was internally. * can then be used as if the codec was internally.
* supported. * supported.
* *
* @param desc a filter description. * @param desc a filter description.
*/ */
MS2_PUBLIC void ms_filter_register(MSFilterDesc *desc); MS2_PUBLIC void ms_filter_register(MSFilterDesc *desc);
/** /**
* Retrieve capture filter that supports encoding to codec name.
*
* @param mime A string indicating the codec.
*
* Returns: a MSFilterDesc if successfull, NULL otherwise.
*/
MS2_PUBLIC MSFilterDesc * ms_filter_get_encoding_capturer(const char *mime)
;
/**
* Retrieve render filter that supports decoding to codec name.
*
* @param mime A string indicating the codec.
*
* Returns: a MSFilterDesc if successfull, NULL otherwise.
*/
MS2_PUBLIC MSFilterDesc * ms_filter_get_decoding_renderer(const char *mime)
;
/**
* Retrieve encoders according to codec name. * Retrieve encoders according to codec name.
* *
* Internal supported codecs: * Internal supported codecs:
* PCMU, PCMA, speex, gsm * PCMU, PCMA, speex, gsm
* Existing Public plugins: * Existing Public plugins:
* iLBC * iLBC
* *
* @param mime A string indicating the codec. * @param mime A string indicating the codec.
* *
* Returns: a MSFilterDesc if successfull, NULL otherwise. * Returns: a MSFilterDesc if successfull, NULL otherwise.
skipping to change at line 488 skipping to change at line 519
* *
**/ **/
MS2_PUBLIC void ms_filter_log_statistics(void); MS2_PUBLIC void ms_filter_log_statistics(void);
/* I define the id taking the lower bits of the address of the MSFilterDesc object, /* I define the id taking the lower bits of the address of the MSFilterDesc object,
the method index (_cnt_) and the argument size */ the method index (_cnt_) and the argument size */
/* I hope using this to avoid type mismatch (calling a method on the wrong filter)*/ /* I hope using this to avoid type mismatch (calling a method on the wrong filter)*/
#define MS_FILTER_METHOD_ID(_id_,_cnt_,_argsize_) \ #define MS_FILTER_METHOD_ID(_id_,_cnt_,_argsize_) \
( (((unsigned long)(_id_)) & 0xFFFF)<<16 | (_cnt_<<8) | (_argsize_ & 0xFF )) ( (((unsigned long)(_id_)) & 0xFFFF)<<16 | (_cnt_<<8) | (_argsize_ & 0xFF ))
/**
* Macro to create a method id, unique per filter.
* First argument shall be the filter's ID (MSFilterId) or interface ID (MS
FilterInterfaceId).
* Second argument is the method index within the context of the filter. It
should start from 0 and increment for each new method.
* Third argument is the argument type of the method, for example "int", "f
loat" or any structure.
**/
#define MS_FILTER_METHOD(_id_,_count_,_argtype_) \ #define MS_FILTER_METHOD(_id_,_count_,_argtype_) \
MS_FILTER_METHOD_ID(_id_,_count_,sizeof(_argtype_)) MS_FILTER_METHOD_ID(_id_,_count_,sizeof(_argtype_))
/**
* Same as MS_FILTER_METHOD, but for method that do not take any argument.
**/
#define MS_FILTER_METHOD_NO_ARG(_id_,_count_) \ #define MS_FILTER_METHOD_NO_ARG(_id_,_count_) \
MS_FILTER_METHOD_ID(_id_,_count_,0) MS_FILTER_METHOD_ID(_id_,_count_,0)
#define MS_FILTER_BASE_METHOD(_count_,_argtype_) \ #define MS_FILTER_BASE_METHOD(_count_,_argtype_) \
MS_FILTER_METHOD_ID(MS_FILTER_BASE_ID,_count_,sizeof(_argtype_)) MS_FILTER_METHOD_ID(MS_FILTER_BASE_ID,_count_,sizeof(_argtype_))
#define MS_FILTER_BASE_METHOD_NO_ARG(_count_) \ #define MS_FILTER_BASE_METHOD_NO_ARG(_count_) \
MS_FILTER_METHOD_ID(MS_FILTER_BASE_ID,_count_,0) MS_FILTER_METHOD_ID(MS_FILTER_BASE_ID,_count_,0)
#define MS_FILTER_EVENT(_id_,_count_,_argtype_) \ #define MS_FILTER_EVENT(_id_,_count_,_argtype_) \
skipping to change at line 539 skipping to change at line 579
* Set codec dependent attributes as taken from the SDP * Set codec dependent attributes as taken from the SDP
*/ */
#define MS_FILTER_ADD_FMTP MS_FILTER_BASE_METHOD(7,const char) #define MS_FILTER_ADD_FMTP MS_FILTER_BASE_METHOD(7,const char)
#define MS_FILTER_ADD_ATTR MS_FILTER_BASE_METHOD(8,const char) #define MS_FILTER_ADD_ATTR MS_FILTER_BASE_METHOD(8,const char)
#define MS_FILTER_SET_MTU MS_FILTER_BASE_METHOD(9,int) #define MS_FILTER_SET_MTU MS_FILTER_BASE_METHOD(9,int)
#define MS_FILTER_GET_MTU MS_FILTER_BASE_METHOD(10,int) #define MS_FILTER_GET_MTU MS_FILTER_BASE_METHOD(10,int)
/**Filters can return their latency in milliseconds (if known) using this m ethod:*/ /**Filters can return their latency in milliseconds (if known) using this m ethod:*/
#define MS_FILTER_GET_LATENCY MS_FILTER_BASE_METHOD(11,int) #define MS_FILTER_GET_LATENCY MS_FILTER_BASE_METHOD(11,int)
/**
* Interface IDs, used to generate method names (see MS_FILTER_METHOD macro
).
* The purpose of these interfaces is to allow different filter implementat
ions to share the same methods, by implementing the method definitions for
these interfaces.
* For example every video encoder implementation would need a method to re
quest the generation of a key frame. Instead of having each implementation
defining its own method to do this,
* each implementation can just implement the MS_VIDEO_ENCODER_REQ_VFU meth
od of the MSFilterVideoEncoderInterface.
**/
enum _MSFilterInterfaceId{ enum _MSFilterInterfaceId{
MSFilterInterfaceBegin=16384, MSFilterInterfaceBegin=16384,
MSFilterPlayerInterface, MSFilterPlayerInterface, /**<Player interface, used to control playi
MSFilterRecorderInterface, ng of files.*/
MSFilterVideoDisplayInterface, MSFilterRecorderInterface,/**<Recorder interface, used to control re
MSFilterEchoCancellerInterface, cording of stream into files.*/
MSFilterVideoDecoderInterface, MSFilterVideoDisplayInterface,/**<Video display interface, used to c
MSFilterVideoCaptureInterface, ontrol the rendering of raw pictures onscreen.*/
MSFilterEchoCancellerInterface,/**Echo canceller interface, used to
control echo canceller implementations.*/
MSFilterVideoDecoderInterface,/**<Video decoder interface*/
MSFilterVideoCaptureInterface,/**<Video capture interface*/
MSFilterAudioDecoderInterface,/**<Audio Decoder interface*/
MSFilterVideoEncoderInterface,/**<Video encoder interface*/
MSFilterAudioCaptureInterface,/**<Interface for audio capture filter
s*/
MSFilterAudioPlaybackInterface,/**Interface for audio playback filte
rs.*/
MSFilterAudioEncoderInterface,/**<Video encoder interface*/
}; };
/**
* Interface IDs, used to generate method names (see MS_FILTER_METHOD macro
).
*
**/
typedef enum _MSFilterInterfaceId MSFilterInterfaceId; typedef enum _MSFilterInterfaceId MSFilterInterfaceId;
/* more specific methods: to be moved into implementation specific header f iles*/ /* more specific methods: to be moved into implementation specific header f iles*/
#define MS_FILTER_SET_FILTERLENGTH MS_FILTER_BASE_METHOD(12,int) #define MS_FILTER_SET_FILTERLENGTH MS_FILTER_BASE_METHOD(12,int)
#define MS_FILTER_SET_OUTPUT_SAMPLE_RATE MS_FILTER_BASE_METHOD(13,int) #define MS_FILTER_SET_OUTPUT_SAMPLE_RATE MS_FILTER_BASE_METHOD(13,int)
#define MS_FILTER_ENABLE_DIRECTMODE MS_FILTER_BASE_METHOD(14,int) #define MS_FILTER_ENABLE_DIRECTMODE MS_FILTER_BASE_METHOD(14,int)
#define MS_FILTER_ENABLE_VAD MS_FILTER_BASE_METHOD(15,int) #define MS_FILTER_ENABLE_VAD MS_FILTER_BASE_METHOD(15,int)
#define MS_FILTER_GET_STAT_DISCARDED MS_FILTER_BASE_METHOD(16,int) #define MS_FILTER_GET_STAT_DISCARDED MS_FILTER_BASE_METHOD(16,int)
#define MS_FILTER_GET_STAT_MISSED MS_FILTER_BASE_METHOD(17,int) #define MS_FILTER_GET_STAT_MISSED MS_FILTER_BASE_METHOD(17,int)
#define MS_FILTER_GET_STAT_INPUT MS_FILTER_BASE_METHOD(18,int) #define MS_FILTER_GET_STAT_INPUT MS_FILTER_BASE_METHOD(18,int)
#define MS_FILTER_GET_STAT_OUTPUT MS_FILTER_BASE_METHOD(19,int) #define MS_FILTER_GET_STAT_OUTPUT MS_FILTER_BASE_METHOD(19,int)
#define MS_FILTER_ENABLE_AGC MS_FILTER_BASE_METHOD(20,int) #define MS_FILTER_ENABLE_AGC MS_FILTER_BASE_METHOD(20,int)
#define MS_FILTER_SET_PLAYBACKDELAY MS_FILTER_BASE_METHOD(21,int) #define MS_FILTER_SET_PLAYBACKDELAY MS_FILTER_BASE_METHOD(21,int)
#define MS_FILTER_ENABLE_HALFDUPLEX MS_FILTER_BASE_METHOD(22,int) #define MS_FILTER_ENABLE_HALFDUPLEX MS_FILTER_BASE_METHOD(22,int)
#define MS_FILTER_SET_VAD_PROB_START MS_FILTER_BASE_METHOD(23,int) #define MS_FILTER_SET_VAD_PROB_START MS_FILTER_BASE_METHOD(23,int)
#define MS_FILTER_SET_VAD_PROB_CONTINUE MS_FILTER_BASE_METHOD(24,int) #define MS_FILTER_SET_VAD_PROB_CONTINUE MS_FILTER_BASE_METHOD(24,int)
#define MS_FILTER_SET_MAX_GAIN MS_FILTER_BASE_METHOD(25,int) #define MS_FILTER_SET_MAX_GAIN MS_FILTER_BASE_METHOD(25,int)
#define MS_VIDEO_CAPTURE_SET_AUTOFOCUS MS_FILTER_BASE_METHOD(26,int) #define MS_VIDEO_CAPTURE_SET_AUTOFOCUS MS_FILTER_BASE_METHOD(26,int)
/* pass value of type MSRtpPayloadPickerContext copied by the filter*/ /* pass value of type MSRtpPayloadPickerContext copied by the filter*/
#define MS_FILTER_SET_RTP_PAYLOAD_PICKER MS_FILTER_BASE_METHOD(27,void*) #define MS_FILTER_SET_RTP_PAYLOAD_PICKER MS_FILTER_BASE_METHOD(27,void*)
#define MS_FILTER_SET_OUTPUT_NCHANNELS MS_FILTER_BASE_METHOD(28,int)
#define MS_CONF_SPEEX_PREPROCESS_MIC MS_FILTER_EVENT(MS_CONF_ID, 1, void* ) #define MS_CONF_SPEEX_PREPROCESS_MIC MS_FILTER_EVENT(MS_CONF_ID, 1, void* )
#define MS_CONF_CHANNEL_VOLUME MS_FILTER_EVENT(MS_CONF_ID, 3, void*) #define MS_CONF_CHANNEL_VOLUME MS_FILTER_EVENT(MS_CONF_ID, 3, void*)
/** @} */ /** @} */
/*protected/ private methods*/ /*protected/ private methods*/
void ms_filter_process(MSFilter *f); void ms_filter_process(MSFilter *f);
void ms_filter_preprocess(MSFilter *f, struct _MSTicker *t); void ms_filter_preprocess(MSFilter *f, struct _MSTicker *t);
void ms_filter_postprocess(MSFilter *f); void ms_filter_postprocess(MSFilter *f);
bool_t ms_filter_inputs_have_data(MSFilter *f); bool_t ms_filter_inputs_have_data(MSFilter *f);
void ms_filter_notify(MSFilter *f, unsigned int id, void *arg); void ms_filter_notify(MSFilter *f, unsigned int id, void *arg);
void ms_filter_notify_synchronous(MSFilter *f, unsigned int id, void *arg); void ms_filter_notify_synchronous(MSFilter *f, unsigned int id, void *arg);
void ms_filter_notify_no_arg(MSFilter *f, unsigned int id); void ms_filter_notify_no_arg(MSFilter *f, unsigned int id);
#define ms_filter_lock(f) ms_mutex_lock(&(f)->lock) #define ms_filter_lock(f) ms_mutex_lock(&(f)->lock)
#define ms_filter_unlock(f) ms_mutex_unlock(&(f)->lock) #define ms_filter_unlock(f) ms_mutex_unlock(&(f)->lock)
void ms_filter_unregister_all(void); void ms_filter_unregister_all(void);
struct _MSFilterTask{
MSFilter *f;
MSFilterFunc taskfunc;
};
typedef struct _MSFilterTask MSFilterTask;
void ms_filter_task_process(MSFilterTask *task);
/**
* Allow a filter to request the ticker to call him the tick after.
* The ticker will call the taskfunc prior to all filter's process func.
**/
void ms_filter_postpone_task(MSFilter *f, MSFilterFunc taskfunc);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#include "msinterfaces.h" #include "msinterfaces.h"
/* used by awk script in Makefile.am to generate alldescs.c */ /* used by awk script in Makefile.am to generate alldescs.c */
#define MS_FILTER_DESC_EXPORT(desc) #define MS_FILTER_DESC_EXPORT(desc)
#endif #endif
 End of changes. 20 change blocks. 
32 lines changed or deleted 126 lines changed or added


 msinterfaces.h   msinterfaces.h 
skipping to change at line 27 skipping to change at line 27
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef msinterfaces_h #ifndef msinterfaces_h
#define msinterfaces_h #define msinterfaces_h
/** /**
* Interface definition for video display filters. * Interface definition for video display filters.
**/ **/
typedef struct _MSVideoDisplayDecodingSupport MSVideoDisplayDecodingSupport
;
struct _MSVideoDisplayDecodingSupport {
const char *mime_type; /**< Input parameter to asking if the displa
y supports decoding of this mime type */
bool_t supported; /**< Output telling whether the display supp
orts decoding to the specified mime type */
};
/** whether the video window should be resized to the stream's resolution*/ /** whether the video window should be resized to the stream's resolution*/
#define MS_VIDEO_DISPLAY_ENABLE_AUTOFIT \ #define MS_VIDEO_DISPLAY_ENABLE_AUTOFIT \
MS_FILTER_METHOD(MSFilterVideoDisplayInterface,0,int) MS_FILTER_METHOD(MSFilterVideoDisplayInterface,0,int)
/**position of the local view */ /**position of the local view */
#define MS_VIDEO_DISPLAY_SET_LOCAL_VIEW_MODE \ #define MS_VIDEO_DISPLAY_SET_LOCAL_VIEW_MODE \
MS_FILTER_METHOD(MSFilterVideoDisplayInterface,1,int) MS_FILTER_METHOD(MSFilterVideoDisplayInterface,1,int)
/**whether the video should be reversed as in mirror */ /**whether the video should be reversed as in mirror */
#define MS_VIDEO_DISPLAY_ENABLE_MIRRORING \ #define MS_VIDEO_DISPLAY_ENABLE_MIRRORING \
skipping to change at line 59 skipping to change at line 66
MS_FILTER_METHOD(MSFilterVideoDisplayInterface,5,float) MS_FILTER_METHOD(MSFilterVideoDisplayInterface,5,float)
/**Set the background colour for video window */ /**Set the background colour for video window */
#define MS_VIDEO_DISPLAY_SET_BACKGROUND_COLOR \ #define MS_VIDEO_DISPLAY_SET_BACKGROUND_COLOR \
MS_FILTER_METHOD(MSFilterVideoDisplayInterface,8,int[3]) MS_FILTER_METHOD(MSFilterVideoDisplayInterface,8,int[3])
/**Show video. Useful to free XV port */ /**Show video. Useful to free XV port */
#define MS_VIDEO_DISPLAY_SHOW_VIDEO \ #define MS_VIDEO_DISPLAY_SHOW_VIDEO \
MS_FILTER_METHOD(MSFilterVideoDisplayInterface,9,int) MS_FILTER_METHOD(MSFilterVideoDisplayInterface,9,int)
#define MS_VIDEO_DISPLAY_ZOOM \
MS_FILTER_METHOD(MSFilterVideoDisplayInterface,10,int[4])
/**Specifiy device orientation from portrait */
#define MS_VIDEO_DISPLAY_SET_DEVICE_ORIENTATION \
MS_FILTER_METHOD(MSFilterVideoDisplayInterface,11,int)
#define MS_VIDEO_DISPLAY_SUPPORT_DECODING \
MS_FILTER_METHOD(MSFilterVideoDisplayInterface, 12, MSVideoDisplayDe
codingSupport*)
/** /**
* Interface definitions for players * Interface definitions for players
**/ **/
enum _MSPlayerState{ enum _MSPlayerState{
MSPlayerClosed, MSPlayerClosed,
MSPlayerPaused, MSPlayerPaused,
MSPlayerPlaying MSPlayerPlaying
}; };
typedef enum _MSPlayerState MSPlayerState; typedef enum _MSPlayerState MSPlayerState;
/**open a media file*/ /**open a media file*/
#define MS_PLAYER_OPEN \ #define MS_PLAYER_OPEN \
MS_FILTER_METHOD(MSFilterPlayerInterface,0,const char *) MS_FILTER_METHOD(MSFilterPlayerInterface,0,const char )
#define MS_PLAYER_START \ #define MS_PLAYER_START \
MS_FILTER_METHOD_NO_ARG(MSFilterPlayerInterface,1) MS_FILTER_METHOD_NO_ARG(MSFilterPlayerInterface,1)
#define MS_PLAYER_PAUSE \ #define MS_PLAYER_PAUSE \
MS_FILTER_METHOD_NO_ARG(MSFilterPlayerInterface,2) MS_FILTER_METHOD_NO_ARG(MSFilterPlayerInterface,2)
#define MS_PLAYER_CLOSE \ #define MS_PLAYER_CLOSE \
MS_FILTER_METHOD_NO_ARG(MSFilterPlayerInterface,3) MS_FILTER_METHOD_NO_ARG(MSFilterPlayerInterface,3)
#define MS_PLAYER_SEEK_MS \ #define MS_PLAYER_SEEK_MS \
MS_FILTER_METHOD(MSFilterPlayerInterface,4,int) MS_FILTER_METHOD(MSFilterPlayerInterface,4,int)
#define MS_PLAYER_GET_STATE \ #define MS_PLAYER_GET_STATE \
MS_FILTER_METHOD(MSFilterPlayerInterface,5,int) MS_FILTER_METHOD(MSFilterPlayerInterface,5,MSPlayerState)
/**
* Interface definitions for recorders
**/
enum _MSRecorderState{
MSRecorderClosed,
MSRecorderPaused,
MSRecorderRunning
};
typedef enum _MSRecorderState MSRecorderState;
/**open a media file for recording*/
#define MS_RECORDER_OPEN \
MS_FILTER_METHOD(MSFilterRecorderInterface,0,const char )
#define MS_RECORDER_START \
MS_FILTER_METHOD_NO_ARG(MSFilterRecorderInterface,1)
#define MS_RECORDER_PAUSE \
MS_FILTER_METHOD_NO_ARG(MSFilterRecorderInterface,2)
#define MS_RECORDER_CLOSE \
MS_FILTER_METHOD_NO_ARG(MSFilterRecorderInterface,3)
#define MS_RECORDER_GET_STATE \
MS_FILTER_METHOD(MSFilterRecorderInterface,5,MSRecorderState)
/** Interface definitions for echo cancellers */ /** Interface definitions for echo cancellers */
/** sets the echo delay in milliseconds*/ /** sets the echo delay in milliseconds*/
#define MS_ECHO_CANCELLER_SET_DELAY \ #define MS_ECHO_CANCELLER_SET_DELAY \
MS_FILTER_METHOD(MSFilterEchoCancellerInterface,0,int) MS_FILTER_METHOD(MSFilterEchoCancellerInterface,0,int)
#define MS_ECHO_CANCELLER_SET_FRAMESIZE \ #define MS_ECHO_CANCELLER_SET_FRAMESIZE \
MS_FILTER_METHOD(MSFilterEchoCancellerInterface,1,int) MS_FILTER_METHOD(MSFilterEchoCancellerInterface,1,int)
skipping to change at line 121 skipping to change at line 166
#define MS_ECHO_CANCELLER_GET_STATE_STRING \ #define MS_ECHO_CANCELLER_GET_STATE_STRING \
MS_FILTER_METHOD(MSFilterEchoCancellerInterface,5,char **) MS_FILTER_METHOD(MSFilterEchoCancellerInterface,5,char **)
/** restore a previous state suppling the echo canceller config as base64 e ncoded string */ /** restore a previous state suppling the echo canceller config as base64 e ncoded string */
#define MS_ECHO_CANCELLER_SET_STATE_STRING \ #define MS_ECHO_CANCELLER_SET_STATE_STRING \
MS_FILTER_METHOD(MSFilterEchoCancellerInterface,6, const char *) MS_FILTER_METHOD(MSFilterEchoCancellerInterface,6, const char *)
/** Interface definitions for video decoders */ /** Interface definitions for video decoders */
#define MS_VIDEO_DECODER_DECODING_ERRORS \ #define MS_VIDEO_DECODER_DECODING_ERRORS \
MS_FILTER_EVENT_NO_ARG(MSFilterVideoDecoderInterface,0) MS_FILTER_EVENT_NO_ARG(MSFilterVideoDecoderInterface,0)
#define MS_VIDEO_DECODER_FIRST_IMAGE_DECODED \
MS_FILTER_EVENT_NO_ARG(MSFilterVideoDecoderInterface,1)
#define MS_VIDEO_DECODER_RESET_FIRST_IMAGE_NOTIFICATION \
MS_FILTER_METHOD_NO_ARG(MSFilterVideoDecoderInterface, 0)
/** Interface definitions for video capture */ /** Interface definitions for video capture */
#define MS_VIDEO_CAPTURE_SET_DEVICE_ORIENTATION \ #define MS_VIDEO_CAPTURE_SET_DEVICE_ORIENTATION \
MS_FILTER_METHOD(MSFilterVideoCaptureInterface,0,int) MS_FILTER_METHOD(MSFilterVideoCaptureInterface,0,int)
#define MS_VIDEO_CAPTURE_GET_CAMERA_SENSOR_ROTATION \
MS_FILTER_METHOD(MSFilterVideoCaptureInterface, 1, int)
/** Interface definitions for audio decoder */
#define MS_AUDIO_DECODER_HAVE_PLC \
MS_FILTER_METHOD(MSFilterAudioDecoderInterface,0,int)
#define MS_DECODER_HAVE_PLC MS_AUDIO_DECODER_HAVE_PLC /*for backward compat
ibility*/
/** Interface definitions for video encoders */
#define MS_VIDEO_ENCODER_HAS_BUILTIN_CONVERTER \
MS_FILTER_METHOD(MSFilterVideoEncoderInterface, 0, bool_t)
/* request a video-fast-update (=I frame for H263,MP4V-ES) to a video encod
er*/
#define MS_VIDEO_ENCODER_REQ_VFU \
MS_FILTER_METHOD_NO_ARG(MSFilterVideoEncoderInterface, 1)
/** Interface definitions for audio capture */
/* Start numbering from the end for hacks */
#define MS_AUDIO_CAPTURE_FORCE_SPEAKER_STATE \
MS_FILTER_METHOD(MSFilterAudioCaptureInterface, 255, bool_t)
/** Interface definitions for audio encoder */
#define MS_AUDIO_ENCODER_SET_PTIME \
MS_FILTER_METHOD(MSFilterAudioEncoderInterface,0,int)
#define MS_AUDIO_ENCODER_GET_PTIME \
MS_FILTER_METHOD(MSFilterAudioEncoderInterface,1,int)
#endif #endif
 End of changes. 6 change blocks. 
2 lines changed or deleted 85 lines changed or added


 msqueue.h   msqueue.h 
skipping to change at line 37 skipping to change at line 37
int pin; int pin;
} MSCPoint; } MSCPoint;
typedef struct _MSQueue typedef struct _MSQueue
{ {
queue_t q; queue_t q;
MSCPoint prev; MSCPoint prev;
MSCPoint next; MSCPoint next;
}MSQueue; }MSQueue;
MSQueue * ms_queue_new(struct _MSFilter *f1, int pin1, struct _MSFilter *f2 , int pin2 ); MS2_PUBLIC MSQueue * ms_queue_new(struct _MSFilter *f1, int pin1, struct _M SFilter *f2, int pin2 );
static inline mblk_t *ms_queue_get(MSQueue *q){ static inline mblk_t *ms_queue_get(MSQueue *q){
return getq(&q->q); return getq(&q->q);
} }
static inline void ms_queue_put(MSQueue *q, mblk_t *m){ static inline void ms_queue_put(MSQueue *q, mblk_t *m){
putq(&q->q,m); putq(&q->q,m);
return; return;
} }
skipping to change at line 83 skipping to change at line 83
#define __mblk_set_flag(m,pos,bitval) \ #define __mblk_set_flag(m,pos,bitval) \
(m)->reserved2=(m->reserved2 & ~(1<<pos)) | ((!!bitval)<<pos) (m)->reserved2=(m->reserved2 & ~(1<<pos)) | ((!!bitval)<<pos)
#define mblk_set_timestamp_info(m,ts) (m)->reserved1=(ts); #define mblk_set_timestamp_info(m,ts) (m)->reserved1=(ts);
#define mblk_get_timestamp_info(m) ((m)->reserved1) #define mblk_get_timestamp_info(m) ((m)->reserved1)
#define mblk_set_marker_info(m,bit) __mblk_set_flag(m,0,bit) #define mblk_set_marker_info(m,bit) __mblk_set_flag(m,0,bit)
#define mblk_get_marker_info(m) ((m)->reserved2&0x1) /*bit 1*/ #define mblk_get_marker_info(m) ((m)->reserved2&0x1) /*bit 1*/
#define mblk_set_precious_flag(m,bit) __mblk_set_flag(m,1,bit) /*use to prevent mirroring*/ #define mblk_set_precious_flag(m,bit) __mblk_set_flag(m,1,bit) /*use to prevent mirroring*/
#define mblk_get_precious_flag(m) (((m)->reserved2)>>1 & 0x1) /*bit 2*/ #define mblk_get_precious_flag(m) (((m)->reserved2)>>1 & 0x1) /*bit 2*/
#define mblk_set_plc_flag(m,bit) __mblk_set_flag(m,2,bit) /*use to mark
a plc generated block*/
#define mblk_get_plc_flag(m) (((m)->reserved2)>>1 & 0x2) /*bit 2*/
#define mblk_set_cseq(m,value) (m)->reserved2=(m)->reserved2| ((value&0xFFF F)<<16); #define mblk_set_cseq(m,value) (m)->reserved2=(m)->reserved2| ((value&0xFFF F)<<16);
#define mblk_get_cseq(m) ((m)->reserved2>>16) #define mblk_get_cseq(m) ((m)->reserved2>>16)
struct _MSBufferizer{ struct _MSBufferizer{
queue_t q; queue_t q;
int size; int size;
}; };
typedef struct _MSBufferizer MSBufferizer; typedef struct _MSBufferizer MSBufferizer;
/*allocates and initialize */ /*allocates and initialize */
MS2_PUBLIC MSBufferizer * ms_bufferizer_new(void); MS2_PUBLIC MSBufferizer * ms_bufferizer_new(void);
/*initialize in memory */ /*initialize in memory */
void ms_bufferizer_init(MSBufferizer *obj); MS2_PUBLIC void ms_bufferizer_init(MSBufferizer *obj);
MS2_PUBLIC void ms_bufferizer_put(MSBufferizer *obj, mblk_t *m); MS2_PUBLIC void ms_bufferizer_put(MSBufferizer *obj, mblk_t *m);
/* put every mblk_t from q, into the bufferizer */ /* put every mblk_t from q, into the bufferizer */
MS2_PUBLIC void ms_bufferizer_put_from_queue(MSBufferizer *obj, MSQueue *q) ; MS2_PUBLIC void ms_bufferizer_put_from_queue(MSBufferizer *obj, MSQueue *q) ;
MS2_PUBLIC int ms_bufferizer_read(MSBufferizer *obj, uint8_t *data, int dat alen); MS2_PUBLIC int ms_bufferizer_read(MSBufferizer *obj, uint8_t *data, int dat alen);
/* returns the number of bytes available in the bufferizer*/ /* returns the number of bytes available in the bufferizer*/
static inline int ms_bufferizer_get_avail(MSBufferizer *obj){ static inline int ms_bufferizer_get_avail(MSBufferizer *obj){
return obj->size; return obj->size;
} }
MS2_PUBLIC void ms_bufferizer_skip_bytes(MSBufferizer *obj, int bytes); MS2_PUBLIC void ms_bufferizer_skip_bytes(MSBufferizer *obj, int bytes);
/* purge all data pending in the bufferizer */ /* purge all data pending in the bufferizer */
MS2_PUBLIC void ms_bufferizer_flush(MSBufferizer *obj); MS2_PUBLIC void ms_bufferizer_flush(MSBufferizer *obj);
void ms_bufferizer_uninit(MSBufferizer *obj); MS2_PUBLIC void ms_bufferizer_uninit(MSBufferizer *obj);
MS2_PUBLIC void ms_bufferizer_destroy(MSBufferizer *obj); MS2_PUBLIC void ms_bufferizer_destroy(MSBufferizer *obj);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 4 change blocks. 
3 lines changed or deleted 6 lines changed or added


 msrtp.h   msrtp.h 
skipping to change at line 24 skipping to change at line 24
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef msrtp_hh #ifndef msrtp_hh
#define msrtp_hh #define msrtp_hh
#include <mediastreamer2/msfilter.h> #include <mediastreamer2/msfilter.h>
#include <mediastreamer2/ice.h>
#include <ortp/ortp.h> #include <ortp/ortp.h>
#define MS_RTP_RECV_SET_SESSION MS_FILTER_METHOD(MS_RTP_RECV _ID,0,RtpSession*) #define MS_RTP_RECV_SET_SESSION MS_FILTER_METHOD(MS_ RTP_RECV_ID,0,RtpSession*)
#define MS_RTP_SEND_SET_SESSION MS_FILTER_METHOD(MS_RTP_SEND _ID,0,RtpSession*) #define MS_RTP_RECV_RESET_JITTER_BUFFER MS_FILTER_METHOD_NO_ ARG(MS_RTP_RECV_ID,1)
#define MS_RTP_SEND_SEND_DTMF MS_FILTER_METHOD(MS_RTP_SEND_ID,1,co nst char) #define MS_RTP_SEND_SET_SESSION MS_FILTER_METHOD(MS_ RTP_SEND_ID,0,RtpSession*)
#define MS_RTP_SEND_MUTE_MIC MS_FILTER_METHOD_NO_ARG(MS_RTP_SEND_ ID,3) #define MS_RTP_SEND_SEND_DTMF MS_FILTER_METHOD(MS_RTP_SEND _ID,1,const char)
#define MS_RTP_SEND_UNMUTE_MIC MS_FILTER_METHOD_NO_ARG(MS_RTP_SEND_ ID,4) #define MS_RTP_SEND_SET_DTMF_DURATION MS_FILTER_METHOD(MS_RTP_SEND _ID,2,int)
#define MS_RTP_SEND_SET_RELAY_SESSION_ID MS_FILTER_METHOD(MS_RTP_SEND #define MS_RTP_SEND_MUTE_MIC MS_FILTER_METHOD_NO_ARG(MS_R
_ID,5,const char *) TP_SEND_ID,3)
#define MS_RTP_SEND_UNMUTE_MIC MS_FILTER_METHOD_NO_ARG(MS_R
TP_SEND_ID,4)
#define MS_RTP_SEND_SET_DTMF_DURATION MS_FILTER_METHOD(MS_RTP_SEND_ID,1,in t) #define MS_RTP_SEND_SET_RELAY_SESSION_ID MS_FILTER_METHOD(MS_RTP_SEND _ID,5,const char *)
extern MSFilterDesc ms_rtp_send_desc; extern MSFilterDesc ms_rtp_send_desc;
extern MSFilterDesc ms_rtp_recv_desc; extern MSFilterDesc ms_rtp_recv_desc;
#endif #endif
 End of changes. 8 change blocks. 
9 lines changed or deleted 11 lines changed or added


 mssndcard.h   mssndcard.h 
skipping to change at line 124 skipping to change at line 124
MSSndCardUnloadFunc unload; MSSndCardUnloadFunc unload;
}; };
/** /**
* Structure for sound card description object. * Structure for sound card description object.
* @var MSSndCardDesc * @var MSSndCardDesc
*/ */
typedef struct _MSSndCardDesc MSSndCardDesc; typedef struct _MSSndCardDesc MSSndCardDesc;
#define MS_SND_CARD_CAP_DISABLED (0) #define MS_SND_CARD_CAP_DISABLED (0) /**<This soundcard is disabled.*/
#define MS_SND_CARD_CAP_CAPTURE (1) #define MS_SND_CARD_CAP_CAPTURE (1) /**<This sound card can capture sound *
#define MS_SND_CARD_CAP_PLAYBACK (1<<1) /
#define MS_SND_CARD_CAP_PLAYBACK (1<<1) /**<This sound card can playback so
und */
#define MS_SND_CARD_CAP_BUILTIN_ECHO_CANCELLER (1<<2) /**<This sound card h
as built-in echo cancellation*/
struct _MSSndCard{ struct _MSSndCard{
MSSndCardDesc *desc; MSSndCardDesc *desc;
char *name; char *name;
char *id; char *id;
unsigned int capabilities; unsigned int capabilities;
void *data; void *data;
int preferred_sample_rate;
int latency;
}; };
/** /**
* Structure for sound card object. * Structure for sound card object.
* @var MSSndCard * @var MSSndCard
*/ */
typedef struct _MSSndCard MSSndCard; typedef struct _MSSndCard MSSndCard;
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
skipping to change at line 334 skipping to change at line 337
*/ */
MS2_PUBLIC const char *ms_snd_card_get_string_id(MSSndCard *obj); MS2_PUBLIC const char *ms_snd_card_get_string_id(MSSndCard *obj);
/** /**
* Retreive sound card's capabilities. * Retreive sound card's capabilities.
* *
* <PRE> * <PRE>
* MS_SND_CARD_CAP_CAPTURE * MS_SND_CARD_CAP_CAPTURE
* MS_SND_CARD_CAP_PLAYBACK * MS_SND_CARD_CAP_PLAYBACK
* MS_SND_CARD_CAP_CAPTURE|MS_SND_CARD_CAP_PLAYBACK * MS_SND_CARD_CAP_CAPTURE|MS_SND_CARD_CAP_PLAYBACK
* MS_SND_CARD_CAP_BUILTIN_ECHO_CANCELLER
* </PRE> * </PRE>
* *
* @param obj A sound card object. * @param obj A sound card object.
* *
* Returns: A unsigned int if successfull, 0 otherwise. * Returns: A unsigned int if successfull, 0 otherwise.
*/ */
MS2_PUBLIC unsigned int ms_snd_card_get_capabilities(const MSSndCard *obj); MS2_PUBLIC unsigned int ms_snd_card_get_capabilities(const MSSndCard *obj);
/** /**
* Returns the sound card minimal latency (playback+record), in millisecond
s.
* This value is to be used by the software echo cancellers to know where t
o search for the echo (optimization).
* Typically, an echo shall not be found before the value returned by this
function.
* If this value is not known, then it should return 0.
* @param obj A sound card object.
**/
MS2_PUBLIC int ms_snd_card_get_minimal_latency(MSSndCard *obj);
/**
* Set some mixer level value. * Set some mixer level value.
* *
* <PRE> * <PRE>
* MS_SND_CARD_MASTER, * MS_SND_CARD_MASTER,
* MS_SND_CARD_PLAYBACK, * MS_SND_CARD_PLAYBACK,
* MS_SND_CARD_CAPTURE * MS_SND_CARD_CAPTURE
* </PRE> * </PRE>
* Note: not implemented on all sound card filters. * Note: not implemented on all sound card filters.
* *
* @param obj A sound card object. * @param obj A sound card object.
skipping to change at line 428 skipping to change at line 441
* Note: not implemented on all sound card filters. * Note: not implemented on all sound card filters.
* *
* @param obj A sound card object. * @param obj A sound card object.
* @param e A sound card mixer object. * @param e A sound card mixer object.
* *
* Returns: A int if successfull, <0 otherwise. * Returns: A int if successfull, <0 otherwise.
*/ */
MS2_PUBLIC int ms_snd_card_get_control(MSSndCard *obj, MSSndCardControlElem e); MS2_PUBLIC int ms_snd_card_get_control(MSSndCard *obj, MSSndCardControlElem e);
/** /**
* Get preferred sample rate
*
* @param obj A sound card object.
*
* Returns: return sample rate in khz
*/
MS2_PUBLIC int ms_snd_card_get_preferred_sample_rate(const MSSndCard *obj);
/**
* set preferred sample rate. The underlying card will try to avoid any res
ampling for this samplerate.
*
* @param obj A sound card object.
* @param rate sampling rate.
*
* Returns: 0 if successfull, <0 otherwise.
*/
MS2_PUBLIC int ms_snd_card_set_preferred_sample_rate(MSSndCard *obj,int rat
e);
/**
* Create a alsa card with user supplied pcm name and mixer name. * Create a alsa card with user supplied pcm name and mixer name.
* @param pcmdev The pcm device name following alsa conventions (ex: plughw :0) * @param pcmdev The pcm device name following alsa conventions (ex: plughw :0)
* @param mixdev The mixer device name following alsa conventions. * @param mixdev The mixer device name following alsa conventions.
* *
* Returns: a MSSndCard object, NULL if alsa support is not available. * Returns: a MSSndCard object, NULL if alsa support is not available.
*/ */
MS2_PUBLIC MSSndCard * ms_alsa_card_new_custom(const char *pcmdev, const ch ar *mixdev); MS2_PUBLIC MSSndCard * ms_alsa_card_new_custom(const char *pcmdev, const ch ar *mixdev);
/** /**
* Use supplied sample rate to open alsa devices (forced rate). * Use supplied sample rate to open alsa devices (forced rate).
 End of changes. 5 change blocks. 
3 lines changed or deleted 43 lines changed or added


 msticker.h   msticker.h 
skipping to change at line 41 skipping to change at line 41
* *
*/ */
/** /**
* @defgroup mediastreamer2_ticker Ticker API - manage mediastreamer2 graph s. * @defgroup mediastreamer2_ticker Ticker API - manage mediastreamer2 graph s.
* @ingroup mediastreamer2_api * @ingroup mediastreamer2_api
* @{ * @{
*/ */
/** /**
* Structure for method getting time in miliseconds from an external source . * Function pointer for method getting time in miliseconds from an external source.
* @var MSTickerTimeFunc * @var MSTickerTimeFunc
*/ */
typedef uint64_t (*MSTickerTimeFunc)(void *); typedef uint64_t (*MSTickerTimeFunc)(void *);
/** /**
* Function pointer for method waiting next tick from an external source.
* @var MSTickerTickFunc
* It shall return the number of late milliseconds, if this value is known.
*/
typedef int (*MSTickerTickFunc)(void *, uint64_t ticker_virtual_time);
/**
* Enum for ticker priority * Enum for ticker priority
**/ **/
enum _MSTickerPrio{ enum _MSTickerPrio{
MS_TICKER_PRIO_NORMAL, /**<the default OS priority for threads*/ MS_TICKER_PRIO_NORMAL, /**<the default OS priority for threads*/
MS_TICKER_PRIO_HIGH, /**<Increased priority: done by setpriority() o r sched_setschedparams() with SCHED_RR on linux/MacOS*/ MS_TICKER_PRIO_HIGH, /**<Increased priority: done by setpriority() o r sched_setschedparams() with SCHED_RR on linux/MacOS*/
MS_TICKER_PRIO_REALTIME /**<Topmost priority, running SCHED_FIFO on linux */ MS_TICKER_PRIO_REALTIME /**<Topmost priority, running SCHED_FIFO on linux */
}; };
typedef enum _MSTickerPrio MSTickerPrio; typedef enum _MSTickerPrio MSTickerPrio;
struct _MSTicker struct _MSTicker
{ {
ms_mutex_t lock; ms_mutex_t lock;
ms_cond_t cond; ms_cond_t cond;
MSList *execution_list; /* the list of source filters to be exec uted.*/ MSList *execution_list; /* the list of source filters to be exec uted.*/
MSList *task_list; /* list of tasks (see ms_filter_postpone_task())* /
ms_thread_t thread; /* the thread ressource*/ ms_thread_t thread; /* the thread ressource*/
int interval; /* in miliseconds*/ int interval; /* in miliseconds*/
int exec_id; int exec_id;
uint32_t ticks; uint32_t ticks;
uint64_t time; /* a time since the start of the ticker expressed in milisec*/ uint64_t time; /* a time since the start of the ticker expressed in milisec*/
uint64_t orig; /* a relative time to take in account difference betw een time base given by consecutive get_cur_time_ptr() functions.*/ uint64_t orig; /* a relative time to take in account difference betw een time base given by consecutive get_cur_time_ptr() functions.*/
MSTickerTimeFunc get_cur_time_ptr; MSTickerTimeFunc get_cur_time_ptr;
void *get_cur_time_data; void *get_cur_time_data;
char *name; char *name;
double av_load; /*average load of the ticker */ double av_load; /*average load of the ticker */
MSTickerPrio prio; MSTickerPrio prio;
MSTickerTickFunc wait_next_tick;
void *wait_next_tick_data;
bool_t run; /* flag to indicate whether the ticker must be run or not */ bool_t run; /* flag to indicate whether the ticker must be run or not */
}; };
/** /**
* Structure for ticker object. * Structure for ticker object.
* @var MSTicker * @var MSTicker
*/ */
typedef struct _MSTicker MSTicker; typedef struct _MSTicker MSTicker;
struct _MSTickerParams{
MSTickerPrio prio;
const char *name;
};
typedef struct _MSTickerParams MSTickerParams;
struct _MSTickerSynchronizer
{
uint64_t offset; /**<the default offset of ticker*/
double av_skew; /**< mean skew */
};
/**
* Structure for ticker synchronizer object.
* @var MSTickerSynchronizer
*/
typedef struct _MSTickerSynchronizer MSTickerSynchronizer;
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
/** /**
* Create a ticker that will be used to start * Create a ticker that will be used to start
* and stop a graph. * and stop a graph.
* *
* Returns: MSTicker * if successfull, NULL otherwise. * Returns: MSTicker * if successfull, NULL otherwise.
*/ */
MS2_PUBLIC MSTicker *ms_ticker_new(void); MS2_PUBLIC MSTicker *ms_ticker_new(void);
/** /**
* Create a ticker that will be used to start
* and stop a graph.
*
* Returns: MSTicker * if successfull, NULL otherwise.
*/
MS2_PUBLIC MSTicker *ms_ticker_new_with_params(const MSTickerParams *params
);
/**
* Set a name to the ticker (used for logging) * Set a name to the ticker (used for logging)
**/ **/
MS2_PUBLIC void ms_ticker_set_name(MSTicker *ticker, const char *name); MS2_PUBLIC void ms_ticker_set_name(MSTicker *ticker, const char *name);
/** /**
* Set priority to the ticker * Deprecated: Set priority to the ticker
**/ **/
MS2_PUBLIC void ms_ticker_set_priority(MSTicker *ticker, MSTickerPrio prio) ; MS2_PUBLIC void ms_ticker_set_priority(MSTicker *ticker, MSTickerPrio prio) ;
/** /**
* Attach a chain of filters to a ticker. * Attach a chain of filters to a ticker.
* The processing chain will be executed until ms_ticker_detach * The processing chain will be executed until ms_ticker_detach
* will be called. * will be called.
* *
* @param ticker A #MSTicker object. * @param ticker A #MSTicker object.
* @param f A #MSFilter object. * @param f A #MSFilter object.
* *
* Returns: 0 if successfull, -1 otherwise. * Returns: 0 if successfull, -1 otherwise.
*/ */
MS2_PUBLIC int ms_ticker_attach(MSTicker *ticker,MSFilter *f); MS2_PUBLIC int ms_ticker_attach(MSTicker *ticker,MSFilter *f);
/** /**
* Attach a chain of filters to a ticker.
* The processing chain will be executed until ms_ticker_detach
* will be called.
* This variadic can be used to attach multiple chains in a single call. Th
e argument list MUST be NULL terminated.
*
* @param ticker A #MSTicker object.
* @param f A #MSFilter object.
*
* Returns: 0 if successfull, -1 otherwise.
*/
MS2_PUBLIC int ms_ticker_attach_multiple(MSTicker *ticker,MSFilter *f,...);
/**
* Dettach a chain of filters to a ticker. * Dettach a chain of filters to a ticker.
* The processing chain will no more be executed. * The processing chain will no more be executed.
* *
* @param ticker A #MSTicker object. * @param ticker A #MSTicker object.
* @param f A #MSFilter object. * @param f A #MSFilter object.
* *
* *
* Returns: 0 if successfull, -1 otherwise. * Returns: 0 if successfull, -1 otherwise.
*/ */
MS2_PUBLIC int ms_ticker_detach(MSTicker *ticker,MSFilter *f); MS2_PUBLIC int ms_ticker_detach(MSTicker *ticker,MSFilter *f);
skipping to change at line 140 skipping to change at line 190
* *
* @param ticker A #MSTicker object. * @param ticker A #MSTicker object.
* *
*/ */
MS2_PUBLIC void ms_ticker_destroy(MSTicker *ticker); MS2_PUBLIC void ms_ticker_destroy(MSTicker *ticker);
/** /**
* Override MSTicker's time function. * Override MSTicker's time function.
* This can be used to control the ticker from an external time provider, f or example the * This can be used to control the ticker from an external time provider, f or example the
* clock of a sound card. * clock of a sound card.
* WARNING: this must not be used in conjunction with ms_ticker_set_tick_fu nc().
* *
* @param ticker A #MSTicker object. * @param ticker A #MSTicker object.
* @param func A replacement method for calculating "current time" * @param func A replacement method for calculating "current time"
* @param user_data Any pointer to user private data. * @param user_data Any pointer to user private data.
*/ */
MS2_PUBLIC void ms_ticker_set_time_func(MSTicker *ticker, MSTickerTimeFunc func, void *user_data); MS2_PUBLIC void ms_ticker_set_time_func(MSTicker *ticker, MSTickerTimeFunc func, void *user_data);
/** /**
* Override MSTicker's ticking function.
* This can be used to control the ticker from an external ticking source,
for example an interrupt, an event on a file descriptor, etc.
* WARNING: this must not be used in conjunction with ms_ticker_set_time_fu
nc().
*
* @param ticker A #MSTicker object.
* @param func A replacement method waiting the next tick.
* @param user_data Any pointer to user private data.
*/
MS2_PUBLIC void ms_ticker_set_tick_func(MSTicker *ticker, MSTickerTickFunc
func, void *user_data);
/**
* Print on stdout all filters of a ticker. (INTERNAL: DO NOT USE) * Print on stdout all filters of a ticker. (INTERNAL: DO NOT USE)
* *
* @param ticker A #MSTicker object. * @param ticker A #MSTicker object.
*/ */
MS2_PUBLIC void ms_ticker_print_graphs(MSTicker *ticker); MS2_PUBLIC void ms_ticker_print_graphs(MSTicker *ticker);
/** /**
* Get the average load of the ticker. * Get the average load of the ticker.
* It is expressed as the ratio between real time spent in processing all g raphs for a tick divided by the * It is expressed as the ratio between real time spent in processing all g raphs for a tick divided by the
* tick interval (default is 10 ms). * tick interval (default is 10 ms).
* This value is averaged over several ticks to get consistent and useful v alue. * This value is averaged over several ticks to get consistent and useful v alue.
* A load greater than 100% clearly means that the ticker is over loaded an d runs late. * A load greater than 100% clearly means that the ticker is over loaded an d runs late.
**/ **/
MS2_PUBLIC float ms_ticker_get_average_load(MSTicker *ticker); MS2_PUBLIC float ms_ticker_get_average_load(MSTicker *ticker);
/**
* Create a ticker synchronizer.
*
* Returns: MSTickerSynchronizer * if successfull, NULL otherwise.
*/
MS2_PUBLIC MSTickerSynchronizer* ms_ticker_synchronizer_new(void);
/**
* Set the current external time.
*
* @param ts A #MSTickerSynchronizer object.
* @param time A #MSTimeSpec object.
*
* Returns: Average skew.
*/
MS2_PUBLIC double ms_ticker_synchronizer_set_external_time(MSTickerSynchron
izer* ts, const MSTimeSpec *time);
/**
* Get the corrected current time following the set external times.
*
* @param ts A #MSTickerSynchronizer object.
*
*
* Returns: A corrected current time.
*/
MS2_PUBLIC uint64_t ms_ticker_synchronizer_get_corrected_time(MSTickerSynch
ronizer* ts);
/**
* Destroy a ticker synchronizer.
*
* @param ts A #MSTickerSynchronizer object.
*
*/
MS2_PUBLIC void ms_ticker_synchronizer_destroy(MSTickerSynchronizer* ts);
/* private functions:*/ /* private functions:*/
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** @} */ /** @} */
#endif #endif
 End of changes. 11 change blocks. 
2 lines changed or deleted 106 lines changed or added


 msvideo.h   msvideo.h 
skipping to change at line 190 skipping to change at line 190
typedef enum{ typedef enum{
MS_YUV420P, MS_YUV420P,
MS_YUYV, MS_YUYV,
MS_RGB24, MS_RGB24,
MS_RGB24_REV, /*->microsoft down-top bitmaps */ MS_RGB24_REV, /*->microsoft down-top bitmaps */
MS_MJPEG, MS_MJPEG,
MS_UYVY, MS_UYVY,
MS_YUY2, /* -> same as MS_YUYV */ MS_YUY2, /* -> same as MS_YUYV */
MS_RGBA32, MS_RGBA32,
MS_RGB565, MS_RGB565,
MS_H264,
MS_PIX_FMT_UNKNOWN MS_PIX_FMT_UNKNOWN
}MSPixFmt; }MSPixFmt;
typedef struct _MSPicture{ typedef struct _MSPicture{
int w,h; int w,h;
uint8_t *planes[4]; /*we usually use 3 planes, 4th is for compatibil ity */ uint8_t *planes[4]; /*we usually use 3 planes, 4th is for compatibil ity */
int strides[4]; /*with ffmpeg's swscale.h */ int strides[4]; /*with ffmpeg's swscale.h */
}MSPicture; }MSPicture;
typedef struct _MSPicture YuvBuf; /*for backward compatibility*/ typedef struct _MSPicture YuvBuf; /*for backward compatibility*/
skipping to change at line 320 skipping to change at line 321
float fps; float fps;
}; };
typedef struct _MSFrameRateController MSFrameRateController; typedef struct _MSFrameRateController MSFrameRateController;
MS2_PUBLIC void ms_video_init_framerate_controller(MSFrameRateController* c trl, float fps); MS2_PUBLIC void ms_video_init_framerate_controller(MSFrameRateController* c trl, float fps);
MS2_PUBLIC bool_t ms_video_capture_new_frame(MSFrameRateController* ctrl, u int32_t current_time); MS2_PUBLIC bool_t ms_video_capture_new_frame(MSFrameRateController* ctrl, u int32_t current_time);
/* Average FPS calculator */ /* Average FPS calculator */
struct _MSAverageFPS { struct _MSAverageFPS {
unsigned int last_frame_time, last_print_time; unsigned int last_frame_time, last_print_time;
float mean_inter_frame; float mean_inter_frame;
float expected_fps; const char* context;
}; };
typedef struct _MSAverageFPS MSAverageFPS; typedef struct _MSAverageFPS MSAverageFPS;
MS2_PUBLIC void ms_video_init_average_fps(MSAverageFPS* afps, float expecte MS2_PUBLIC void ms_video_init_average_fps(MSAverageFPS* afps, const char* c
dFps); ontext);
MS2_PUBLIC void ms_video_update_average_fps(MSAverageFPS* afps, uint32_t cu MS2_PUBLIC bool_t ms_video_update_average_fps(MSAverageFPS* afps, uint32_t
rrent_time); current_time);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#define MS_FILTER_SET_VIDEO_SIZE MS_FILTER_BASE_METHOD(100,MSVideoSiz e) #define MS_FILTER_SET_VIDEO_SIZE MS_FILTER_BASE_METHOD(100,MSVideoSiz e)
#define MS_FILTER_GET_VIDEO_SIZE MS_FILTER_BASE_METHOD(101,MSVideoSiz e) #define MS_FILTER_GET_VIDEO_SIZE MS_FILTER_BASE_METHOD(101,MSVideoSiz e)
#define MS_FILTER_SET_PIX_FMT MS_FILTER_BASE_METHOD(102,MSPixFmt) #define MS_FILTER_SET_PIX_FMT MS_FILTER_BASE_METHOD(102,MSPixFmt)
#define MS_FILTER_GET_PIX_FMT MS_FILTER_BASE_METHOD(103,MSPixFmt) #define MS_FILTER_GET_PIX_FMT MS_FILTER_BASE_METHOD(103,MSPixFmt)
#define MS_FILTER_SET_FPS MS_FILTER_BASE_METHOD(104,float) #define MS_FILTER_SET_FPS MS_FILTER_BASE_METHOD(104,float)
#define MS_FILTER_GET_FPS MS_FILTER_BASE_METHOD(105,float) #define MS_FILTER_GET_FPS MS_FILTER_BASE_METHOD(105,float)
/* request a video-fast-update (=I frame for H263,MP4V-ES) to a video encod er*/ /* request a video-fast-update (=I frame for H263,MP4V-ES) to a video encod er*/
/* DEPRECATED: Use MS_VIDEO_ENCODER_REQ_VFU instead */
#define MS_FILTER_REQ_VFU MS_FILTER_BASE_METHOD_NO_ARG(106) #define MS_FILTER_REQ_VFU MS_FILTER_BASE_METHOD_NO_ARG(106)
#endif #endif
 End of changes. 4 change blocks. 
5 lines changed or deleted 7 lines changed or added


 mswebcam.h   mswebcam.h 
skipping to change at line 57 skipping to change at line 57
* @var MSWebCamManager * @var MSWebCamManager
*/ */
typedef struct _MSWebCamManager MSWebCamManager; typedef struct _MSWebCamManager MSWebCamManager;
struct _MSWebCam; struct _MSWebCam;
typedef void (*MSWebCamDetectFunc)(MSWebCamManager *obj); typedef void (*MSWebCamDetectFunc)(MSWebCamManager *obj);
typedef void (*MSWebCamInitFunc)(struct _MSWebCam *obj); typedef void (*MSWebCamInitFunc)(struct _MSWebCam *obj);
typedef void (*MSWebCamUninitFunc)(struct _MSWebCam *obj); typedef void (*MSWebCamUninitFunc)(struct _MSWebCam *obj);
typedef struct _MSFilter * (*MSWebCamCreateReaderFunc)(struct _MSWebCam *ob j); typedef struct _MSFilter * (*MSWebCamCreateReaderFunc)(struct _MSWebCam *ob j);
typedef bool_t (*MSWebCamEncodeToMimeType)(struct _MSWebCam *obj, const cha r *mime_type);
struct _MSWebCamDesc{ struct _MSWebCamDesc{
const char *driver_type; const char *driver_type;
MSWebCamDetectFunc detect; MSWebCamDetectFunc detect;
MSWebCamInitFunc init; MSWebCamInitFunc init;
MSWebCamCreateReaderFunc create_reader; MSWebCamCreateReaderFunc create_reader;
MSWebCamUninitFunc uninit; MSWebCamUninitFunc uninit;
MSWebCamEncodeToMimeType encode_to_mime_type;
}; };
/** /**
* Structure for sound card description object. * Structure for sound card description object.
* @var MSWebCamDesc * @var MSWebCamDesc
*/ */
typedef struct _MSWebCamDesc MSWebCamDesc; typedef struct _MSWebCamDesc MSWebCamDesc;
struct _MSWebCam{ struct _MSWebCam{
MSWebCamDesc *desc; MSWebCamDesc *desc;
skipping to change at line 221 skipping to change at line 223
* *
* @param obj A webcam object. * @param obj A webcam object.
* *
* Returns: A string if successfull, NULL otherwise. * Returns: A string if successfull, NULL otherwise.
*/ */
MS2_PUBLIC const char *ms_web_cam_get_string_id(MSWebCam *obj); MS2_PUBLIC const char *ms_web_cam_get_string_id(MSWebCam *obj);
/*specific methods for static image:*/ /*specific methods for static image:*/
MS2_PUBLIC void ms_static_image_set_default_image(const char *path); MS2_PUBLIC void ms_static_image_set_default_image(const char *path);
MS2_PUBLIC const char *ms_static_image_get_default_image();
/** method for the "nowebcam" filter */ /** method for the "nowebcam" filter */
#define MS_STATIC_IMAGE_SET_IMAGE \ #define MS_STATIC_IMAGE_SET_IMAGE \
MS_FILTER_METHOD(MS_STATIC_IMAGE_ID,0,const char) MS_FILTER_METHOD(MS_STATIC_IMAGE_ID,0,const char)
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/** @} */ /** @} */
 End of changes. 3 change blocks. 
0 lines changed or deleted 3 lines changed or added


 ortp.h   ortp.h 
skipping to change at line 67 skipping to change at line 67
/** /**
* \file ortp.h * \file ortp.h
* \brief General purpose library functions. * \brief General purpose library functions.
* *
**/ **/
#ifndef ORTP_H #ifndef ORTP_H
#define ORTP_H #define ORTP_H
#include "ortp/logging.h"
#include "ortp/rtpsession.h" #include "ortp/rtpsession.h"
#include "ortp/sessionset.h" #include "ortp/sessionset.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif #endif
bool_t ortp_min_version_required(int major, int minor, int micro); ORTP_PUBLIC bool_t ortp_min_version_required(int major, int minor, int micr
void ortp_init(void); o);
void ortp_scheduler_init(void); ORTP_PUBLIC void ortp_init(void);
void ortp_exit(void); ORTP_PUBLIC void ortp_scheduler_init(void);
ORTP_PUBLIC void ortp_exit(void);
/***************/
/* logging api */
/***************/
typedef enum {
ORTP_DEBUG=1,
ORTP_MESSAGE=1<<1,
ORTP_WARNING=1<<2,
ORTP_ERROR=1<<3,
ORTP_FATAL=1<<4,
ORTP_LOGLEV_END=1<<5
} OrtpLogLevel;
typedef void (*OrtpLogFunc)(OrtpLogLevel lev, const char *fmt, va_list args
);
void ortp_set_log_file(FILE *file);
void ortp_set_log_handler(OrtpLogFunc func);
VAR_DECLSPEC OrtpLogFunc ortp_logv_out;
extern unsigned int __ortp_log_mask;
#define ortp_log_level_enabled(level) (__ortp_log_mask & (level))
#if !defined(WIN32) && !defined(_WIN32_WCE)
#define ortp_logv(level,fmt,args) \
{\
if (ortp_logv_out!=NULL && ortp_log_level_enabled(level)) \
ortp_logv_out(level,fmt,args);\
if ((level)==ORTP_FATAL) abort();\
}while(0)
#else
void ortp_logv(int level, const char *fmt, va_list args);
#endif
void ortp_set_log_level_mask(int levelmask);
#ifdef __GNUC__
#define CHECK_FORMAT_ARGS(m,n) __attribute__((format(printf,m,n)))
#else
#define CHECK_FORMAT_ARGS(m,n)
#endif
#ifdef ORTP_DEBUG_MODE
static inline void CHECK_FORMAT_ARGS(1,2) ortp_debug(const char *fmt,...)
{
va_list args;
va_start (args, fmt);
ortp_logv(ORTP_DEBUG, fmt, args);
va_end (args);
}
#else
#define ortp_debug(...)
#endif
#ifdef ORTP_NOMESSAGE_MODE
#define ortp_log(...)
#define ortp_message(...)
#define ortp_warning(...)
#else
static inline void CHECK_FORMAT_ARGS(2,3) ortp_log(OrtpLogLevel lev, const
char *fmt,...) {
va_list args;
va_start (args, fmt);
ortp_logv(lev, fmt, args);
va_end (args);
}
static inline void CHECK_FORMAT_ARGS(1,2) ortp_message(const char *fmt,...)
{
va_list args;
va_start (args, fmt);
ortp_logv(ORTP_MESSAGE, fmt, args);
va_end (args);
}
static inline void CHECK_FORMAT_ARGS(1,2) ortp_warning(const char *fmt,...)
{
va_list args;
va_start (args, fmt);
ortp_logv(ORTP_WARNING, fmt, args);
va_end (args);
}
#endif
static inline void CHECK_FORMAT_ARGS(1,2) ortp_error(const char *fmt,...)
{
va_list args;
va_start (args, fmt);
ortp_logv(ORTP_ERROR, fmt, args);
va_end (args);
}
static inline void CHECK_FORMAT_ARGS(1,2) ortp_fatal(const char *fmt,...)
{
va_list args;
va_start (args, fmt);
ortp_logv(ORTP_FATAL, fmt, args);
va_end (args);
}
/****************/ /****************/
/*statistics api*/ /*statistics api*/
/****************/ /****************/
extern rtp_stats_t ortp_global_stats; extern rtp_stats_t ortp_global_stats;
void ortp_global_stats_reset(void); ORTP_PUBLIC void ortp_global_stats_reset(void);
rtp_stats_t *ortp_get_global_stats(void); ORTP_PUBLIC rtp_stats_t *ortp_get_global_stats(void);
void ortp_global_stats_display(void); ORTP_PUBLIC void ortp_global_stats_display(void);
void rtp_stats_display(const rtp_stats_t *stats, const char *header); ORTP_PUBLIC void rtp_stats_display(const rtp_stats_t *stats, const char *he
void rtp_stats_reset(rtp_stats_t *stats); ader);
ORTP_PUBLIC void rtp_stats_reset(rtp_stats_t *stats);
#if defined(_MSC_VER)
#define ORTP_PUBLIC __declspec(dllexport)
#else
#define ORTP_PUBLIC
#endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 4 change blocks. 
123 lines changed or deleted 12 lines changed or added


 ortp_srtp.h   ortp_srtp.h 
skipping to change at line 58 skipping to change at line 58
extern "C"{ extern "C"{
#endif #endif
enum ortp_srtp_crypto_suite_t { enum ortp_srtp_crypto_suite_t {
AES_128_SHA1_80 = 1, AES_128_SHA1_80 = 1,
AES_128_SHA1_32, AES_128_SHA1_32,
AES_128_NO_AUTH, AES_128_NO_AUTH,
NO_CIPHER_SHA1_80 NO_CIPHER_SHA1_80
}; };
err_status_t ortp_srtp_init(void); ORTP_PUBLIC err_status_t ortp_srtp_init(void);
err_status_t ortp_srtp_create(srtp_t *session, const srtp_policy_t *policy) ORTP_PUBLIC err_status_t ortp_srtp_create(srtp_t *session, const srtp_polic
; y_t *policy);
err_status_t ortp_srtp_dealloc(srtp_t session); ORTP_PUBLIC err_status_t ortp_srtp_dealloc(srtp_t session);
err_status_t ortp_srtp_add_stream(srtp_t session, const srtp_policy_t *poli ORTP_PUBLIC err_status_t ortp_srtp_add_stream(srtp_t session, const srtp_po
cy); licy_t *policy);
err_status_t ortp_crypto_get_random(uint8_t *tmp, int size); ORTP_PUBLIC err_status_t ortp_crypto_get_random(uint8_t *tmp, int size);
bool_t ortp_srtp_supported(void); ORTP_PUBLIC bool_t ortp_srtp_supported(void);
int srtp_transport_new(srtp_t srtp, RtpTransport **rtpt, RtpTransport **rtc ORTP_PUBLIC int srtp_transport_new(srtp_t srtp, RtpTransport **rtpt, RtpTra
pt ); nsport **rtcpt );
ORTP_PUBLIC srtp_t ortp_srtp_create_configure_session(enum ortp_srtp_crypto
_suite_t suite, uint32_t ssrc, const char* snd_key, const char* rcv_key);
ORTP_PUBLIC void ortp_srtp_shutdown(void);
srtp_t ortp_srtp_create_configure_session(enum ortp_srtp_crypto_suite_t sui te, uint32_t ssrc, const char* snd_key, const char* rcv_key);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 3 change blocks. 
11 lines changed or deleted 15 lines changed or added


 payloadtype.h   payloadtype.h 
skipping to change at line 22 skipping to change at line 22
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
/** /**
* \file payloadtype.h * \file payloadtype.h
* \brief Using and creating standart and custom RTP profiles * \brief Definition of payload types
* *
**/ **/
#ifndef PAYLOADTYPE_H #ifndef PAYLOADTYPE_H
#define PAYLOADTYPE_H #define PAYLOADTYPE_H
#include <ortp/port.h> #include <ortp/port.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
skipping to change at line 79 skipping to change at line 79
#ifndef PayloadType_defined #ifndef PayloadType_defined
#define PayloadType_defined #define PayloadType_defined
typedef struct _PayloadType PayloadType; typedef struct _PayloadType PayloadType;
#endif #endif
#define payload_type_set_flag(pt,flag) (pt)->flags|=((int)flag) #define payload_type_set_flag(pt,flag) (pt)->flags|=((int)flag)
#define payload_type_unset_flag(pt,flag) (pt)->flags&=(~(int)flag) #define payload_type_unset_flag(pt,flag) (pt)->flags&=(~(int)flag)
#define payload_type_get_flags(pt) (pt)->flags #define payload_type_get_flags(pt) (pt)->flags
#define RTP_PROFILE_MAX_PAYLOADS 128 ORTP_PUBLIC PayloadType *payload_type_new(void);
ORTP_PUBLIC PayloadType *payload_type_clone(PayloadType *payload);
/** ORTP_PUBLIC char *payload_type_get_rtpmap(PayloadType *pt);
* The RTP profile is a table RTP_PROFILE_MAX_PAYLOADS entries to make the ORTP_PUBLIC void payload_type_destroy(PayloadType *pt);
matching ORTP_PUBLIC void payload_type_set_recv_fmtp(PayloadType *pt, const char *fm
* between RTP payload type number and the PayloadType that defines the typ tp);
e of ORTP_PUBLIC void payload_type_set_send_fmtp(PayloadType *pt, const char *fm
* media. tp);
**/ ORTP_PUBLIC void payload_type_append_recv_fmtp(PayloadType *pt, const char
struct _RtpProfile *fmtp);
{ ORTP_PUBLIC void payload_type_append_send_fmtp(PayloadType *pt, const char
char *name; *fmtp);
PayloadType *payload[RTP_PROFILE_MAX_PAYLOADS];
};
typedef struct _RtpProfile RtpProfile;
PayloadType *payload_type_new(void);
PayloadType *payload_type_clone(PayloadType *payload);
char *payload_type_get_rtpmap(PayloadType *pt);
void payload_type_destroy(PayloadType *pt);
void payload_type_set_recv_fmtp(PayloadType *pt, const char *fmtp);
void payload_type_set_send_fmtp(PayloadType *pt, const char *fmtp);
void payload_type_append_recv_fmtp(PayloadType *pt, const char *fmtp);
void payload_type_append_send_fmtp(PayloadType *pt, const char *fmtp);
#define payload_type_get_bitrate(pt) ((pt)->normal_bitrate) #define payload_type_get_bitrate(pt) ((pt)->normal_bitrate)
#define payload_type_get_rate(pt) ((pt)->clock_rate) #define payload_type_get_rate(pt) ((pt)->clock_rate)
#define payload_type_get_mime(pt) ((pt)->mime_type) #define payload_type_get_mime(pt) ((pt)->mime_type)
bool_t fmtp_get_value(const char *fmtp, const char *param_name, char *resul ORTP_PUBLIC bool_t fmtp_get_value(const char *fmtp, const char *param_name,
t, size_t result_len); char *result, size_t result_len);
VAR_DECLSPEC RtpProfile av_profile;
#define payload_type_set_user_data(pt,p) (pt)->user_data=(p) #define payload_type_set_user_data(pt,p) (pt)->user_data=(p)
#define payload_type_get_user_data(pt) ((pt)->user_data) #define payload_type_get_user_data(pt) ((pt)->user_data)
#define rtp_profile_get_name(profile) (const char*)((profile)->name)
void rtp_profile_set_payload(RtpProfile *prof, int idx, PayloadType *pt);
/**
* Set payload type number @index unassigned in the profile.
*
*@param profile an RTP profile
*@param index the payload type number
**/
#define rtp_profile_clear_payload(profile,index) \
rtp_profile_set_payload(profile,index,NULL)
/* I prefer have this function inlined because it is very often called in t
he code */
/**
*
* Gets the payload description of the payload type @index in the profi
le.
*
*@param profile an RTP profile (a #RtpProfile object)
*@param index the payload type number
*@return the payload description (a PayloadType object)
**/
static inline PayloadType * rtp_profile_get_payload(RtpProfile *prof, int i
dx){
if (idx<0 || idx>=RTP_PROFILE_MAX_PAYLOADS) {
return NULL;
}
return prof->payload[idx];
}
void rtp_profile_clear_all(RtpProfile *prof);
void rtp_profile_set_name(RtpProfile *prof, const char *name);
PayloadType * rtp_profile_get_payload_from_mime(RtpProfile *profile,const c
har *mime);
PayloadType * rtp_profile_get_payload_from_rtpmap(RtpProfile *profile, cons
t char *rtpmap);
int rtp_profile_get_payload_number_from_mime(RtpProfile *profile,const char
*mime);
int rtp_profile_get_payload_number_from_rtpmap(RtpProfile *profile, const c
har *rtpmap);
int rtp_profile_find_payload_number(RtpProfile *prof,const char *mime,int r
ate, int channels);
PayloadType * rtp_profile_find_payload(RtpProfile *prof,const char *mime,in
t rate, int channels);
int rtp_profile_move_payload(RtpProfile *prof,int oldpos,int newpos);
RtpProfile * rtp_profile_new(const char *name);
/* clone a profile, payload are not cloned */
RtpProfile * rtp_profile_clone(RtpProfile *prof);
/*clone a profile and its payloads (ie payload type are newly allocated, no
t reusing payload types of the reference profile) */
RtpProfile * rtp_profile_clone_full(RtpProfile *prof);
/* frees the profile and all its PayloadTypes*/
void rtp_profile_destroy(RtpProfile *prof);
/* some payload types */ /* some payload types */
/* audio */ /* audio */
VAR_DECLSPEC PayloadType payload_type_pcmu8000; ORTP_VAR_PUBLIC PayloadType payload_type_pcmu8000;
VAR_DECLSPEC PayloadType payload_type_pcma8000; ORTP_VAR_PUBLIC PayloadType payload_type_pcma8000;
VAR_DECLSPEC PayloadType payload_type_pcm8000; ORTP_VAR_PUBLIC PayloadType payload_type_pcm8000;
VAR_DECLSPEC PayloadType payload_type_l16_mono; ORTP_VAR_PUBLIC PayloadType payload_type_l16_mono;
VAR_DECLSPEC PayloadType payload_type_l16_stereo; ORTP_VAR_PUBLIC PayloadType payload_type_l16_stereo;
VAR_DECLSPEC PayloadType payload_type_lpc1016; ORTP_VAR_PUBLIC PayloadType payload_type_lpc1016;
VAR_DECLSPEC PayloadType payload_type_g729; ORTP_VAR_PUBLIC PayloadType payload_type_g729;
VAR_DECLSPEC PayloadType payload_type_g7231; ORTP_VAR_PUBLIC PayloadType payload_type_g7231;
VAR_DECLSPEC PayloadType payload_type_g7221; ORTP_VAR_PUBLIC PayloadType payload_type_g7221;
VAR_DECLSPEC PayloadType payload_type_g726_40; ORTP_VAR_PUBLIC PayloadType payload_type_g726_40;
VAR_DECLSPEC PayloadType payload_type_g726_32; ORTP_VAR_PUBLIC PayloadType payload_type_g726_32;
VAR_DECLSPEC PayloadType payload_type_g726_24; ORTP_VAR_PUBLIC PayloadType payload_type_g726_24;
VAR_DECLSPEC PayloadType payload_type_g726_16; ORTP_VAR_PUBLIC PayloadType payload_type_g726_16;
VAR_DECLSPEC PayloadType payload_type_aal2_g726_40; ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_40;
VAR_DECLSPEC PayloadType payload_type_aal2_g726_32; ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_32;
VAR_DECLSPEC PayloadType payload_type_aal2_g726_24; ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_24;
VAR_DECLSPEC PayloadType payload_type_aal2_g726_16; ORTP_VAR_PUBLIC PayloadType payload_type_aal2_g726_16;
VAR_DECLSPEC PayloadType payload_type_gsm; ORTP_VAR_PUBLIC PayloadType payload_type_gsm;
VAR_DECLSPEC PayloadType payload_type_lpc; ORTP_VAR_PUBLIC PayloadType payload_type_lpc;
VAR_DECLSPEC PayloadType payload_type_lpc1015; ORTP_VAR_PUBLIC PayloadType payload_type_lpc1015;
VAR_DECLSPEC PayloadType payload_type_speex_nb; ORTP_VAR_PUBLIC PayloadType payload_type_speex_nb;
VAR_DECLSPEC PayloadType payload_type_speex_wb; ORTP_VAR_PUBLIC PayloadType payload_type_speex_wb;
VAR_DECLSPEC PayloadType payload_type_speex_uwb; ORTP_VAR_PUBLIC PayloadType payload_type_speex_uwb;
VAR_DECLSPEC PayloadType payload_type_ilbc; ORTP_VAR_PUBLIC PayloadType payload_type_ilbc;
VAR_DECLSPEC PayloadType payload_type_amr; ORTP_VAR_PUBLIC PayloadType payload_type_amr;
VAR_DECLSPEC PayloadType payload_type_amrwb; ORTP_VAR_PUBLIC PayloadType payload_type_amrwb;
VAR_DECLSPEC PayloadType payload_type_truespeech; ORTP_VAR_PUBLIC PayloadType payload_type_truespeech;
VAR_DECLSPEC PayloadType payload_type_evrc0; ORTP_VAR_PUBLIC PayloadType payload_type_evrc0;
VAR_DECLSPEC PayloadType payload_type_evrcb0; ORTP_VAR_PUBLIC PayloadType payload_type_evrcb0;
VAR_DECLSPEC PayloadType payload_type_silk_nb; ORTP_VAR_PUBLIC PayloadType payload_type_silk_nb;
VAR_DECLSPEC PayloadType payload_type_silk_mb; ORTP_VAR_PUBLIC PayloadType payload_type_silk_mb;
VAR_DECLSPEC PayloadType payload_type_silk_wb; ORTP_VAR_PUBLIC PayloadType payload_type_silk_wb;
VAR_DECLSPEC PayloadType payload_type_silk_swb; ORTP_VAR_PUBLIC PayloadType payload_type_silk_swb;
ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_22k;
/* video */ ORTP_VAR_PUBLIC PayloadType payload_type_aaceld_44k;
VAR_DECLSPEC PayloadType payload_type_mpv; ORTP_VAR_PUBLIC PayloadType payload_type_opus;
VAR_DECLSPEC PayloadType payload_type_h261;
VAR_DECLSPEC PayloadType payload_type_h263; /* video */
VAR_DECLSPEC PayloadType payload_type_h263_1998; ORTP_VAR_PUBLIC PayloadType payload_type_mpv;
VAR_DECLSPEC PayloadType payload_type_h263_2000; ORTP_VAR_PUBLIC PayloadType payload_type_h261;
VAR_DECLSPEC PayloadType payload_type_mp4v; ORTP_VAR_PUBLIC PayloadType payload_type_h263;
VAR_DECLSPEC PayloadType payload_type_theora; ORTP_VAR_PUBLIC PayloadType payload_type_h263_1998;
VAR_DECLSPEC PayloadType payload_type_h264; ORTP_VAR_PUBLIC PayloadType payload_type_h263_2000;
VAR_DECLSPEC PayloadType payload_type_x_snow; ORTP_VAR_PUBLIC PayloadType payload_type_mp4v;
VAR_DECLSPEC PayloadType payload_type_jpeg; ORTP_VAR_PUBLIC PayloadType payload_type_theora;
VAR_DECLSPEC PayloadType payload_type_vp8; ORTP_VAR_PUBLIC PayloadType payload_type_h264;
ORTP_VAR_PUBLIC PayloadType payload_type_x_snow;
ORTP_VAR_PUBLIC PayloadType payload_type_jpeg;
ORTP_VAR_PUBLIC PayloadType payload_type_vp8;
VAR_DECLSPEC PayloadType payload_type_g722; ORTP_VAR_PUBLIC PayloadType payload_type_g722;
/* text */ /* text */
VAR_DECLSPEC PayloadType payload_type_t140; ORTP_VAR_PUBLIC PayloadType payload_type_t140;
VAR_DECLSPEC PayloadType payload_type_t140_red; ORTP_VAR_PUBLIC PayloadType payload_type_t140_red;
/* non standard file transfer over UDP */ /* non standard file transfer over UDP */
VAR_DECLSPEC PayloadType payload_type_x_udpftp; ORTP_VAR_PUBLIC PayloadType payload_type_x_udpftp;
/* telephone-event */ /* telephone-event */
VAR_DECLSPEC PayloadType payload_type_telephone_event; ORTP_VAR_PUBLIC PayloadType payload_type_telephone_event;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 9 change blocks. 
138 lines changed or deleted 69 lines changed or added


 port.h   port.h 
skipping to change at line 74 skipping to change at line 74
#pragma warning(disable : 188) // enumerated type mixed with anothe r type #pragma warning(disable : 188) // enumerated type mixed with anothe r type
#pragma warning(disable : 593) // variable "xxx" was set but never used #pragma warning(disable : 593) // variable "xxx" was set but never used
#pragma warning(disable : 810) // conversion from "int" to "unsigne d short" may lose significant bits #pragma warning(disable : 810) // conversion from "int" to "unsigne d short" may lose significant bits
#pragma warning(disable : 869) // parameter "xxx" was never referen ced #pragma warning(disable : 869) // parameter "xxx" was never referen ced
#pragma warning(disable : 981) // operands are evaluated in unspeci fied order #pragma warning(disable : 981) // operands are evaluated in unspeci fied order
#pragma warning(disable : 1418) // external function definit ion with no prior declaration #pragma warning(disable : 1418) // external function definit ion with no prior declaration
#pragma warning(disable : 1419) // external declaration in p rimary source file #pragma warning(disable : 1419) // external declaration in p rimary source file
#pragma warning(disable : 1469) // "cc" clobber ignored #pragma warning(disable : 1469) // "cc" clobber ignored
#endif #endif
#define ORTP_PUBLIC
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif #endif
int __ortp_thread_join(ortp_thread_t thread, void **ptr); int __ortp_thread_join(ortp_thread_t thread, void **ptr);
int __ortp_thread_create(pthread_t *thread, pthread_attr_t *attr, void * (* routine)(void*), void *arg); int __ortp_thread_create(pthread_t *thread, pthread_attr_t *attr, void * (* routine)(void*), void *arg);
#ifdef __cplusplus #ifdef __cplusplus
} }
skipping to change at line 117 skipping to change at line 119
#else #else
/*********************************/ /*********************************/
/* definitions for WIN32 flavour */ /* definitions for WIN32 flavour */
/*********************************/ /*********************************/
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
#include <winsock2.h> #include <winsock2.h>
#include <ws2tcpip.h> #include <ws2tcpip.h>
#include <io.h>
#ifdef _MSC_VER #ifdef _MSC_VER
#ifdef ORTP_EXPORTS
#define ORTP_PUBLIC __declspec(dllexport)
#else
#define ORTP_PUBLIC __declspec(dllimport)
#endif
#pragma push_macro("_WINSOCKAPI_") #pragma push_macro("_WINSOCKAPI_")
#ifndef _WINSOCKAPI_ #ifndef _WINSOCKAPI_
#define _WINSOCKAPI_ #define _WINSOCKAPI_
#endif #endif
#define strtok_r strtok_s
typedef unsigned __int64 uint64_t; typedef unsigned __int64 uint64_t;
typedef __int64 int64_t; typedef __int64 int64_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
typedef int int32_t; typedef int int32_t;
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef __int16 int16_t; typedef __int16 int16_t;
#else #else
#include <stdint.h> /*provided by mingw32*/ #include <stdint.h> /*provided by mingw32*/
#include <io.h>
#define ORTP_PUBLIC
#endif #endif
#define vsnprintf _vsnprintf #define vsnprintf _vsnprintf
#define srandom srand #define srandom srand
#define random rand #define random rand
ORTP_PUBLIC char* strtok_r(char *str, const char *delim, char **nextp);
typedef SOCKET ortp_socket_t; typedef SOCKET ortp_socket_t;
#ifdef WINAPI_FAMILY_PHONE_APP
typedef CONDITION_VARIABLE ortp_cond_t;
typedef SRWLOCK ortp_mutex_t;
#else
typedef HANDLE ortp_cond_t; typedef HANDLE ortp_cond_t;
typedef HANDLE ortp_mutex_t; typedef HANDLE ortp_mutex_t;
#endif
typedef HANDLE ortp_thread_t; typedef HANDLE ortp_thread_t;
#define ortp_thread_create WIN_thread_create #define ortp_thread_create WIN_thread_create
#define ortp_thread_join WIN_thread_join #define ortp_thread_join WIN_thread_join
#define ortp_thread_exit(arg) #define ortp_thread_exit(arg)
#define ortp_mutex_init WIN_mutex_init #define ortp_mutex_init WIN_mutex_init
#define ortp_mutex_lock WIN_mutex_lock #define ortp_mutex_lock WIN_mutex_lock
#define ortp_mutex_unlock WIN_mutex_unlock #define ortp_mutex_unlock WIN_mutex_unlock
#define ortp_mutex_destroy WIN_mutex_destroy #define ortp_mutex_destroy WIN_mutex_destroy
#define ortp_cond_init WIN_cond_init #define ortp_cond_init WIN_cond_init
#define ortp_cond_signal WIN_cond_signal #define ortp_cond_signal WIN_cond_signal
#define ortp_cond_broadcast WIN_cond_broadcast #define ortp_cond_broadcast WIN_cond_broadcast
#define ortp_cond_wait WIN_cond_wait #define ortp_cond_wait WIN_cond_wait
#define ortp_cond_destroy WIN_cond_destroy #define ortp_cond_destroy WIN_cond_destroy
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif #endif
int WIN_mutex_init(ortp_mutex_t *m, void *attr_unused); ORTP_PUBLIC int WIN_mutex_init(ortp_mutex_t *m, void *attr_unused);
int WIN_mutex_lock(ortp_mutex_t *mutex); ORTP_PUBLIC int WIN_mutex_lock(ortp_mutex_t *mutex);
int WIN_mutex_unlock(ortp_mutex_t *mutex); ORTP_PUBLIC int WIN_mutex_unlock(ortp_mutex_t *mutex);
int WIN_mutex_destroy(ortp_mutex_t *mutex); ORTP_PUBLIC int WIN_mutex_destroy(ortp_mutex_t *mutex);
int WIN_thread_create(ortp_thread_t *t, void *attr_unused, void *(*func)(vo ORTP_PUBLIC int WIN_thread_create(ortp_thread_t *t, void *attr_unused, void
id*), void *arg); *(*func)(void*), void *arg);
int WIN_thread_join(ortp_thread_t thread, void **unused); ORTP_PUBLIC int WIN_thread_join(ortp_thread_t thread, void **unused);
int WIN_cond_init(ortp_cond_t *cond, void *attr_unused); ORTP_PUBLIC int WIN_cond_init(ortp_cond_t *cond, void *attr_unused);
int WIN_cond_wait(ortp_cond_t * cond, ortp_mutex_t * mutex); ORTP_PUBLIC int WIN_cond_wait(ortp_cond_t * cond, ortp_mutex_t * mutex);
int WIN_cond_signal(ortp_cond_t * cond); ORTP_PUBLIC int WIN_cond_signal(ortp_cond_t * cond);
int WIN_cond_broadcast(ortp_cond_t * cond); ORTP_PUBLIC int WIN_cond_broadcast(ortp_cond_t * cond);
int WIN_cond_destroy(ortp_cond_t * cond); ORTP_PUBLIC int WIN_cond_destroy(ortp_cond_t * cond);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#define SOCKET_OPTION_VALUE char * #define SOCKET_OPTION_VALUE char *
#define inline __inline #define inline __inline
#if defined(_WIN32_WCE) #if defined(_WIN32_WCE)
skipping to change at line 207 skipping to change at line 224
#endif /*strerror*/ #endif /*strerror*/
const char * ortp_strerror(DWORD value); const char * ortp_strerror(DWORD value);
#define strerror ortp_strerror #define strerror ortp_strerror
#else /*_WIN32_WCE*/ #else /*_WIN32_WCE*/
#define ortp_log10f(x) log10f(x) #define ortp_log10f(x) log10f(x)
#endif #endif
const char *getWinSocketError(int error); ORTP_PUBLIC const char *getWinSocketError(int error);
#define getSocketErrorCode() WSAGetLastError() #define getSocketErrorCode() WSAGetLastError()
#define getSocketError() getWinSocketError(WSAGetLastError()) #define getSocketError() getWinSocketError(WSAGetLastError())
#define snprintf _snprintf #define snprintf _snprintf
#define strcasecmp _stricmp #define strcasecmp _stricmp
#define strncasecmp _strnicmp
#if 0
struct timeval {
long tv_sec; /* seconds */
long tv_usec; /* and microseconds */
};
#endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
int gettimeofday (struct timeval *tv, void* tz); ORTP_PUBLIC int gettimeofday (struct timeval *tv, void* tz);
#ifdef _WORKAROUND_MINGW32_BUGS #ifdef _WORKAROUND_MINGW32_BUGS
char * WSAAPI gai_strerror(int errnum); char * WSAAPI gai_strerror(int errnum);
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
typedef unsigned char bool_t; typedef unsigned char bool_t;
#undef TRUE #undef TRUE
#undef FALSE #undef FALSE
#define TRUE 1 #define TRUE 1
#define FALSE 0 #define FALSE 0
typedef struct ortpTimeSpec{
int64_t tv_sec;
int64_t tv_nsec;
}ortpTimeSpec;
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
void* ortp_malloc(size_t sz); ORTP_PUBLIC void* ortp_malloc(size_t sz);
void ortp_free(void *ptr); ORTP_PUBLIC void ortp_free(void *ptr);
void* ortp_realloc(void *ptr, size_t sz); ORTP_PUBLIC void* ortp_realloc(void *ptr, size_t sz);
void* ortp_malloc0(size_t sz); ORTP_PUBLIC void* ortp_malloc0(size_t sz);
char * ortp_strdup(const char *tmp); ORTP_PUBLIC char * ortp_strdup(const char *tmp);
/*override the allocator with this method, to be called BEFORE ortp_init()* / /*override the allocator with this method, to be called BEFORE ortp_init()* /
typedef struct _OrtpMemoryFunctions{ typedef struct _OrtpMemoryFunctions{
void *(*malloc_fun)(size_t sz); void *(*malloc_fun)(size_t sz);
void *(*realloc_fun)(void *ptr, size_t sz); void *(*realloc_fun)(void *ptr, size_t sz);
void (*free_fun)(void *ptr); void (*free_fun)(void *ptr);
}OrtpMemoryFunctions; }OrtpMemoryFunctions;
void ortp_set_memory_functions(OrtpMemoryFunctions *functions); void ortp_set_memory_functions(OrtpMemoryFunctions *functions);
#define ortp_new(type,count) (type*)ortp_malloc(sizeof(type)*(count)) #define ortp_new(type,count) (type*)ortp_malloc(sizeof(type)*(count))
#define ortp_new0(type,count) (type*)ortp_malloc0(sizeof(type)*(count)) #define ortp_new0(type,count) (type*)ortp_malloc0(sizeof(type)*(count))
int close_socket(ortp_socket_t sock); ORTP_PUBLIC int close_socket(ortp_socket_t sock);
int set_non_blocking_socket(ortp_socket_t sock); ORTP_PUBLIC int set_non_blocking_socket(ortp_socket_t sock);
ORTP_PUBLIC char *ortp_strndup(const char *str,int n);
ORTP_PUBLIC char *ortp_strdup_printf(const char *fmt,...);
ORTP_PUBLIC char *ortp_strdup_vprintf(const char *fmt, va_list ap);
char *ortp_strndup(const char *str,int n); ORTP_PUBLIC int ortp_file_exist(const char *pathname);
char *ortp_strdup_printf(const char *fmt,...);
char *ortp_strdup_vprintf(const char *fmt, va_list ap);
int ortp_file_exist(const char *pathname); ORTP_PUBLIC void ortp_get_cur_time(ortpTimeSpec *ret);
/* portable named pipes and shared memory*/ /* portable named pipes and shared memory*/
#if !defined(_WIN32_WCE) #if !defined(_WIN32_WCE)
#ifdef WIN32 #ifdef WIN32
typedef HANDLE ortp_pipe_t; typedef HANDLE ortp_pipe_t;
#define ORTP_PIPE_INVALID INVALID_HANDLE_VALUE #define ORTP_PIPE_INVALID INVALID_HANDLE_VALUE
#else #else
typedef int ortp_pipe_t; typedef int ortp_pipe_t;
#define ORTP_PIPE_INVALID (-1) #define ORTP_PIPE_INVALID (-1)
#endif #endif
ortp_pipe_t ortp_server_pipe_create(const char *name); ORTP_PUBLIC ortp_pipe_t ortp_server_pipe_create(const char *name);
/* /*
* warning: on win32 ortp_server_pipe_accept_client() might return INVALID_ HANDLE_VALUE without * warning: on win32 ortp_server_pipe_accept_client() might return INVALID_ HANDLE_VALUE without
* any specific error, this happens when ortp_server_pipe_close() is called on another pipe. * any specific error, this happens when ortp_server_pipe_close() is called on another pipe.
* This pipe api is not thread-safe. * This pipe api is not thread-safe.
*/ */
ortp_pipe_t ortp_server_pipe_accept_client(ortp_pipe_t server); ORTP_PUBLIC ortp_pipe_t ortp_server_pipe_accept_client(ortp_pipe_t server);
int ortp_server_pipe_close(ortp_pipe_t spipe); ORTP_PUBLIC int ortp_server_pipe_close(ortp_pipe_t spipe);
int ortp_server_pipe_close_client(ortp_pipe_t client); ORTP_PUBLIC int ortp_server_pipe_close_client(ortp_pipe_t client);
ortp_pipe_t ortp_client_pipe_connect(const char *name); ORTP_PUBLIC ortp_pipe_t ortp_client_pipe_connect(const char *name);
int ortp_client_pipe_close(ortp_pipe_t sock); ORTP_PUBLIC int ortp_client_pipe_close(ortp_pipe_t sock);
int ortp_pipe_read(ortp_pipe_t p, uint8_t *buf, int len); ORTP_PUBLIC int ortp_pipe_read(ortp_pipe_t p, uint8_t *buf, int len);
int ortp_pipe_write(ortp_pipe_t p, const uint8_t *buf, int len); ORTP_PUBLIC int ortp_pipe_write(ortp_pipe_t p, const uint8_t *buf, int len)
;
void *ortp_shm_open(unsigned int keyid, int size, int create); ORTP_PUBLIC void *ortp_shm_open(unsigned int keyid, int size, int create);
void ortp_shm_close(void *memory); ORTP_PUBLIC void ortp_shm_close(void *memory);
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(ORTP_STATIC) #if (defined(WIN32) || defined(_WIN32_WCE)) && !defined(ORTP_STATIC)
#ifdef ORTP_EXPORTS #ifdef ORTP_EXPORTS
#define VAR_DECLSPEC __declspec(dllexport) #define ORTP_VAR_PUBLIC extern __declspec(dllexport)
#else #else
#define VAR_DECLSPEC __declspec(dllimport) #define ORTP_VAR_PUBLIC __declspec(dllimport)
#endif #endif
#else #else
#define VAR_DECLSPEC extern #define ORTP_VAR_PUBLIC extern
#endif #endif
/*define __ios when we are compiling for ios. /*define __ios when we are compiling for ios.
The TARGET_OS_IPHONE macro is stupid, it is defined to 0 when compiling on mac os x. The TARGET_OS_IPHONE macro is stupid, it is defined to 0 when compiling on mac os x.
*/ */
#if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE==1 #if defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE==1
#define __ios 1 #define __ios 1
#endif #endif
#endif #endif
 End of changes. 25 change blocks. 
46 lines changed or deleted 65 lines changed or added


 qualityindicator.h   qualityindicator.h 
skipping to change at line 25 skipping to change at line 25
You should have received a copy of the GNU General Public License You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/ */
#ifndef ms2_qualityindicator_h #ifndef ms2_qualityindicator_h
#define ms2_qualityindicator_h #define ms2_qualityindicator_h
#include "mediastreamer2/mscommon.h" #include "mediastreamer2/mscommon.h"
#include <ortp/ortp.h>
typedef struct _MSQualityIndicator MSQualityIndicator; typedef struct _MSQualityIndicator MSQualityIndicator;
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
MSQualityIndicator *ms_quality_indicator_new(RtpSession *session); /**
* Creates a quality indicator object.
float ms_quality_indicator_get_rating(MSQualityIndicator *qi); * @param session the RtpSession being monitored.
**/
float ms_quality_indicator_get_average_rating(MSQualityIndicator *qi); MS2_PUBLIC MSQualityIndicator *ms_quality_indicator_new(RtpSession *session
);
void ms_quality_indicator_update_from_feedback(MSQualityIndicator *qi, mblk
_t *rtcp); /**
* Updates quality indicator based on a received RTCP packet.
void ms_quality_indicator_update_local(MSQualityIndicator *qi); **/
MS2_PUBLIC void ms_quality_indicator_update_from_feedback(MSQualityIndicato
void ms_quality_indicator_destroy(MSQualityIndicator *qi); r *qi, mblk_t *rtcp);
/**
* Updates quality indicator based on the local statistics directly compute
d by the RtpSession used when creating the indicator.
* This function must be called typically every second.
**/
MS2_PUBLIC void ms_quality_indicator_update_local(MSQualityIndicator *qi);
/**
* Return the real time rating of the session. Its value is between 0 (wors
e) and 5.0 (best).
**/
MS2_PUBLIC float ms_quality_indicator_get_rating(MSQualityIndicator *qi);
/**
* Returns the average rating of the session, that is the rating for all th
e duration of the session.
**/
MS2_PUBLIC float ms_quality_indicator_get_average_rating(MSQualityIndicator
*qi);
/**
* Returns the local loss rate, as computed internally by ms_quality_indica
tor_update_local().
* The value is expressed as a percentage.
* This method is for advanced usage.
**/
MS2_PUBLIC float ms_quality_indicator_get_local_loss_rate(const MSQualityIn
dicator *qi);
/**
* Returns the local late rate, as computed internally by ms_quality_indica
tor_update_local().
* The value is expressed as a percentage.
* This method is for advanced usage.
**/
MS2_PUBLIC float ms_quality_indicator_get_local_late_rate(const MSQualityIn
dicator *qi);
/**
* Destroys the quality indicator object.
**/
MS2_PUBLIC void ms_quality_indicator_destroy(MSQualityIndicator *qi);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 2 change blocks. 
12 lines changed or deleted 56 lines changed or added


 rtcp.h   rtcp.h 
skipping to change at line 193 skipping to change at line 193
report_block_t rb[1]; report_block_t rb[1];
} rtcp_rr_t; } rtcp_rr_t;
typedef struct rtcp_app{ typedef struct rtcp_app{
rtcp_common_header_t ch; rtcp_common_header_t ch;
uint32_t ssrc; uint32_t ssrc;
char name[4]; char name[4];
} rtcp_app_t; } rtcp_app_t;
struct _RtpSession; struct _RtpSession;
void rtp_session_rtcp_process_send(struct _RtpSession *s); ORTP_PUBLIC void rtp_session_rtcp_process_send(struct _RtpSession *s);
void rtp_session_rtcp_process_recv(struct _RtpSession *s); ORTP_PUBLIC void rtp_session_rtcp_process_recv(struct _RtpSession *s);
#define RTCP_DEFAULT_REPORT_INTERVAL 5000 /*ms*/ #define RTCP_DEFAULT_REPORT_INTERVAL 5000 /*ms*/
/* packet parsing api */ /* packet parsing api */
/*in case of coumpound packet, set read pointer of m to the beginning of th e next RTCP /*in case of coumpound packet, set read pointer of m to the beginning of th e next RTCP
packet */ packet */
bool_t rtcp_next_packet(mblk_t *m); ORTP_PUBLIC bool_t rtcp_next_packet(mblk_t *m);
/* put the read pointer at the first RTCP packet of the compound packet (as before any previous calls ot rtcp_next_packet() */ /* put the read pointer at the first RTCP packet of the compound packet (as before any previous calls ot rtcp_next_packet() */
void rtcp_rewind(mblk_t *m); ORTP_PUBLIC void rtcp_rewind(mblk_t *m);
/* get common header*/ /* get common header*/
const rtcp_common_header_t * rtcp_get_common_header(const mblk_t *m); ORTP_PUBLIC const rtcp_common_header_t * rtcp_get_common_header(const mblk_ t *m);
/*Sender Report accessors */ /*Sender Report accessors */
/* check if this packet is a SR and if it is correct */ /* check if this packet is a SR and if it is correct */
bool_t rtcp_is_SR(const mblk_t *m); ORTP_PUBLIC bool_t rtcp_is_SR(const mblk_t *m);
uint32_t rtcp_SR_get_ssrc(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_SR_get_ssrc(const mblk_t *m);
const sender_info_t * rtcp_SR_get_sender_info(const mblk_t *m); ORTP_PUBLIC const sender_info_t * rtcp_SR_get_sender_info(const mblk_t *m);
const report_block_t * rtcp_SR_get_report_block(const mblk_t *m, int idx); ORTP_PUBLIC const report_block_t * rtcp_SR_get_report_block(const mblk_t *m
, int idx);
/*Receiver report accessors*/ /*Receiver report accessors*/
bool_t rtcp_is_RR(const mblk_t *m); ORTP_PUBLIC bool_t rtcp_is_RR(const mblk_t *m);
uint32_t rtcp_RR_get_ssrc(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_RR_get_ssrc(const mblk_t *m);
const report_block_t * rtcp_RR_get_report_block(const mblk_t *m,int idx); ORTP_PUBLIC const report_block_t * rtcp_RR_get_report_block(const mblk_t *m
,int idx);
/*SDES accessors */ /*SDES accessors */
bool_t rtcp_is_SDES(const mblk_t *m); ORTP_PUBLIC bool_t rtcp_is_SDES(const mblk_t *m);
typedef void (*SdesItemFoundCallback)(void *user_data, uint32_t csrc, rtcp_ sdes_type_t t, const char *content, uint8_t content_len); typedef void (*SdesItemFoundCallback)(void *user_data, uint32_t csrc, rtcp_ sdes_type_t t, const char *content, uint8_t content_len);
void rtcp_sdes_parse(const mblk_t *m, SdesItemFoundCallback cb, void *user_ data); ORTP_PUBLIC void rtcp_sdes_parse(const mblk_t *m, SdesItemFoundCallback cb, void *user_data);
/*BYE accessors */ /*BYE accessors */
bool_t rtcp_is_BYE(const mblk_t *m); ORTP_PUBLIC bool_t rtcp_is_BYE(const mblk_t *m);
bool_t rtcp_BYE_get_ssrc(const mblk_t *m, int idx, uint32_t *ssrc); ORTP_PUBLIC bool_t rtcp_BYE_get_ssrc(const mblk_t *m, int idx, uint32_t *ss
bool_t rtcp_BYE_get_reason(const mblk_t *m, const char **reason, int *reaso rc);
n_len); ORTP_PUBLIC bool_t rtcp_BYE_get_reason(const mblk_t *m, const char **reason
, int *reason_len);
/*APP accessors */ /*APP accessors */
bool_t rtcp_is_APP(const mblk_t *m); ORTP_PUBLIC bool_t rtcp_is_APP(const mblk_t *m);
int rtcp_APP_get_subtype(const mblk_t *m); ORTP_PUBLIC int rtcp_APP_get_subtype(const mblk_t *m);
uint32_t rtcp_APP_get_ssrc(const mblk_t *m); ORTP_PUBLIC uint32_t rtcp_APP_get_ssrc(const mblk_t *m);
/* name argument is supposed to be at least 4 characters (note: no '\0' wri tten)*/ /* name argument is supposed to be at least 4 characters (note: no '\0' wri tten)*/
void rtcp_APP_get_name(const mblk_t *m, char *name); ORTP_PUBLIC void rtcp_APP_get_name(const mblk_t *m, char *name);
/* retrieve the data. when returning, data points directly into the mblk_t */ /* retrieve the data. when returning, data points directly into the mblk_t */
void rtcp_APP_get_data(const mblk_t *m, uint8_t **data, int *len); ORTP_PUBLIC void rtcp_APP_get_data(const mblk_t *m, uint8_t **data, int *le n);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 12 change blocks. 
23 lines changed or deleted 26 lines changed or added


 rtp.h   rtp.h 
skipping to change at line 77 skipping to change at line 77
uint64_t discarded; /* incoming packets discarded becaus e the queue exceeds its max size */ uint64_t discarded; /* incoming packets discarded becaus e the queue exceeds its max size */
uint64_t sent_rtcp_packets; /* sent RTCP packets counter (only p ackets that embed a report block are considered) */ uint64_t sent_rtcp_packets; /* sent RTCP packets counter (only p ackets that embed a report block are considered) */
} rtp_stats_t; } rtp_stats_t;
typedef struct jitter_stats typedef struct jitter_stats
{ {
uint32_t jitter; /* interarrival jitter at la st emitted sender report */ uint32_t jitter; /* interarrival jitter at la st emitted sender report */
uint32_t max_jitter; /* biggest interarrival jitter (valu e in stream clock unit) */ uint32_t max_jitter; /* biggest interarrival jitter (valu e in stream clock unit) */
uint64_t sum_jitter; /* sum of all interarrival jitter (v alue in stream clock unit) */ uint64_t sum_jitter; /* sum of all interarrival jitter (v alue in stream clock unit) */
uint64_t max_jitter_ts; /* date (in ms since Epoch) of the b iggest interarrival jitter */ uint64_t max_jitter_ts; /* date (in ms since Epoch) of the b iggest interarrival jitter */
float jitter_buffer_size_ms; /* mean jitter buffer size in millis econds.*/
} jitter_stats_t; } jitter_stats_t;
#define RTP_TIMESTAMP_IS_NEWER_THAN(ts1,ts2) \ #define RTP_TIMESTAMP_IS_NEWER_THAN(ts1,ts2) \
((uint32_t)((uint32_t)(ts1) - (uint32_t)(ts2))< (uint32_t)(1<<31)) ((uint32_t)((uint32_t)(ts1) - (uint32_t)(ts2))< (uint32_t)(1<<31))
#define RTP_TIMESTAMP_IS_STRICTLY_NEWER_THAN(ts1,ts2) \ #define RTP_TIMESTAMP_IS_STRICTLY_NEWER_THAN(ts1,ts2) \
( ((uint32_t)((uint32_t)(ts1) - (uint32_t)(ts2))< (uint32_t)(1<<31)) && (ts1)!=(ts2) ) ( ((uint32_t)((uint32_t)(ts1) - (uint32_t)(ts2))< (uint32_t)(1<<31)) && (ts1)!=(ts2) )
#define TIME_IS_NEWER_THAN(t1,t2) RTP_TIMESTAMP_IS_NEWER_THAN(t1,t2) #define TIME_IS_NEWER_THAN(t1,t2) RTP_TIMESTAMP_IS_NEWER_THAN(t1,t2)
skipping to change at line 99 skipping to change at line 100
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
/* packet api */ /* packet api */
/* the first argument is a mblk_t. The header is supposed to be not splitte d */ /* the first argument is a mblk_t. The header is supposed to be not splitte d */
#define rtp_set_markbit(mp,value) ((rtp_header_t*)((mp)->b_rpt r))->markbit=(value) #define rtp_set_markbit(mp,value) ((rtp_header_t*)((mp)->b_rpt r))->markbit=(value)
#define rtp_set_seqnumber(mp,seq) ((rtp_header_t*)((mp)->b_rptr))->seq _number=(seq) #define rtp_set_seqnumber(mp,seq) ((rtp_header_t*)((mp)->b_rptr))->seq _number=(seq)
#define rtp_set_timestamp(mp,ts) ((rtp_header_t*)((mp)->b_rptr))->tim estamp=(ts) #define rtp_set_timestamp(mp,ts) ((rtp_header_t*)((mp)->b_rptr))->tim estamp=(ts)
#define rtp_set_ssrc(mp,_ssrc) ((rtp_header_t*)((mp)->b_rptr))->ssr c=(_ssrc) #define rtp_set_ssrc(mp,_ssrc) ((rtp_header_t*)((mp)->b_rptr))->ssr c=(_ssrc)
void rtp_add_csrc(mblk_t *mp ,uint32_t csrc); ORTP_PUBLIC void rtp_add_csrc(mblk_t *mp ,uint32_t csrc);
#define rtp_set_payload_type(mp,pt) ((rtp_header_t*)((mp)->b_rptr))->pay type=(pt) #define rtp_set_payload_type(mp,pt) ((rtp_header_t*)((mp)->b_rptr))->pay type=(pt)
#define rtp_get_markbit(mp) (((rtp_header_t*)((mp)->b_rptr))->markbit) #define rtp_get_markbit(mp) (((rtp_header_t*)((mp)->b_rptr))->markbit)
#define rtp_get_extbit(mp) (((rtp_header_t*)((mp)->b_rptr))->extbit) #define rtp_get_extbit(mp) (((rtp_header_t*)((mp)->b_rptr))->extbit)
#define rtp_get_timestamp(mp) (((rtp_header_t*)((mp)->b_rptr))->timestamp) #define rtp_get_timestamp(mp) (((rtp_header_t*)((mp)->b_rptr))->timestamp)
#define rtp_get_seqnumber(mp) (((rtp_header_t*)((mp)->b_rptr))->seq_number ) #define rtp_get_seqnumber(mp) (((rtp_header_t*)((mp)->b_rptr))->seq_number )
#define rtp_get_payload_type(mp) (((rtp_header_t*)((mp)->b_rptr))->pa ytype) #define rtp_get_payload_type(mp) (((rtp_header_t*)((mp)->b_rptr))->pa ytype)
#define rtp_get_ssrc(mp) (((rtp_header_t*)((mp)->b_rptr))->ss rc) #define rtp_get_ssrc(mp) (((rtp_header_t*)((mp)->b_rptr))->ss rc)
#define rtp_get_cc(mp) (((rtp_header_t*)((mp)->b_rptr))->cc) #define rtp_get_cc(mp) (((rtp_header_t*)((mp)->b_rptr))->cc)
#define rtp_get_csrc(mp, idx) (((rtp_header_t*)((mp)->b_rptr))->cs rc[idx]) #define rtp_get_csrc(mp, idx) (((rtp_header_t*)((mp)->b_rptr))->cs rc[idx])
int rtp_get_payload(mblk_t *packet, unsigned char **start); ORTP_PUBLIC int rtp_get_payload(mblk_t *packet, unsigned char **start);
int rtp_get_extheader(mblk_t *packet, uint16_t *profile, uint8_t **start_ex ORTP_PUBLIC int rtp_get_extheader(mblk_t *packet, uint16_t *profile, uint8_
t); t **start_ext);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 3 change blocks. 
4 lines changed or deleted 5 lines changed or added


 rtpsession.h   rtpsession.h 
skipping to change at line 35 skipping to change at line 35
* local and remote network addresses and a payload type is given, it let y ou send * local and remote network addresses and a payload type is given, it let y ou send
* and recv a media stream. * and recv a media stream.
**/ **/
#ifndef RTPSESSION_H #ifndef RTPSESSION_H
#define RTPSESSION_H #define RTPSESSION_H
#include <ortp/port.h> #include <ortp/port.h>
#include <ortp/rtp.h> #include <ortp/rtp.h>
#include <ortp/payloadtype.h> #include <ortp/payloadtype.h>
#include <ortp/rtpprofile.h>
#include <ortp/sessionset.h> #include <ortp/sessionset.h>
#include <ortp/rtcp.h> #include <ortp/rtcp.h>
#include <ortp/str_utils.h> #include <ortp/str_utils.h>
#include <ortp/rtpsignaltable.h> #include <ortp/rtpsignaltable.h>
#include <ortp/event.h> #include <ortp/event.h>
typedef enum { typedef enum {
RTP_SESSION_RECVONLY, RTP_SESSION_RECVONLY,
RTP_SESSION_SENDONLY, RTP_SESSION_SENDONLY,
RTP_SESSION_SENDRECV RTP_SESSION_SENDRECV
skipping to change at line 60 skipping to change at line 61
int min_size; /**< in milliseconds*/ int min_size; /**< in milliseconds*/
int nom_size; /**< idem */ int nom_size; /**< idem */
int max_size; /**< idem */ int max_size; /**< idem */
bool_t adaptive; bool_t adaptive;
bool_t pad[3]; bool_t pad[3];
int max_packets; /**< max number of packets allowed to be queued in the jitter buffer */ int max_packets; /**< max number of packets allowed to be queued in the jitter buffer */
} JBParameters; } JBParameters;
typedef struct _JitterControl typedef struct _JitterControl
{ {
int count; unsigned int count;
int jitt_comp; /* the user jitt_comp in miliseconds*/ int jitt_comp; /* the user jitt_comp in miliseconds*/
int jitt_comp_ts; /* the jitt_comp converted in rtp time (same unit as timestamp) */ int jitt_comp_ts; /* the jitt_comp converted in rtp time (same unit as timestamp) */
int adapt_jitt_comp_ts; int adapt_jitt_comp_ts;
int64_t slide; int64_t slide;
int64_t prev_slide; int64_t prev_slide;
float jitter; float jitter;
int olddiff; int olddiff;
float inter_jitter; /* interarrival jitter as defined in the RFC */ float inter_jitter; /* interarrival jitter as defined in the RFC */
int corrective_step; int corrective_step;
int corrective_slide; int corrective_slide;
uint64_t cum_jitter_buffer_size; /*in timestamp units*/
unsigned int cum_jitter_buffer_count; /*used for computation of jitt
er buffer size*/
int clock_rate;
bool_t adaptive; bool_t adaptive;
bool_t enabled; bool_t enabled;
} JitterControl; } JitterControl;
typedef struct _WaitPoint typedef struct _WaitPoint
{ {
ortp_mutex_t lock; ortp_mutex_t lock;
ortp_cond_t cond; ortp_cond_t cond;
uint32_t time; uint32_t time;
bool_t wakeup; bool_t wakeup;
skipping to change at line 165 skipping to change at line 169
int ssrc_changed_thres; int ssrc_changed_thres;
jitter_stats_t jitter_stats; jitter_stats_t jitter_stats;
}RtpStream; }RtpStream;
typedef struct _RtcpStream typedef struct _RtcpStream
{ {
ortp_socket_t socket; ortp_socket_t socket;
int sockfamily; int sockfamily;
struct _RtpTransport *tr; struct _RtpTransport *tr;
mblk_t *cached_mp; mblk_t *cached_mp;
int loc_port;
#ifdef ORTP_INET6 #ifdef ORTP_INET6
struct sockaddr_storage rem_addr; struct sockaddr_storage rem_addr;
#else #else
struct sockaddr_in rem_addr; struct sockaddr_in rem_addr;
#endif #endif
int rem_addrlen; int rem_addrlen;
int interval; int interval;
uint32_t last_rtcp_report_snt_r; /* the time of the last rtcp report sent, in recv timestamp unit */ uint32_t last_rtcp_report_snt_r; /* the time of the last rtcp report sent, in recv timestamp unit */
uint32_t last_rtcp_report_snt_s; /* the time of the last rtcp report sent, in send timestamp unit */ uint32_t last_rtcp_report_snt_s; /* the time of the last rtcp report sent, in send timestamp unit */
uint32_t rtcp_report_snt_interval_r; /* the interval in timestamp un it for receive path between rtcp report sent */ uint32_t rtcp_report_snt_interval_r; /* the interval in timestamp un it for receive path between rtcp report sent */
skipping to change at line 239 skipping to change at line 244
queue_t contributing_sources; queue_t contributing_sources;
unsigned int lost_packets_test_vector; unsigned int lost_packets_test_vector;
unsigned int interarrival_jitter_test_vector; unsigned int interarrival_jitter_test_vector;
unsigned int delay_test_vector; unsigned int delay_test_vector;
float rtt;/*last round trip delay calculated*/ float rtt;/*last round trip delay calculated*/
OrtpNetworkSimulatorCtx *net_sim_ctx; OrtpNetworkSimulatorCtx *net_sim_ctx;
bool_t symmetric_rtp; bool_t symmetric_rtp;
bool_t permissive; /*use the permissive algorithm*/ bool_t permissive; /*use the permissive algorithm*/
bool_t use_connect; /* use connect() on the socket */ bool_t use_connect; /* use connect() on the socket */
bool_t ssrc_set; bool_t ssrc_set;
bool_t reuseaddr; /*setsockopt SO_REUSEADDR */
}; };
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif #endif
/* public API */ /* public API */
RtpSession *rtp_session_new(int mode); ORTP_PUBLIC RtpSession *rtp_session_new(int mode);
void rtp_session_set_scheduling_mode(RtpSession *session, int yesno); ORTP_PUBLIC void rtp_session_set_scheduling_mode(RtpSession *session, int y
void rtp_session_set_blocking_mode(RtpSession *session, int yesno); esno);
void rtp_session_set_profile(RtpSession *session, RtpProfile *profile); ORTP_PUBLIC void rtp_session_set_blocking_mode(RtpSession *session, int yes
void rtp_session_set_send_profile(RtpSession *session,RtpProfile *profile); no);
void rtp_session_set_recv_profile(RtpSession *session,RtpProfile *profile); ORTP_PUBLIC void rtp_session_set_profile(RtpSession *session, RtpProfile *p
RtpProfile *rtp_session_get_profile(RtpSession *session); rofile);
RtpProfile *rtp_session_get_send_profile(RtpSession *session); ORTP_PUBLIC void rtp_session_set_send_profile(RtpSession *session,RtpProfil
RtpProfile *rtp_session_get_recv_profile(RtpSession *session); e *profile);
int rtp_session_signal_connect(RtpSession *session,const char *signal_name, ORTP_PUBLIC void rtp_session_set_recv_profile(RtpSession *session,RtpProfil
RtpCallback cb, unsigned long user_data); e *profile);
int rtp_session_signal_disconnect_by_callback(RtpSession *session,const cha ORTP_PUBLIC RtpProfile *rtp_session_get_profile(RtpSession *session);
r *signal_name, RtpCallback cb); ORTP_PUBLIC RtpProfile *rtp_session_get_send_profile(RtpSession *session);
void rtp_session_set_ssrc(RtpSession *session, uint32_t ssrc); ORTP_PUBLIC RtpProfile *rtp_session_get_recv_profile(RtpSession *session);
uint32_t rtp_session_get_send_ssrc(RtpSession* session); ORTP_PUBLIC int rtp_session_signal_connect(RtpSession *session,const char *
void rtp_session_set_seq_number(RtpSession *session, uint16_t seq); signal_name, RtpCallback cb, unsigned long user_data);
uint16_t rtp_session_get_seq_number(RtpSession *session); ORTP_PUBLIC int rtp_session_signal_disconnect_by_callback(RtpSession *sessi
on,const char *signal_name, RtpCallback cb);
void rtp_session_enable_jitter_buffer(RtpSession *session , bool_t enabled) ORTP_PUBLIC void rtp_session_set_ssrc(RtpSession *session, uint32_t ssrc);
; ORTP_PUBLIC uint32_t rtp_session_get_send_ssrc(RtpSession* session);
bool_t rtp_session_jitter_buffer_enabled(const RtpSession *session); ORTP_PUBLIC uint32_t rtp_session_get_recv_ssrc(RtpSession *session);
void rtp_session_set_jitter_buffer_params(RtpSession *session, const JBPara ORTP_PUBLIC void rtp_session_set_seq_number(RtpSession *session, uint16_t s
meters *par); eq);
void rtp_session_get_jitter_buffer_params(RtpSession *session, JBParameters ORTP_PUBLIC uint16_t rtp_session_get_seq_number(RtpSession *session);
*par); ORTP_PUBLIC uint32_t rtp_session_get_rcv_ext_seq_number(RtpSession *session
);
ORTP_PUBLIC void rtp_session_enable_jitter_buffer(RtpSession *session , boo
l_t enabled);
ORTP_PUBLIC bool_t rtp_session_jitter_buffer_enabled(const RtpSession *sess
ion);
ORTP_PUBLIC void rtp_session_set_jitter_buffer_params(RtpSession *session,
const JBParameters *par);
ORTP_PUBLIC void rtp_session_get_jitter_buffer_params(RtpSession *session,
JBParameters *par);
/*deprecated jitter control functions*/ /*deprecated jitter control functions*/
void rtp_session_set_jitter_compensation(RtpSession *session, int milisec); ORTP_PUBLIC void rtp_session_set_jitter_compensation(RtpSession *session, i
void rtp_session_enable_adaptive_jitter_compensation(RtpSession *session, b nt milisec);
ool_t val); ORTP_PUBLIC void rtp_session_enable_adaptive_jitter_compensation(RtpSession
bool_t rtp_session_adaptive_jitter_compensation_enabled(RtpSession *session *session, bool_t val);
); ORTP_PUBLIC bool_t rtp_session_adaptive_jitter_compensation_enabled(RtpSess
ion *session);
void rtp_session_set_time_jump_limit(RtpSession *session, int miliseconds);
int rtp_session_set_local_addr(RtpSession *session,const char *addr, int po ORTP_PUBLIC void rtp_session_set_time_jump_limit(RtpSession *session, int m
rt); iliseconds);
int rtp_session_get_local_port(const RtpSession *session); ORTP_PUBLIC int rtp_session_set_local_addr(RtpSession *session,const char *
addr, int rtp_port, int rtcp_port);
ORTP_PUBLIC int rtp_session_get_local_port(const RtpSession *session);
int ORTP_PUBLIC int
rtp_session_set_remote_addr_full (RtpSession * session, const char * addr, rtp_session_set_remote_addr_full (RtpSession * session, const char * rtp_ad
int rtp_port, int rtcp_port); dr, int rtp_port, const char * rtcp_addr, int rtcp_port);
/*same as previous function, old name:*/ /*same as previous function, old name:*/
int rtp_session_set_remote_addr_and_port (RtpSession * session, const char ORTP_PUBLIC int rtp_session_set_remote_addr_and_port (RtpSession * session,
* addr, int rtp_port, int rtcp_port); const char * addr, int rtp_port, int rtcp_port);
int rtp_session_set_remote_addr(RtpSession *session,const char *addr, int p ORTP_PUBLIC int rtp_session_set_remote_addr(RtpSession *session,const char
ort); *addr, int port);
/* alternatively to the set_remote_addr() and set_local_addr(), an applicat ion can give /* alternatively to the set_remote_addr() and set_local_addr(), an applicat ion can give
a valid socket (potentially connect()ed )to be used by the RtpSession */ a valid socket (potentially connect()ed )to be used by the RtpSession */
void rtp_session_set_sockets(RtpSession *session, int rtpfd, int rtcpfd); ORTP_PUBLIC void rtp_session_set_sockets(RtpSession *session, int rtpfd, in
void rtp_session_set_transports(RtpSession *session, RtpTransport *rtptr, R t rtcpfd);
tpTransport *rtcptr); ORTP_PUBLIC void rtp_session_set_transports(RtpSession *session, RtpTranspo
rt *rtptr, RtpTransport *rtcptr);
/*those methods are provided for people who wants to send non-RTP messages using the RTP/RTCP sockets */ /*those methods are provided for people who wants to send non-RTP messages using the RTP/RTCP sockets */
ortp_socket_t rtp_session_get_rtp_socket(const RtpSession *session); ORTP_PUBLIC ortp_socket_t rtp_session_get_rtp_socket(const RtpSession *sess
ortp_socket_t rtp_session_get_rtcp_socket(const RtpSession *session); ion);
ORTP_PUBLIC ortp_socket_t rtp_session_get_rtcp_socket(const RtpSession *ses
sion);
/* QOS / DSCP */ /* QOS / DSCP */
int rtp_session_set_dscp(RtpSession *session, int dscp); ORTP_PUBLIC int rtp_session_set_dscp(RtpSession *session, int dscp);
int rtp_session_get_dscp(const RtpSession *session); ORTP_PUBLIC int rtp_session_get_dscp(const RtpSession *session);
/* Packet info */
ORTP_PUBLIC int rtp_session_set_pktinfo(RtpSession *session, int activate);
/* Multicast methods */ /* Multicast methods */
int rtp_session_set_multicast_ttl(RtpSession *session, int ttl); ORTP_PUBLIC int rtp_session_set_multicast_ttl(RtpSession *session, int ttl)
int rtp_session_get_multicast_ttl(RtpSession *session); ;
ORTP_PUBLIC int rtp_session_get_multicast_ttl(RtpSession *session);
int rtp_session_set_multicast_loopback(RtpSession *session, int yesno); ORTP_PUBLIC int rtp_session_set_multicast_loopback(RtpSession *session, int
int rtp_session_get_multicast_loopback(RtpSession *session); yesno);
ORTP_PUBLIC int rtp_session_get_multicast_loopback(RtpSession *session);
int rtp_session_set_send_payload_type(RtpSession *session, int paytype); ORTP_PUBLIC int rtp_session_set_send_payload_type(RtpSession *session, int
int rtp_session_get_send_payload_type(const RtpSession *session); paytype);
ORTP_PUBLIC int rtp_session_get_send_payload_type(const RtpSession *session
);
int rtp_session_get_recv_payload_type(const RtpSession *session); ORTP_PUBLIC int rtp_session_get_recv_payload_type(const RtpSession *session
int rtp_session_set_recv_payload_type(RtpSession *session, int pt); );
ORTP_PUBLIC int rtp_session_set_recv_payload_type(RtpSession *session, int
pt);
int rtp_session_set_payload_type(RtpSession *session, int pt); ORTP_PUBLIC int rtp_session_set_payload_type(RtpSession *session, int pt);
void rtp_session_set_symmetric_rtp (RtpSession * session, bool_t yesno); ORTP_PUBLIC void rtp_session_set_symmetric_rtp (RtpSession * session, bool_ t yesno);
void rtp_session_set_connected_mode(RtpSession *session, bool_t yesno); ORTP_PUBLIC void rtp_session_set_connected_mode(RtpSession *session, bool_t yesno);
void rtp_session_enable_rtcp(RtpSession *session, bool_t yesno); ORTP_PUBLIC void rtp_session_enable_rtcp(RtpSession *session, bool_t yesno) ;
void rtp_session_set_rtcp_report_interval(RtpSession *session, int value_ms ); ORTP_PUBLIC void rtp_session_set_rtcp_report_interval(RtpSession *session, int value_ms);
void rtp_session_set_ssrc_changed_threshold(RtpSession *session, int numpac kets); ORTP_PUBLIC void rtp_session_set_ssrc_changed_threshold(RtpSession *session , int numpackets);
/*low level recv and send functions */ /*low level recv and send functions */
mblk_t * rtp_session_recvm_with_ts (RtpSession * session, uint32_t user_ts) ORTP_PUBLIC mblk_t * rtp_session_recvm_with_ts (RtpSession * session, uint3
; 2_t user_ts);
mblk_t * rtp_session_create_packet(RtpSession *session,int header_size, con ORTP_PUBLIC mblk_t * rtp_session_create_packet(RtpSession *session,int head
st uint8_t *payload, int payload_size); er_size, const uint8_t *payload, int payload_size);
mblk_t * rtp_session_create_packet_with_data(RtpSession *session, uint8_t * ORTP_PUBLIC mblk_t * rtp_session_create_packet_with_data(RtpSession *sessio
payload, int payload_size, void (*freefn)(void*)); n, uint8_t *payload, int payload_size, void (*freefn)(void*));
mblk_t * rtp_session_create_packet_in_place(RtpSession *session,uint8_t *bu ORTP_PUBLIC mblk_t * rtp_session_create_packet_in_place(RtpSession *session
ffer, int size, void (*freefn)(void*) ); ,uint8_t *buffer, int size, void (*freefn)(void*) );
int rtp_session_sendm_with_ts (RtpSession * session, mblk_t *mp, uint32_t u ORTP_PUBLIC int rtp_session_sendm_with_ts (RtpSession * session, mblk_t *mp
serts); , uint32_t userts);
/* high level recv and send functions */ /* high level recv and send functions */
int rtp_session_recv_with_ts(RtpSession *session, uint8_t *buffer, int len, ORTP_PUBLIC int rtp_session_recv_with_ts(RtpSession *session, uint8_t *buff
uint32_t ts, int *have_more); er, int len, uint32_t ts, int *have_more);
int rtp_session_send_with_ts(RtpSession *session, const uint8_t *buffer, in ORTP_PUBLIC int rtp_session_send_with_ts(RtpSession *session, const uint8_t
t len, uint32_t userts); *buffer, int len, uint32_t userts);
/* event API*/ /* event API*/
void rtp_session_register_event_queue(RtpSession *session, OrtpEvQueue *q); ORTP_PUBLIC void rtp_session_register_event_queue(RtpSession *session, Ortp
void rtp_session_unregister_event_queue(RtpSession *session, OrtpEvQueue *q EvQueue *q);
); ORTP_PUBLIC void rtp_session_unregister_event_queue(RtpSession *session, Or
tpEvQueue *q);
/* IP bandwidth usage estimation functions, returning bits/s*/ /* IP bandwidth usage estimation functions, returning bits/s*/
float rtp_session_compute_send_bandwidth(RtpSession *session); ORTP_PUBLIC float rtp_session_compute_send_bandwidth(RtpSession *session);
float rtp_session_compute_recv_bandwidth(RtpSession *session); ORTP_PUBLIC float rtp_session_compute_recv_bandwidth(RtpSession *session);
void rtp_session_send_rtcp_APP(RtpSession *session, uint8_t subtype, const char *name, const uint8_t *data, int datalen); ORTP_PUBLIC void rtp_session_send_rtcp_APP(RtpSession *session, uint8_t sub type, const char *name, const uint8_t *data, int datalen);
uint32_t rtp_session_get_current_send_ts(RtpSession *session); ORTP_PUBLIC uint32_t rtp_session_get_current_send_ts(RtpSession *session);
uint32_t rtp_session_get_current_recv_ts(RtpSession *session); ORTP_PUBLIC uint32_t rtp_session_get_current_recv_ts(RtpSession *session);
void rtp_session_flush_sockets(RtpSession *session); ORTP_PUBLIC void rtp_session_flush_sockets(RtpSession *session);
void rtp_session_release_sockets(RtpSession *session); ORTP_PUBLIC void rtp_session_release_sockets(RtpSession *session);
void rtp_session_resync(RtpSession *session); ORTP_PUBLIC void rtp_session_resync(RtpSession *session);
void rtp_session_reset(RtpSession *session); ORTP_PUBLIC void rtp_session_reset(RtpSession *session);
void rtp_session_destroy(RtpSession *session); ORTP_PUBLIC void rtp_session_destroy(RtpSession *session);
const rtp_stats_t * rtp_session_get_stats(const RtpSession *session); ORTP_PUBLIC const rtp_stats_t * rtp_session_get_stats(const RtpSession *ses
const jitter_stats_t * rtp_session_get_jitter_stats( const RtpSession *sess sion);
ion ); ORTP_PUBLIC const jitter_stats_t * rtp_session_get_jitter_stats( const RtpS
void rtp_session_reset_stats(RtpSession *session); ession *session );
ORTP_PUBLIC void rtp_session_reset_stats(RtpSession *session);
void rtp_session_set_data(RtpSession *session, void *data);
void *rtp_session_get_data(const RtpSession *session); ORTP_PUBLIC void rtp_session_set_data(RtpSession *session, void *data);
ORTP_PUBLIC void *rtp_session_get_data(const RtpSession *session);
void rtp_session_set_recv_buf_size(RtpSession *session, int bufsize);
void rtp_session_set_rtp_socket_send_buffer_size(RtpSession * session, unsi ORTP_PUBLIC void rtp_session_set_recv_buf_size(RtpSession *session, int buf
gned int size); size);
void rtp_session_set_rtp_socket_recv_buffer_size(RtpSession * session, unsi ORTP_PUBLIC void rtp_session_set_rtp_socket_send_buffer_size(RtpSession * s
gned int size); ession, unsigned int size);
ORTP_PUBLIC void rtp_session_set_rtp_socket_recv_buffer_size(RtpSession * s
ession, unsigned int size);
/* in use with the scheduler to convert a timestamp in scheduler time unit (ms) */ /* in use with the scheduler to convert a timestamp in scheduler time unit (ms) */
uint32_t rtp_session_ts_to_time(RtpSession *session,uint32_t timestamp); ORTP_PUBLIC uint32_t rtp_session_ts_to_time(RtpSession *session,uint32_t ti
uint32_t rtp_session_time_to_ts(RtpSession *session, int millisecs); mestamp);
ORTP_PUBLIC uint32_t rtp_session_time_to_ts(RtpSession *session, int millis
ecs);
/* this function aims at simulating senders with "imprecise" clocks, result ing in /* this function aims at simulating senders with "imprecise" clocks, result ing in
rtp packets sent with timestamp uncorrelated with the system clock . rtp packets sent with timestamp uncorrelated with the system clock .
This is only availlable to sessions working with the oRTP scheduler */ This is only availlable to sessions working with the oRTP scheduler */
void rtp_session_make_time_distorsion(RtpSession *session, int milisec); ORTP_PUBLIC void rtp_session_make_time_distorsion(RtpSession *session, int milisec);
/*RTCP functions */ /*RTCP functions */
void rtp_session_set_source_description(RtpSession *session, const char *cn ame, ORTP_PUBLIC void rtp_session_set_source_description(RtpSession *session, co nst char *cname,
const char *name, const char *email, const char *phone, const char *name, const char *email, const char *phone,
const char *loc, const char *tool, const char *note); const char *loc, const char *tool, const char *note);
void rtp_session_add_contributing_source(RtpSession *session, uint32_t csrc , ORTP_PUBLIC void rtp_session_add_contributing_source(RtpSession *session, u int32_t csrc,
const char *cname, const char *name, const char *email, const char *pho ne, const char *cname, const char *name, const char *email, const char *pho ne,
const char *loc, const char *tool, const char *note); const char *loc, const char *tool, const char *note);
void rtp_session_remove_contributing_sources(RtpSession *session, uint32_t ORTP_PUBLIC void rtp_session_remove_contributing_sources(RtpSession *sessio
csrc); n, uint32_t csrc);
mblk_t* rtp_session_create_rtcp_sdes_packet(RtpSession *session); ORTP_PUBLIC mblk_t* rtp_session_create_rtcp_sdes_packet(RtpSession *session
);
void rtp_session_get_last_recv_time(RtpSession *session, struct timeval *tv ORTP_PUBLIC void rtp_session_get_last_recv_time(RtpSession *session, struct
); timeval *tv);
int rtp_session_bye(RtpSession *session, const char *reason); ORTP_PUBLIC int rtp_session_bye(RtpSession *session, const char *reason);
int rtp_session_get_last_send_error_code(RtpSession *session); ORTP_PUBLIC int rtp_session_get_last_send_error_code(RtpSession *session);
void rtp_session_clear_send_error_code(RtpSession *session); ORTP_PUBLIC void rtp_session_clear_send_error_code(RtpSession *session);
int rtp_session_get_last_recv_error_code(RtpSession *session); ORTP_PUBLIC int rtp_session_get_last_recv_error_code(RtpSession *session);
void rtp_session_clear_recv_error_code(RtpSession *session); ORTP_PUBLIC void rtp_session_clear_recv_error_code(RtpSession *session);
float rtp_session_get_round_trip_propagation(RtpSession *session); ORTP_PUBLIC float rtp_session_get_round_trip_propagation(RtpSession *sessio
n);
void rtp_session_enable_network_simulation(RtpSession *session, const OrtpN
etworkSimulatorParams *params); ORTP_PUBLIC void rtp_session_enable_network_simulation(RtpSession *session,
void rtp_session_rtcp_set_lost_packet_value( RtpSession *session, const uns const OrtpNetworkSimulatorParams *params);
igned int value ); ORTP_PUBLIC void rtp_session_rtcp_set_lost_packet_value( RtpSession *sessio
void rtp_session_rtcp_set_jitter_value(RtpSession *session, const unsigned n, const unsigned int value );
int value ); ORTP_PUBLIC void rtp_session_rtcp_set_jitter_value(RtpSession *session, con
void rtp_session_rtcp_set_delay_value(RtpSession *session, const unsigned i st unsigned int value );
nt value ); ORTP_PUBLIC void rtp_session_rtcp_set_delay_value(RtpSession *session, cons
mblk_t * rtp_session_pick_with_cseq (RtpSession * session, const uint16_t s t unsigned int value );
equence_number); ORTP_PUBLIC mblk_t * rtp_session_pick_with_cseq (RtpSession * session, cons
t uint16_t sequence_number);
/*private */ /*private */
void rtp_session_init(RtpSession *session, int mode); ORTP_PUBLIC void rtp_session_init(RtpSession *session, int mode);
#define rtp_session_set_flag(session,flag) (session)->flags|=(flag) #define rtp_session_set_flag(session,flag) (session)->flags|=(flag)
#define rtp_session_unset_flag(session,flag) (session)->flags&=~(flag) #define rtp_session_unset_flag(session,flag) (session)->flags&=~(flag)
void rtp_session_uninit(RtpSession *session); ORTP_PUBLIC void rtp_session_uninit(RtpSession *session);
ORTP_PUBLIC void rtp_session_dispatch_event(RtpSession *session, OrtpEvent
*ev);
ORTP_PUBLIC void rtp_session_set_reuseaddr(RtpSession *session, bool_t yes)
;
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 37 change blocks. 
135 lines changed or deleted 178 lines changed or added


 sessionset.h   sessionset.h 
skipping to change at line 89 skipping to change at line 89
struct _SessionSet struct _SessionSet
{ {
ortp_fd_set rtpset; ortp_fd_set rtpset;
}; };
typedef struct _SessionSet SessionSet; typedef struct _SessionSet SessionSet;
#define session_set_init(ss) ORTP_FD_ZERO(&(ss)->rtpset) #define session_set_init(ss) ORTP_FD_ZERO(&(ss)->rtpset)
SessionSet * session_set_new(void); ORTP_PUBLIC SessionSet * session_set_new(void);
/** /**
* This macro adds the rtp session to the set. * This macro adds the rtp session to the set.
* @param ss a set (SessionSet object) * @param ss a set (SessionSet object)
* @param rtpsession a RtpSession * @param rtpsession a RtpSession
**/ **/
#define session_set_set(ss,rtpsession) ORTP_FD_SET((rtpsession)->ma sk_pos,&(ss)->rtpset) #define session_set_set(ss,rtpsession) ORTP_FD_SET((rtpsession)->ma sk_pos,&(ss)->rtpset)
/** /**
* This macro tests if the session is part of the set. 1 is returned if tru e, 0 else. * This macro tests if the session is part of the set. 1 is returned if tru e, 0 else.
*@param ss a set (#SessionSet object) *@param ss a set (#SessionSet object)
skipping to change at line 119 skipping to change at line 119
* *
* *
**/ **/
#define session_set_clr(ss,rtpsession) ORTP_FD_CLR((rtpsession)->ma sk_pos,&(ss)->rtpset) #define session_set_clr(ss,rtpsession) ORTP_FD_CLR((rtpsession)->ma sk_pos,&(ss)->rtpset)
#define session_set_copy(dest,src) memcpy(&(dest)->rtpset,&(src )->rtpset,sizeof(ortp_fd_set)) #define session_set_copy(dest,src) memcpy(&(dest)->rtpset,&(src )->rtpset,sizeof(ortp_fd_set))
/** /**
* Frees a SessionSet. * Frees a SessionSet.
**/ **/
void session_set_destroy(SessionSet *set); ORTP_PUBLIC void session_set_destroy(SessionSet *set);
int session_set_select(SessionSet *recvs, SessionSet *sends, SessionSet *er ORTP_PUBLIC int session_set_select(SessionSet *recvs, SessionSet *sends, Se
rors); ssionSet *errors);
int session_set_timedselect(SessionSet *recvs, SessionSet *sends, SessionSe ORTP_PUBLIC int session_set_timedselect(SessionSet *recvs, SessionSet *send
t *errors, struct timeval *timeout); s, SessionSet *errors, struct timeval *timeout);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 3 change blocks. 
6 lines changed or deleted 6 lines changed or added


 str_utils.h   str_utils.h 
skipping to change at line 24 skipping to change at line 24
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/ */
#ifndef STR_UTILS_H #ifndef STR_UTILS_H
#define STR_UTILS_H #define STR_UTILS_H
#include <ortp/port.h> #include <ortp/port.h>
#if defined(ORTP_TIMESTAMP)
#include <time.h>
#endif
#ifndef MIN
#define MIN(a,b) (((a)>(b)) ? (b) : (a))
#endif
#ifndef MAX
#define MAX(a,b) (((a)>(b)) ? (a) : (b))
#endif
#define return_if_fail(expr) if (!(expr)) {printf("%s:%i- assertion"#expr "
failed\n",__FILE__,__LINE__); return;}
#define return_val_if_fail(expr,ret) if (!(expr)) {printf("%s:%i- assertion
" #expr "failed\n",__FILE__,__LINE__); return (ret);}
typedef struct ortp_recv_addr {
int family;
union {
struct in_addr ipi_addr;
struct in6_addr ipi6_addr;
} addr;
} ortp_recv_addr_t;
typedef struct msgb typedef struct msgb
{ {
struct msgb *b_prev; struct msgb *b_prev;
struct msgb *b_next; struct msgb *b_next;
struct msgb *b_cont; struct msgb *b_cont;
struct datab *b_datap; struct datab *b_datap;
unsigned char *b_rptr; unsigned char *b_rptr;
unsigned char *b_wptr; unsigned char *b_wptr;
uint32_t reserved1; uint32_t reserved1;
uint32_t reserved2; uint32_t reserved2;
#if defined(ORTP_TIMESTAMP)
struct timeval timestamp;
#endif
ortp_recv_addr_t recv_addr;
} mblk_t; } mblk_t;
typedef struct datab typedef struct datab
{ {
unsigned char *db_base; unsigned char *db_base;
unsigned char *db_lim; unsigned char *db_lim;
void (*db_freefn)(void*); void (*db_freefn)(void*);
int db_ref; int db_ref;
} dblk_t; } dblk_t;
typedef struct _queue typedef struct _queue
{ {
mblk_t _q_stopper; mblk_t _q_stopper;
int q_mcount; /*number of packet in the q */ int q_mcount; /*number of packet in the q */
} queue_t; } queue_t;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
void qinit(queue_t *q); ORTP_PUBLIC void qinit(queue_t *q);
void putq(queue_t *q, mblk_t *m); ORTP_PUBLIC void putq(queue_t *q, mblk_t *m);
mblk_t * getq(queue_t *q); ORTP_PUBLIC mblk_t * getq(queue_t *q);
void insq(queue_t *q,mblk_t *emp, mblk_t *mp); ORTP_PUBLIC void insq(queue_t *q,mblk_t *emp, mblk_t *mp);
void remq(queue_t *q, mblk_t *mp); ORTP_PUBLIC void remq(queue_t *q, mblk_t *mp);
mblk_t * peekq(queue_t *q); ORTP_PUBLIC mblk_t * peekq(queue_t *q);
/* remove and free all messages in the q */ /* remove and free all messages in the q */
#define FLUSHALL 0 #define FLUSHALL 0
void flushq(queue_t *q, int how); ORTP_PUBLIC void flushq(queue_t *q, int how);
ORTP_PUBLIC void mblk_init(mblk_t *mp);
void mblk_init(mblk_t *mp); ORTP_PUBLIC void mblk_meta_copy(const mblk_t *source, mblk_t *dest);
/* allocates a mblk_t, that points to a datab_t, that points to a buffer of size size. */ /* allocates a mblk_t, that points to a datab_t, that points to a buffer of size size. */
mblk_t *allocb(int size, int unused); ORTP_PUBLIC mblk_t *allocb(int size, int unused);
#define BPRI_MED 0 #define BPRI_MED 0
/* allocates a mblk_t, that points to a datab_t, that points to buf; buf wi ll be freed using freefn */ /* allocates a mblk_t, that points to a datab_t, that points to buf; buf wi ll be freed using freefn */
mblk_t *esballoc(uint8_t *buf, int size, int pri, void (*freefn)(void*) ); ORTP_PUBLIC mblk_t *esballoc(uint8_t *buf, int size, int pri, void (*freefn )(void*) );
/* frees a mblk_t, and if the datab ref_count is 0, frees it and the buffer too */ /* frees a mblk_t, and if the datab ref_count is 0, frees it and the buffer too */
void freeb(mblk_t *m); ORTP_PUBLIC void freeb(mblk_t *m);
/* frees recursively (follow b_cont) a mblk_t, and if the datab /* frees recursively (follow b_cont) a mblk_t, and if the datab
ref_count is 0, frees it and the buffer too */ ref_count is 0, frees it and the buffer too */
void freemsg(mblk_t *mp); ORTP_PUBLIC void freemsg(mblk_t *mp);
/* duplicates a mblk_t , buffer is not duplicated*/ /* duplicates a mblk_t , buffer is not duplicated*/
mblk_t *dupb(mblk_t *m); ORTP_PUBLIC mblk_t *dupb(mblk_t *m);
/* duplicates a complex mblk_t, buffer is not duplicated */ /* duplicates a complex mblk_t, buffer is not duplicated */
mblk_t *dupmsg(mblk_t* m); ORTP_PUBLIC mblk_t *dupmsg(mblk_t* m);
/* returns the size of data of a message */ /* returns the size of data of a message */
int msgdsize(const mblk_t *mp); ORTP_PUBLIC int msgdsize(const mblk_t *mp);
/* concatenates all fragment of a complex message*/ /* concatenates all fragment of a complex message*/
void msgpullup(mblk_t *mp,int len); ORTP_PUBLIC void msgpullup(mblk_t *mp,int len);
/* duplicates a single message, but with buffer included */ /* duplicates a single message, but with buffer included */
mblk_t *copyb(mblk_t *mp); ORTP_PUBLIC mblk_t *copyb(mblk_t *mp);
/* duplicates a complex message with buffer included */ /* duplicates a complex message with buffer included */
mblk_t *copymsg(mblk_t *mp); ORTP_PUBLIC mblk_t *copymsg(mblk_t *mp);
mblk_t * appendb(mblk_t *mp, const char *data, int size, bool_t pad); ORTP_PUBLIC mblk_t * appendb(mblk_t *mp, const char *data, int size, bool_t
void msgappend(mblk_t *mp, const char *data, int size, bool_t pad); pad);
ORTP_PUBLIC void msgappend(mblk_t *mp, const char *data, int size, bool_t p
ad);
mblk_t *concatb(mblk_t *mp, mblk_t *newm); ORTP_PUBLIC mblk_t *concatb(mblk_t *mp, mblk_t *newm);
#define qempty(q) (&(q)->_q_stopper==(q)->_q_stopper.b_next) #define qempty(q) (&(q)->_q_stopper==(q)->_q_stopper.b_next)
#define qfirst(q) ((q)->_q_stopper.b_next!=&(q)->_q_stopper ? (q)->_q_stopp er.b_next : NULL) #define qfirst(q) ((q)->_q_stopper.b_next!=&(q)->_q_stopper ? (q)->_q_stopp er.b_next : NULL)
#define qbegin(q) ((q)->_q_stopper.b_next) #define qbegin(q) ((q)->_q_stopper.b_next)
#define qlast(q) ((q)->_q_stopper.b_prev!=&(q)->_q_stopper ? (q)->_q_stoppe r.b_prev : NULL) #define qlast(q) ((q)->_q_stopper.b_prev!=&(q)->_q_stopper ? (q)->_q_stoppe r.b_prev : NULL)
#define qend(q,mp) ((mp)==&(q)->_q_stopper) #define qend(q,mp) ((mp)==&(q)->_q_stopper)
#define qnext(q,mp) ((mp)->b_next) #define qnext(q,mp) ((mp)->b_next)
typedef struct _msgb_allocator{ typedef struct _msgb_allocator{
queue_t q; queue_t q;
}msgb_allocator_t; }msgb_allocator_t;
void msgb_allocator_init(msgb_allocator_t *pa); ORTP_PUBLIC void msgb_allocator_init(msgb_allocator_t *pa);
mblk_t *msgb_allocator_alloc(msgb_allocator_t *pa, int size); ORTP_PUBLIC mblk_t *msgb_allocator_alloc(msgb_allocator_t *pa, int size);
void msgb_allocator_uninit(msgb_allocator_t *pa); ORTP_PUBLIC void msgb_allocator_uninit(msgb_allocator_t *pa);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 23 change blocks. 
24 lines changed or deleted 55 lines changed or added


 stun.h   stun.h 
skipping to change at line 90 skipping to change at line 90
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" extern "C"
{ {
#endif #endif
/* if you change this version, change in makefile too */ /* if you change this version, change in makefile too */
#define STUN_VERSION "0.99" #define STUN_VERSION "0.99"
#define STUN_MAX_STRING 256 #define STUN_MAX_STRING 514
#define STUN_MAX_UNKNOWN_ATTRIBUTES 8 #define STUN_MAX_UNKNOWN_ATTRIBUTES 8
#define STUN_MAX_MESSAGE_SIZE 2048 #define STUN_MAX_MESSAGE_SIZE 2048
#define STUN_PORT 3478 #define STUN_PORT 3478
/* define some basic types */ /* define some basic types */
#if 0 #if 0
typedef unsigned char uint8_t; typedef unsigned char uint8_t;
typedef unsigned short uint16_t; typedef unsigned short uint16_t;
typedef unsigned int uint32_t; typedef unsigned int uint32_t;
skipping to change at line 430 skipping to change at line 430
StunAddress4 myAddr; StunAddress4 myAddr;
StunAddress4 altAddr; StunAddress4 altAddr;
Socket myFd; Socket myFd;
Socket altPortFd; Socket altPortFd;
Socket altIpFd; Socket altIpFd;
Socket altIpPortFd; Socket altIpPortFd;
bool_t relay; /* true if media relaying is to be done */ bool_t relay; /* true if media relaying is to be done */
StunMediaRelay relays[MAX_MEDIA_RELAYS]; StunMediaRelay relays[MAX_MEDIA_RELAYS];
} StunServerInfo; } StunServerInfo;
void ORTP_PUBLIC void
stunCalculateIntegrity_longterm(char* hmac, const char* input, int length, stunCalculateIntegrity_longterm(char* hmac, const char* input, int length,
const char *username, const char *realm, const char *p assword); const char *username, const char *realm, const char *p assword);
void ORTP_PUBLIC void
stunCalculateIntegrity_shortterm(char* hmac, const char* input, int length, const char* key); stunCalculateIntegrity_shortterm(char* hmac, const char* input, int length, const char* key);
uint32_t ORTP_PUBLIC uint32_t
stunCalculateFingerprint(const char* input, int length); stunCalculateFingerprint(const char* input, int length);
bool_t ORTP_PUBLIC bool_t
stunParseMessage( char* buf, stunParseMessage( char* buf,
unsigned int bufLen, unsigned int bufLen,
StunMessage *message); StunMessage *message);
void ORTP_PUBLIC void
stunBuildReqSimple( StunMessage* msg, stunBuildReqSimple( StunMessage* msg,
const StunAtrString *username, const StunAtrString *username,
bool_t changePort, bool_t changeIp, unsigned int id ); bool_t changePort, bool_t changeIp, unsigned int id );
unsigned int ORTP_PUBLIC unsigned int
stunEncodeMessage( const StunMessage *message, stunEncodeMessage( const StunMessage *message,
char* buf, char* buf,
unsigned int bufLen, unsigned int bufLen,
const StunAtrString *password); const StunAtrString *password);
void ORTP_PUBLIC void
stunCreateUserName(const StunAddress4 *addr, StunAtrString* username); stunCreateUserName(const StunAddress4 *addr, StunAtrString* username);
void ORTP_PUBLIC void
stunGetUserNameAndPassword( const StunAddress4 *dest, stunGetUserNameAndPassword( const StunAddress4 *dest,
StunAtrString* username, StunAtrString* username,
StunAtrString* password); StunAtrString* password);
void ORTP_PUBLIC void
stunCreatePassword(const StunAtrString *username, StunAtrString* password); stunCreatePassword(const StunAtrString *username, StunAtrString* password);
int ORTP_PUBLIC int
stunRand(void); stunRand(void);
uint64_t ORTP_PUBLIC uint64_t
stunGetSystemTimeSecs(void); stunGetSystemTimeSecs(void);
/* find the IP address of a the specified stun server - return false is fai ls parse */ /* find the IP address of a the specified stun server - return false is fai ls parse */
bool_t ORTP_PUBLIC bool_t
stunParseServerName( const char* serverName, StunAddress4 *stunServerAddr); stunParseServerName( const char* serverName, StunAddress4 *stunServerAddr);
bool_t ORTP_PUBLIC bool_t
stunParseHostName( const char* peerName, stunParseHostName( const char* peerName,
uint32_t *ip, uint32_t *ip,
uint16_t *portVal, uint16_t *portVal,
uint16_t defaultPort ); uint16_t defaultPort );
/* return true if all is OK /* return true if all is OK
Create a media relay and do the STERN thing if startMediaPort is non-zer o */ Create a media relay and do the STERN thing if startMediaPort is non-zer o */
bool_t ORTP_PUBLIC bool_t
stunInitServer(StunServerInfo *info, stunInitServer(StunServerInfo *info,
const StunAddress4 *myAddr, const StunAddress4 *myAddr,
const StunAddress4 *altAddr, const StunAddress4 *altAddr,
int startMediaPort); int startMediaPort);
void ORTP_PUBLIC void
stunStopServer(StunServerInfo *info); stunStopServer(StunServerInfo *info);
/* returns number of address found - take array or addres */ /* returns number of address found - take array or addres */
int ORTP_PUBLIC int
stunFindLocalInterfaces(uint32_t* addresses, int maxSize ); stunFindLocalInterfaces(uint32_t* addresses, int maxSize );
int ORTP_PUBLIC int
stunTest( StunAddress4 *dest, int testNum, StunAddress4* srcAddr, StunAddre ss4 *sMappedAddr, StunAddress4* sChangedAddr); stunTest( StunAddress4 *dest, int testNum, StunAddress4* srcAddr, StunAddre ss4 *sMappedAddr, StunAddress4* sChangedAddr);
NatType ORTP_PUBLIC NatType
stunNatType( StunAddress4 *dest, stunNatType( StunAddress4 *dest,
bool_t* preservePort, /* if set, is return for if NAT preserve rs ports or not */ bool_t* preservePort, /* if set, is return for if NAT preserve rs ports or not */
bool_t* hairpin , /* if set, is the return for if NAT will ha irpin packets */ bool_t* hairpin , /* if set, is the return for if NAT will ha irpin packets */
int port, /* port to use for the test, 0 to choose random port */ int port, /* port to use for the test, 0 to choose random port */
StunAddress4* sAddr /* NIC to use */ StunAddress4* sAddr /* NIC to use */
); );
bool_t ORTP_PUBLIC bool_t
stunServerProcessMsg( char* buf, stunServerProcessMsg( char* buf,
unsigned int bufLen, unsigned int bufLen,
StunAddress4 *from, StunAddress4 *from,
StunAddress4 *myAddr, StunAddress4 *myAddr,
StunAddress4 *altAddr, StunAddress4 *altAddr,
StunMessage *resp, StunMessage *resp,
StunAddress4 *destination, StunAddress4 *destination,
StunAtrString *hmacPassword, StunAtrString *hmacPassword,
bool_t* changePort, bool_t* changePort,
bool_t* changeIp); bool_t* changeIp);
int ORTP_PUBLIC int
stunOpenSocket( StunAddress4 *dest, stunOpenSocket( StunAddress4 *dest,
StunAddress4* mappedAddr, StunAddress4* mappedAddr,
int port, int port,
StunAddress4* srcAddr); StunAddress4* srcAddr);
bool_t ORTP_PUBLIC bool_t
stunOpenSocketPair(StunAddress4 *dest, stunOpenSocketPair(StunAddress4 *dest,
StunAddress4* mapAddr_rtp, StunAddress4* mapAddr_rtp,
StunAddress4* mapAddr_rtcp, StunAddress4* mapAddr_rtcp,
int* fd1, int* fd2, int* fd1, int* fd2,
int srcPort, StunAddress4* srcAddr); int srcPort, StunAddress4* srcAddr);
bool_t ORTP_PUBLIC bool_t
turnAllocateSocketPair(StunAddress4 *dest, turnAllocateSocketPair(StunAddress4 *dest,
StunAddress4* mapAddr_rtp, StunAddress4* mapAddr_rtp,
StunAddress4* mapAddr_rtcp, StunAddress4* mapAddr_rtcp,
int* fd1, int* fd2, int* fd1, int* fd2,
int srcPort, StunAddress4* srcAddr); int srcPort, StunAddress4* srcAddr);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
 End of changes. 23 change blocks. 
23 lines changed or deleted 23 lines changed or added


 stun_udp.h   stun_udp.h 
skipping to change at line 43 skipping to change at line 43
#ifdef __MACH__ #ifdef __MACH__
#include <sys/socket.h> #include <sys/socket.h>
#ifndef _SOCKLEN_T #ifndef _SOCKLEN_T
typedef int socklen_t; typedef int socklen_t;
#endif #endif
#endif #endif
#include <ortp/port.h> #include <ortp/port.h>
#if defined(WIN32) || defined(_WIN32_WCE)
#if !defined(_WIN32_WCE) #if !defined(_WIN32_WCE)
#include <errno.h> #include <errno.h>
#endif #endif
#if defined(WIN32) || defined(_WIN32_WCE)
#define snprintf _snprintf
#include <winsock2.h> #include <winsock2.h>
/* #include <io.h> */ /* #include <io.h> */
typedef int socklen_t; typedef int socklen_t;
typedef SOCKET Socket; typedef SOCKET Socket;
#ifndef EWOULDBLOCK #ifndef EWOULDBLOCK
#define EWOULDBLOCK WSAEWOULDBLOCK #define EWOULDBLOCK WSAEWOULDBLOCK
#endif #endif
#ifndef EINPROGRESS #ifndef EINPROGRESS
skipping to change at line 183 skipping to change at line 182
#define closesocket(fd) close(fd) #define closesocket(fd) close(fd)
#define WSANOTINITIALISED EPROTONOSUPPORT #define WSANOTINITIALISED EPROTONOSUPPORT
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
int getErrno(void); ORTP_PUBLIC int getErrno(void);
/* Open a UDP socket to receive on the given port - if port is 0, pick a a /* Open a UDP socket to receive on the given port - if port is 0, pick a a
port, if interfaceIp!=0 then use ONLY the interface specified instead of port, if interfaceIp!=0 then use ONLY the interface specified instead of
all of them */ all of them */
Socket ORTP_PUBLIC Socket
openPort( unsigned short port, unsigned int interfaceIp); openPort( unsigned short port, unsigned int interfaceIp);
/* recive a UDP message */ /* recive a UDP message */
bool_t ORTP_PUBLIC bool_t
getMessage( Socket fd, char* buf, int* len, getMessage( Socket fd, char* buf, int* len,
unsigned int* srcIp, unsigned short* srcPort); unsigned int* srcIp, unsigned short* srcPort);
/* send a UDP message */ /* send a UDP message */
bool_t ORTP_PUBLIC bool_t
sendMessage( Socket fd, char* msg, int len, sendMessage( Socket fd, char* msg, int len,
unsigned int dstIp, unsigned short dstPort); unsigned int dstIp, unsigned short dstPort);
/* set up network - does nothing in unix but needed for windows */ /* set up network - does nothing in unix but needed for windows */
void ORTP_PUBLIC void
initNetwork(void); initNetwork(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 7 change blocks. 
8 lines changed or deleted 7 lines changed or added


 telephonyevents.h   telephonyevents.h 
skipping to change at line 58 skipping to change at line 58
typedef struct _telephone_event telephone_event_t; typedef struct _telephone_event telephone_event_t;
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
/* tell if the session supports telephony events. For this the telephony ev ents payload_type /* tell if the session supports telephony events. For this the telephony ev ents payload_type
must be present in the rtp profile used by the session */ must be present in the rtp profile used by the session */
/* low level functions */ /* low level functions */
int rtp_session_telephone_events_supported(RtpSession *session); ORTP_PUBLIC int rtp_session_telephone_events_supported(RtpSession *session)
int rtp_session_send_telephone_events_supported(RtpSession *session); ;
int rtp_session_recv_telephone_events_supported(RtpSession *session); ORTP_PUBLIC int rtp_session_send_telephone_events_supported(RtpSession *ses
sion);
ORTP_PUBLIC int rtp_session_recv_telephone_events_supported(RtpSession *ses
sion);
mblk_t *rtp_session_create_telephone_event_packet(RtpSession *session, int start); ORTP_PUBLIC mblk_t *rtp_session_create_telephone_event_packet(RtpSessio n *session, int start);
int rtp_session_add_telephone_event(RtpSession *session, ORTP_PUBLIC int rtp_session_add_telephone_event(RtpSession *session,
mblk_t *packet, uint8_t event, int end, uint8_t volu me, uint16_t duration); mblk_t *packet, uint8_t event, int end, uint8_t volu me, uint16_t duration);
int rtp_session_read_telephone_event(RtpSession *session, ORTP_PUBLIC int rtp_session_read_telephone_event(RtpSession *session,
mblk_t *packet,telephone_event_t **tab); mblk_t *packet,telephone_event_t **tab);
/* high level functions*/ /* high level functions*/
int rtp_session_send_dtmf(RtpSession *session, char dtmf, uint32_t userts); ORTP_PUBLIC int rtp_session_send_dtmf(RtpSession *session, char dtmf, uint3
int rtp_session_send_dtmf2(RtpSession *session, char dtmf, uint32_t userts, 2_t userts);
int duration); ORTP_PUBLIC int rtp_session_send_dtmf2(RtpSession *session, char dtmf, uint
32_t userts, int duration);
/* for high level telephony event callback */ /* for high level telephony event callback */
void rtp_session_check_telephone_events(RtpSession *session, mblk_t *m0); ORTP_PUBLIC void rtp_session_check_telephone_events(RtpSession *session, mb lk_t *m0);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
/* the size allocated for telephony events packets */ /* the size allocated for telephony events packets */
#define TELEPHONY_EVENTS_ALLOCATED_SIZE (4*sizeof(telephone_ event_t)) #define TELEPHONY_EVENTS_ALLOCATED_SIZE (4*sizeof(telephone_ event_t))
/* list of named events */ /* list of named events */
#define TEV_DTMF_0 (0) #define TEV_DTMF_0 (0)
 End of changes. 6 change blocks. 
10 lines changed or deleted 14 lines changed or added


 zrtp.h   zrtp.h 
skipping to change at line 44 skipping to change at line 44
#ifdef __cplusplus #ifdef __cplusplus
extern "C"{ extern "C"{
#endif #endif
typedef struct OrtpZrtpParams { typedef struct OrtpZrtpParams {
const char *zid_file; // File where to store secrets and other infor mation const char *zid_file; // File where to store secrets and other infor mation
} OrtpZrtpParams; } OrtpZrtpParams;
typedef struct _OrtpZrtpContext OrtpZrtpContext ; typedef struct _OrtpZrtpContext OrtpZrtpContext ;
bool_t ortp_zrtp_available(); ORTP_PUBLIC bool_t ortp_zrtp_available();
OrtpZrtpContext* ortp_zrtp_context_new(RtpSession *s, OrtpZrtpParams *param ORTP_PUBLIC OrtpZrtpContext* ortp_zrtp_context_new(RtpSession *s, OrtpZrtpP
s); arams *params);
OrtpZrtpContext* ortp_zrtp_multistream_new(OrtpZrtpContext* activeContext, ORTP_PUBLIC OrtpZrtpContext* ortp_zrtp_multistream_new(OrtpZrtpContext* act
RtpSession *s, OrtpZrtpParams *params); iveContext, RtpSession *s, OrtpZrtpParams *params);
void ortp_zrtp_sas_verified(OrtpZrtpContext* ctx); ORTP_PUBLIC void ortp_zrtp_sas_verified(OrtpZrtpContext* ctx);
void ortp_zrtp_sas_reset_verified(OrtpZrtpContext* ctx); ORTP_PUBLIC void ortp_zrtp_sas_reset_verified(OrtpZrtpContext* ctx);
void ortp_zrtp_context_destroy(OrtpZrtpContext *ctx); ORTP_PUBLIC void ortp_zrtp_context_destroy(OrtpZrtpContext *ctx);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 4 change blocks. 
8 lines changed or deleted 8 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/