call.hpp | call.hpp | |||
---|---|---|---|---|
/* $Id: call.hpp 4742 2014-02-12 05:18:31Z bennylp $ */ | /* $Id: call.hpp 4780 2014-03-06 01:02:26Z ming $ */ | |||
/* | /* | |||
* Copyright (C) 2012-2013 Teluu Inc. (http://www.teluu.com) | * Copyright (C) 2012-2013 Teluu Inc. (http://www.teluu.com) | |||
* | * | |||
* This program is free software; you can redistribute it and/or modify | * This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | * (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 | |||
skipping to change at line 1242 | skipping to change at line 1242 | |||
* the media state of the call has changed. | * the media state of the call has changed. | |||
* | * | |||
* @param prm.options Bitmask of pjsua_call_flag constants. Currently , | * @param prm.options Bitmask of pjsua_call_flag constants. Currently , | |||
* only the flag PJSUA_CALL_UPDATE_CONTACT can be used. | * only the flag PJSUA_CALL_UPDATE_CONTACT can be used. | |||
* @param prm.txOption Optional message components to be sent with | * @param prm.txOption Optional message components to be sent with | |||
* the request. | * the request. | |||
*/ | */ | |||
void setHold(const CallOpParam &prm) throw(Error); | void setHold(const CallOpParam &prm) throw(Error); | |||
/** | /** | |||
* Send re-INVITE to release hold. | * Send re-INVITE. | |||
* The final status of the request itself will be reported on the | * The final status of the request itself will be reported on the | |||
* \a onCallMediaState() callback, which inform the application that | * \a onCallMediaState() callback, which inform the application that | |||
* the media state of the call has changed. | * the media state of the call has changed. | |||
* | * | |||
* @param prm.opt Optional call setting, if empty, the current ca ll | * @param prm.opt Optional call setting, if empty, the current ca ll | |||
* setting will remain unchanged. | * setting will remain unchanged. | |||
* @param prm.opt.flag Bitmask of pjsua_call_flag constants. Specifyin | ||||
g | ||||
* PJSUA_CALL_UNHOLD here will release call hold. | ||||
* @param prm.txOption Optional message components to be sent with | * @param prm.txOption Optional message components to be sent with | |||
* the request. | * the request. | |||
*/ | */ | |||
void reinvite(const CallOpParam &prm) throw(Error); | void reinvite(const CallOpParam &prm) throw(Error); | |||
/** | /** | |||
* Send UPDATE request. | * Send UPDATE request. | |||
* | * | |||
* @param prm.opt Optional call setting, if empty, the current ca ll | * @param prm.opt Optional call setting, if empty, the current ca ll | |||
* setting will remain unchanged. | * setting will remain unchanged. | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 5 lines changed or added | |||
config.h | config.h | |||
---|---|---|---|---|
/* $Id: config.h 4764 2014-02-27 02:13:25Z bennylp $ */ | /* $Id: config.h 4795 2014-03-14 06:58:10Z riza $ */ | |||
/* | /* | |||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | |||
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> | * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> | |||
* | * | |||
* This program is free software; you can redistribute it and/or modify | * This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | * (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, | |||
skipping to change at line 1154 | skipping to change at line 1154 | |||
PJ_BEGIN_DECL | PJ_BEGIN_DECL | |||
/** PJLIB version major number. */ | /** PJLIB version major number. */ | |||
#define PJ_VERSION_NUM_MAJOR 2 | #define PJ_VERSION_NUM_MAJOR 2 | |||
/** PJLIB version minor number. */ | /** PJLIB version minor number. */ | |||
#define PJ_VERSION_NUM_MINOR 2 | #define PJ_VERSION_NUM_MINOR 2 | |||
/** PJLIB version revision number. */ | /** PJLIB version revision number. */ | |||
#define PJ_VERSION_NUM_REV 0 | #define PJ_VERSION_NUM_REV 1 | |||
/** | /** | |||
* Extra suffix for the version (e.g. "-trunk"), or empty for | * Extra suffix for the version (e.g. "-trunk"), or empty for | |||
* web release version. | * web release version. | |||
*/ | */ | |||
#define PJ_VERSION_NUM_EXTRA "" | #define PJ_VERSION_NUM_EXTRA "" | |||
/** | /** | |||
* PJLIB version number consists of three bytes with the following format: | * PJLIB version number consists of three bytes with the following format: | |||
* 0xMMIIRR00, where MM: major number, II: minor number, RR: revision | * 0xMMIIRR00, where MM: major number, II: minor number, RR: revision | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
format.h | format.h | |||
---|---|---|---|---|
/* $Id: format.h 4470 2013-04-15 10:40:26Z bennylp $ */ | /* $Id: format.h 4785 2014-03-10 09:01:18Z nanang $ */ | |||
/* | /* | |||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | |||
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> | * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> | |||
* | * | |||
* This program is free software; you can redistribute it and/or modify | * This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | * (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, | |||
skipping to change at line 580 | skipping to change at line 580 | |||
* | * | |||
* @param fmt The format to be initialized. | * @param fmt The format to be initialized. | |||
* @param fmt_id Format ID. See #pjmedia_format_id | * @param fmt_id Format ID. See #pjmedia_format_id | |||
* @param clock_rate Audio clock rate. | * @param clock_rate Audio clock rate. | |||
* @param channel_count Number of channels. | * @param channel_count Number of channels. | |||
* @param bits_per_sample Number of bits per sample. | * @param bits_per_sample Number of bits per sample. | |||
* @param frame_time_usec Frame interval, in microsecond. | * @param frame_time_usec Frame interval, in microsecond. | |||
* @param avg_bps Average bitrate. | * @param avg_bps Average bitrate. | |||
* @param max_bps Maximum bitrate. | * @param max_bps Maximum bitrate. | |||
*/ | */ | |||
PJ_DECL(void) pjmedia_format_init_audio(pjmedia_format *fmt, | PJ_INLINE(void) pjmedia_format_init_audio(pjmedia_format *fmt, | |||
pj_uint32_t fmt_id, | pj_uint32_t fmt_id, | |||
unsigned clock_rate, | unsigned clock_rate, | |||
unsigned channel_count, | unsigned channel_count, | |||
unsigned bits_per_sample, | unsigned bits_per_sample, | |||
unsigned frame_time_usec, | unsigned frame_time_usec, | |||
pj_uint32_t avg_bps, | pj_uint32_t avg_bps, | |||
pj_uint32_t max_bps); | pj_uint32_t max_bps) | |||
{ | ||||
/* This function is inlined to avoid build problem due to circular | ||||
* dependency, i.e: this function is part of pjmedia and is needed | ||||
* by pjmedia-audiodev, while pjmedia depends on pjmedia-audiodev. | ||||
*/ | ||||
fmt->id = fmt_id; | ||||
fmt->type = PJMEDIA_TYPE_AUDIO; | ||||
fmt->detail_type = PJMEDIA_FORMAT_DETAIL_AUDIO; | ||||
fmt->det.aud.clock_rate = clock_rate; | ||||
fmt->det.aud.channel_count = channel_count; | ||||
fmt->det.aud.bits_per_sample = bits_per_sample; | ||||
fmt->det.aud.frame_time_usec = frame_time_usec; | ||||
fmt->det.aud.avg_bps = avg_bps; | ||||
fmt->det.aud.max_bps = max_bps; | ||||
} | ||||
/** | /** | |||
* Initialize the format as video format with the specified parameters. | * Initialize the format as video format with the specified parameters. | |||
* A format manager should have been created, as this function will need | * A format manager should have been created, as this function will need | |||
* to consult to a format manager in order to fill in detailed | * to consult to a format manager in order to fill in detailed | |||
* information about the format. | * information about the format. | |||
* | * | |||
* @param fmt The format to be initialised. | * @param fmt The format to be initialised. | |||
* @param fmt_id Format ID. See #pjmedia_format_id | * @param fmt_id Format ID. See #pjmedia_format_id | |||
* @param width Image width. | * @param width Image width. | |||
End of changes. 2 change blocks. | ||||
9 lines changed or deleted | 26 lines changed or added | |||
media.hpp | media.hpp | |||
---|---|---|---|---|
/* $Id: media.hpp 4740 2014-02-12 04:54:12Z bennylp $ */ | /* $Id: media.hpp 4793 2014-03-14 04:09:50Z bennylp $ */ | |||
/* | /* | |||
* Copyright (C) 2013 Teluu Inc. (http://www.teluu.com) | * Copyright (C) 2013 Teluu Inc. (http://www.teluu.com) | |||
* | * | |||
* This program is free software; you can redistribute it and/or modify | * This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | * (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 | |||
skipping to change at line 311 | skipping to change at line 311 | |||
* This method needs to be called by descendants of this class to remov e | * This method needs to be called by descendants of this class to remov e | |||
* the media port from the conference bridge and Endpoint's media list. | * the media port from the conference bridge and Endpoint's media list. | |||
* Descendant should only call this method if it has registered the med ia | * Descendant should only call this method if it has registered the med ia | |||
* with the previous call to registerMediaPort(). | * with the previous call to registerMediaPort(). | |||
*/ | */ | |||
void unregisterMediaPort(); | void unregisterMediaPort(); | |||
private: | private: | |||
pj_caching_pool mediaCachingPool; | pj_caching_pool mediaCachingPool; | |||
pj_pool_t *mediaPool; | pj_pool_t *mediaPool; | |||
private: | ||||
unsigned getSignalLevel(bool is_rx = true) const throw(Error); | ||||
}; | }; | |||
/** Array of Audio Media */ | /** Array of Audio Media */ | |||
typedef std::vector<AudioMedia*> AudioMediaVector; | typedef std::vector<AudioMedia*> AudioMediaVector; | |||
/** | /** | |||
* This structure contains additional info about AudioMediaPlayer. | ||||
*/ | ||||
struct AudioMediaPlayerInfo | ||||
{ | ||||
/** | ||||
* Format ID of the payload. | ||||
*/ | ||||
pjmedia_format_id formatId; | ||||
/** | ||||
* The number of bits per sample of the file payload. For example, | ||||
* the value is 16 for PCM WAV and 8 for Alaw/Ulas WAV files. | ||||
*/ | ||||
unsigned payloadBitsPerSample; | ||||
/** | ||||
* The WAV payload size in bytes. | ||||
*/ | ||||
pj_uint32_t sizeBytes; | ||||
/** | ||||
* The WAV payload size in samples. | ||||
*/ | ||||
pj_uint32_t sizeSamples; | ||||
}; | ||||
/** | ||||
* Audio Media Player. | * Audio Media Player. | |||
*/ | */ | |||
class AudioMediaPlayer : public AudioMedia | class AudioMediaPlayer : public AudioMedia | |||
{ | { | |||
public: | public: | |||
/** | /** | |||
* Constructor. | * Constructor. | |||
*/ | */ | |||
AudioMediaPlayer(); | AudioMediaPlayer(); | |||
skipping to change at line 360 | skipping to change at line 384 | |||
* number of channels, and number of bits per sample. | * number of channels, and number of bits per sample. | |||
* @param label Optional label to be set for the media port. | * @param label Optional label to be set for the media port. | |||
* @param options Optional option flag. Application may specify | * @param options Optional option flag. Application may specify | |||
* PJMEDIA_FILE_NO_LOOP to prevent looping. | * PJMEDIA_FILE_NO_LOOP to prevent looping. | |||
*/ | */ | |||
void createPlaylist(const StringVector &file_names, | void createPlaylist(const StringVector &file_names, | |||
const string &label="", | const string &label="", | |||
unsigned options=0) throw(Error); | unsigned options=0) throw(Error); | |||
/** | /** | |||
* Set playback position. This operation is not valid for playlist. | * Get additional info about the player. This operation is only valid | |||
* for player. For playlist, Error will be thrown. | ||||
* | ||||
* @return the info. | ||||
*/ | ||||
AudioMediaPlayerInfo getInfo() const throw(Error); | ||||
/** | ||||
* Get current playback position in samples. This operation is not vali | ||||
d | ||||
* for playlist. | ||||
* | ||||
* @return Current playback position, in samples. | ||||
*/ | ||||
pj_uint32_t getPos() const throw(Error); | ||||
/** | ||||
* Set playback position in samples. This operation is not valid for | ||||
* playlist. | ||||
* | * | |||
* @param samples The desired playback position, in samples. | * @param samples The desired playback position, in samples. | |||
*/ | */ | |||
void setPos(pj_uint32_t samples) throw(Error); | void setPos(pj_uint32_t samples) throw(Error); | |||
/** | /** | |||
* Typecast from base class AudioMedia. This is useful for application | * Typecast from base class AudioMedia. This is useful for application | |||
* written in language that does not support downcasting such as Python . | * written in language that does not support downcasting such as Python . | |||
* | * | |||
* @param media The object to be downcasted | * @param media The object to be downcasted | |||
* | * | |||
* @return The object as AudioMediaPlayer instance | * @return The object as AudioMediaPlayer instance | |||
*/ | */ | |||
static AudioMediaPlayer* typecastFromAudioMedia(AudioMedia *media); | static AudioMediaPlayer* typecastFromAudioMedia(AudioMedia *media); | |||
/** | /** | |||
* Virtual destructor. | * Destructor. | |||
*/ | */ | |||
virtual ~AudioMediaPlayer(); | virtual ~AudioMediaPlayer(); | |||
public: | ||||
/* | ||||
* Callbacks | ||||
*/ | ||||
/** | ||||
* Register a callback to be called when the file player reading has | ||||
* reached the end of file, or when the file reading has reached the | ||||
* end of file of the last file for a playlist. If the file or playlist | ||||
* is set to play repeatedly, then the callback will be called multiple | ||||
* times. | ||||
* | ||||
* @return If the callback returns false, the playback | ||||
* will stop. Note that if application | ||||
destroys | ||||
* the player in the callback, it must | ||||
return | ||||
* false here. | ||||
*/ | ||||
virtual bool onEof() | ||||
{ return true; } | ||||
private: | private: | |||
/** | /** | |||
* Player Id. | * Player Id. | |||
*/ | */ | |||
int playerId; | int playerId; | |||
/** | ||||
* Low level PJMEDIA callback | ||||
*/ | ||||
static pj_status_t eof_cb(pjmedia_port *port, | ||||
void *usr_data); | ||||
}; | }; | |||
/** | /** | |||
* Audio Media Recorder. | * Audio Media Recorder. | |||
*/ | */ | |||
class AudioMediaRecorder : public AudioMedia | class AudioMediaRecorder : public AudioMedia | |||
{ | { | |||
public: | public: | |||
/** | /** | |||
* Constructor. | * Constructor. | |||
skipping to change at line 436 | skipping to change at line 502 | |||
* Typecast from base class AudioMedia. This is useful for application | * Typecast from base class AudioMedia. This is useful for application | |||
* written in language that does not support downcasting such as Python . | * written in language that does not support downcasting such as Python . | |||
* | * | |||
* @param media The object to be downcasted | * @param media The object to be downcasted | |||
* | * | |||
* @return The object as AudioMediaRecorder instance | * @return The object as AudioMediaRecorder instance | |||
*/ | */ | |||
static AudioMediaRecorder* typecastFromAudioMedia(AudioMedia *media); | static AudioMediaRecorder* typecastFromAudioMedia(AudioMedia *media); | |||
/** | /** | |||
* Virtual destructor. | * Destructor. | |||
*/ | */ | |||
virtual ~AudioMediaRecorder(); | virtual ~AudioMediaRecorder(); | |||
private: | private: | |||
/** | /** | |||
* Recorder Id. | * Recorder Id. | |||
*/ | */ | |||
int recorderId; | int recorderId; | |||
}; | }; | |||
End of changes. 8 change blocks. | ||||
7 lines changed or deleted | 76 lines changed or added | |||
sip_config.h | sip_config.h | |||
---|---|---|---|---|
/* $Id: sip_config.h 4720 2014-01-29 09:53:06Z nanang $ */ | /* $Id: sip_config.h 4770 2014-02-27 06:16:36Z nanang $ */ | |||
/* | /* | |||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | |||
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> | * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> | |||
* | * | |||
* This program is free software; you can redistribute it and/or modify | * This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | * (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, | |||
skipping to change at line 115 | skipping to change at line 115 | |||
/** | /** | |||
* Disable automatic switching from UDP to TCP if outgoing request | * Disable automatic switching from UDP to TCP if outgoing request | |||
* is greater than 1300 bytes. | * is greater than 1300 bytes. | |||
* | * | |||
* Default is PJSIP_DONT_SWITCH_TO_TCP. | * Default is PJSIP_DONT_SWITCH_TO_TCP. | |||
*/ | */ | |||
pj_bool_t disable_tcp_switch; | pj_bool_t disable_tcp_switch; | |||
/** | /** | |||
* Disable automatic switching to TLS if target-URI does not use | ||||
* "sips" scheme nor TLS transport, even when request-URI uses | ||||
* "sips" scheme. | ||||
* | ||||
* Default is PJSIP_DONT_SWITCH_TO_TLS. | ||||
*/ | ||||
pj_bool_t disable_tls_switch; | ||||
/** | ||||
* Enable call media session to always be updated to the latest | * Enable call media session to always be updated to the latest | |||
* received early media SDP when receiving forked early media | * received early media SDP when receiving forked early media | |||
* (multiple 183 responses with different To tag). | * (multiple 183 responses with different To tag). | |||
* | * | |||
* Default is PJSIP_FOLLOW_EARLY_MEDIA_FORK. | * Default is PJSIP_FOLLOW_EARLY_MEDIA_FORK. | |||
*/ | */ | |||
pj_bool_t follow_early_media_fork; | pj_bool_t follow_early_media_fork; | |||
/** | /** | |||
* Specify whether "alias" param should be added to the Via header | * Specify whether "alias" param should be added to the Via header | |||
skipping to change at line 303 | skipping to change at line 312 | |||
* This option can also be controlled at run-time by the \a disable_tcp_swi tch | * This option can also be controlled at run-time by the \a disable_tcp_swi tch | |||
* setting in pjsip_cfg_t. | * setting in pjsip_cfg_t. | |||
* | * | |||
* Default is 0 (no). | * Default is 0 (no). | |||
*/ | */ | |||
#ifndef PJSIP_DONT_SWITCH_TO_TCP | #ifndef PJSIP_DONT_SWITCH_TO_TCP | |||
# define PJSIP_DONT_SWITCH_TO_TCP 0 | # define PJSIP_DONT_SWITCH_TO_TCP 0 | |||
#endif | #endif | |||
/** | /** | |||
* As specified RFC 3261 section 8.1.2, when request-URI uses "sips" scheme | ||||
, | ||||
* TLS must always be used regardless of the target-URI scheme or transport | ||||
* type. | ||||
* | ||||
* This option will specify whether the behavior of automatic switching to | ||||
TLS | ||||
* should be disabled, i.e: regard the target-URI scheme or transport type. | ||||
* | ||||
* This option can also be controlled at run-time by the \a disable_tls_swi | ||||
tch | ||||
* setting in pjsip_cfg_t. | ||||
* | ||||
* Default is 0 (no). | ||||
*/ | ||||
#ifndef PJSIP_DONT_SWITCH_TO_TLS | ||||
# define PJSIP_DONT_SWITCH_TO_TLS 0 | ||||
#endif | ||||
/** | ||||
* Specify whether the call media session should be updated to the latest | * Specify whether the call media session should be updated to the latest | |||
* received early media SDP when receiving forked early media (multiple 183 | * received early media SDP when receiving forked early media (multiple 183 | |||
* responses with different To tag). | * responses with different To tag). | |||
* | * | |||
* This option can also be controlled at run-time by the | * This option can also be controlled at run-time by the | |||
* \a follow_early_media_fork setting in pjsip_cfg_t. | * \a follow_early_media_fork setting in pjsip_cfg_t. | |||
* | * | |||
* Default is PJ_TRUE. | * Default is PJ_TRUE. | |||
*/ | */ | |||
#ifndef PJSIP_FOLLOW_EARLY_MEDIA_FORK | #ifndef PJSIP_FOLLOW_EARLY_MEDIA_FORK | |||
End of changes. 3 change blocks. | ||||
1 lines changed or deleted | 30 lines changed or added | |||
sip_transport.h | sip_transport.h | |||
---|---|---|---|---|
/* $Id: sip_transport.h 4275 2012-10-04 06:11:58Z bennylp $ */ | /* $Id: sip_transport.h 4775 2014-03-04 02:18:51Z nanang $ */ | |||
/* | /* | |||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | |||
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> | * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> | |||
* | * | |||
* This program is free software; you can redistribute it and/or modify | * This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | * (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, | |||
skipping to change at line 786 | skipping to change at line 786 | |||
int addr_len; /**< Length of addresses . */ | int addr_len; /**< Length of addresses . */ | |||
pj_sockaddr local_addr; /**< Bound address. */ | pj_sockaddr local_addr; /**< Bound address. */ | |||
pjsip_host_port local_name; /**< Published name (eg. STUN). */ | pjsip_host_port local_name; /**< Published name (eg. STUN). */ | |||
pjsip_host_port remote_name; /**< Remote address name. */ | pjsip_host_port remote_name; /**< Remote address name. */ | |||
pjsip_transport_dir dir; /**< Connection directio n. */ | pjsip_transport_dir dir; /**< Connection directio n. */ | |||
pjsip_endpoint *endpt; /**< Endpoint instance. */ | pjsip_endpoint *endpt; /**< Endpoint instance. */ | |||
pjsip_tpmgr *tpmgr; /**< Transport manager. */ | pjsip_tpmgr *tpmgr; /**< Transport manager. */ | |||
pj_timer_entry idle_timer; /**< Timer when ref cnt is zero. */ | pj_timer_entry idle_timer; /**< Timer when ref cnt is zero. */ | |||
pj_timestamp last_recv_ts; /**< Last time receiving data. | ||||
*/ | ||||
pj_size_t last_recv_len; /**< Last received data length. | ||||
*/ | ||||
void *data; /**< Internal transport data. */ | void *data; /**< Internal transport data. */ | |||
/** | /** | |||
* Function to be called by transport manager to send SIP message. | * Function to be called by transport manager to send SIP message. | |||
* | * | |||
* @param transport The transport to send the message. | * @param transport The transport to send the message. | |||
* @param packet The buffer to send. | * @param packet The buffer to send. | |||
* @param length The length of the buffer to send. | * @param length The length of the buffer to send. | |||
* @param op_key Completion token, which will be supplied to | * @param op_key Completion token, which will be supplied to | |||
* caller when pending send operation completes. | * caller when pending send operation completes. | |||
skipping to change at line 1357 | skipping to change at line 1360 | |||
pjsip_tp_send_callback cb); | pjsip_tp_send_callback cb); | |||
/** | /** | |||
* Enumeration of transport state types. | * Enumeration of transport state types. | |||
*/ | */ | |||
typedef enum pjsip_transport_state | typedef enum pjsip_transport_state | |||
{ | { | |||
PJSIP_TP_STATE_CONNECTED, /**< Transport connected, applicable onl y | PJSIP_TP_STATE_CONNECTED, /**< Transport connected, applicable onl y | |||
to connection-oriented transports | to connection-oriented transports | |||
such as TCP and TLS. */ | such as TCP and TLS. */ | |||
PJSIP_TP_STATE_DISCONNECTED /**< Transport disconnected, app licable | PJSIP_TP_STATE_DISCONNECTED, /**< Transport disconnected, applicable | |||
only to connection-oriented | only to connection-oriented | |||
transports such as TCP and TLS. */ | transports such as TCP and TLS. */ | |||
PJSIP_TP_STATE_SHUTDOWN, /**< Transport shutdown, either | ||||
due to TCP/TLS disconnect error | ||||
from the network, or when shutdown | ||||
is initiated by PJSIP itself. | ||||
*/ | ||||
PJSIP_TP_STATE_DESTROY, /**< Transport destroy, when transport | ||||
is about to be destroyed. | ||||
*/ | ||||
} pjsip_transport_state; | } pjsip_transport_state; | |||
/** | /** | |||
* Definition of transport state listener key. | * Definition of transport state listener key. | |||
*/ | */ | |||
typedef void pjsip_tp_state_listener_key; | typedef void pjsip_tp_state_listener_key; | |||
/** | /** | |||
* Structure of transport state info passed by #pjsip_tp_state_callback. | * Structure of transport state info passed by #pjsip_tp_state_callback. | |||
*/ | */ | |||
End of changes. 4 change blocks. | ||||
2 lines changed or deleted | 15 lines changed or added | |||
wav_port.h | wav_port.h | |||
---|---|---|---|---|
/* $Id: wav_port.h 3553 2011-05-05 06:14:19Z nanang $ */ | /* $Id: wav_port.h 4793 2014-03-14 04:09:50Z bennylp $ */ | |||
/* | /* | |||
* Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | * Copyright (C) 2008-2011 Teluu Inc. (http://www.teluu.com) | |||
* Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> | * Copyright (C) 2003-2008 Benny Prijono <benny@prijono.org> | |||
* | * | |||
* This program is free software; you can redistribute it and/or modify | * This program is free software; you can redistribute it and/or modify | |||
* it under the terms of the GNU General Public License as published by | * it under the terms of the GNU General Public License as published by | |||
* the Free Software Foundation; either version 2 of the License, or | * the Free Software Foundation; either version 2 of the License, or | |||
* (at your option) any later version. | * (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, | |||
skipping to change at line 51 | skipping to change at line 51 | |||
enum pjmedia_file_player_option | enum pjmedia_file_player_option | |||
{ | { | |||
/** | /** | |||
* Tell the file player to return NULL frame when the whole | * Tell the file player to return NULL frame when the whole | |||
* file has been played. | * file has been played. | |||
*/ | */ | |||
PJMEDIA_FILE_NO_LOOP = 1 | PJMEDIA_FILE_NO_LOOP = 1 | |||
}; | }; | |||
/** | /** | |||
* Additional information about the WAV player. | ||||
*/ | ||||
typedef struct pjmedia_wav_player_info | ||||
{ | ||||
/** | ||||
* Format ID of the payload. | ||||
*/ | ||||
pjmedia_format_id fmt_id; | ||||
/** | ||||
* The number of bits per sample of the file payload. For example, | ||||
* the value is 16 for PCM WAV and 8 for Alaw/Ulas WAV files. | ||||
*/ | ||||
unsigned payload_bits_per_sample; | ||||
/** | ||||
* The WAV payload size in bytes. | ||||
*/ | ||||
pj_uint32_t size_bytes; | ||||
/** | ||||
* The WAV payload size in samples. | ||||
*/ | ||||
pj_uint32_t size_samples; | ||||
} pjmedia_wav_player_info; | ||||
/** | ||||
* Create a media port to play streams from a WAV file. WAV player port | * Create a media port to play streams from a WAV file. WAV player port | |||
* supports for reading WAV file with uncompressed 16 bit PCM format or | * supports for reading WAV file with uncompressed 16 bit PCM format or | |||
* compressed G.711 A-law/U-law format. | * compressed G.711 A-law/U-law format. | |||
* | * | |||
* @param pool Pool to create memory buffers for this port. | * @param pool Pool to create memory buffers for this port. | |||
* @param filename File name to open. | * @param filename File name to open. | |||
* @param ptime The duration (in miliseconds) of each frame read | * @param ptime The duration (in miliseconds) of each frame read | |||
* from this port. If the value is zero, the default | * from this port. If the value is zero, the default | |||
* duration (20ms) will be used. | * duration (20ms) will be used. | |||
* @param flags Port creation flags. | * @param flags Port creation flags. | |||
skipping to change at line 76 | skipping to change at line 104 | |||
* @return PJ_SUCCESS on success. | * @return PJ_SUCCESS on success. | |||
*/ | */ | |||
PJ_DECL(pj_status_t) pjmedia_wav_player_port_create( pj_pool_t *pool, | PJ_DECL(pj_status_t) pjmedia_wav_player_port_create( pj_pool_t *pool, | |||
const char *filename, | const char *filename, | |||
unsigned ptime, | unsigned ptime, | |||
unsigned flags, | unsigned flags, | |||
pj_ssize_t buff_size, | pj_ssize_t buff_size, | |||
pjmedia_port **p_port ) ; | pjmedia_port **p_port ) ; | |||
/** | /** | |||
* Get additional info about the file player. | ||||
* | ||||
* @param port The file port. | ||||
* @param i The info. | ||||
* | ||||
* @return PJ_SUCCESS on success or the appropriate error code. | ||||
*/ | ||||
PJ_DECL(pj_status_t) pjmedia_wav_player_get_info(pjmedia_port *port, | ||||
pjmedia_wav_player_info *i | ||||
); | ||||
/** | ||||
* Get the data length, in bytes. | * Get the data length, in bytes. | |||
* | * | |||
* @param port The file player port. | * @param port The file player port. | |||
* | * | |||
* @return The length of the data, in bytes. Upon error it will | * @return The length of the data, in bytes. On error, the | |||
* return negative value. | * error code is given as negative value. | |||
*/ | */ | |||
PJ_DECL(pj_ssize_t) pjmedia_wav_player_get_len(pjmedia_port *port); | PJ_DECL(pj_ssize_t) pjmedia_wav_player_get_len(pjmedia_port *port); | |||
/** | /** | |||
* Set the file play position of WAV player. | * Set the file play position of WAV player. | |||
* | * | |||
* @param port The file player port. | * @param port The file player port. | |||
* @param offset Playback position in bytes, relative to the start of | * @param offset Playback position in bytes, relative to the start of | |||
* the payload. | * the payload. | |||
* | * | |||
* @return PJ_SUCCESS on success. | * @return PJ_SUCCESS on success. | |||
*/ | */ | |||
PJ_DECL(pj_status_t) pjmedia_wav_player_port_set_pos( pjmedia_port *port, | PJ_DECL(pj_status_t) pjmedia_wav_player_port_set_pos( pjmedia_port *port, | |||
pj_uint32_t offset ); | pj_uint32_t offset ); | |||
/** | /** | |||
* Get the file play position of WAV player. | * Get the file play position of WAV player, in bytes. | |||
* | * | |||
* @param port The file player port. | * @param port The file player port. | |||
* | * | |||
* @return PJ_SUCCESS on success. | * @return The current play position, in bytes. On error, the | |||
* error code is given as negative value. | ||||
*/ | */ | |||
PJ_DECL(pj_ssize_t) pjmedia_wav_player_port_get_pos( pjmedia_port *port ); | PJ_DECL(pj_ssize_t) pjmedia_wav_player_port_get_pos( pjmedia_port *port ); | |||
/** | /** | |||
* Register a callback to be called when the file reading has reached the | * Register a callback to be called when the file reading has reached the | |||
* end of file. If the file is set to play repeatedly, then the callback | * end of file. If the file is set to play repeatedly, then the callback | |||
* will be called multiple times. Note that only one callback can be | * will be called multiple times. Note that only one callback can be | |||
* registered for each file port. | * registered for each file port. | |||
* | * | |||
* @param port The file player port. | * @param port The file player port. | |||
End of changes. 6 change blocks. | ||||
5 lines changed or deleted | 46 lines changed or added | |||