提交 14072e87 authored 作者: Anthony Minessale's avatar Anthony Minessale

remove freeswitch's privates (couldn't resist)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@677 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 c30a71fa
...@@ -234,7 +234,7 @@ SWITCH_DECLARE(const switch_state_handler_table *) switch_channel_get_state_hand ...@@ -234,7 +234,7 @@ SWITCH_DECLARE(const switch_state_handler_table *) switch_channel_get_state_hand
\param private void pointer to private data \param private void pointer to private data
\return SWITCH_STATUS_SUCCESS if data was set \return SWITCH_STATUS_SUCCESS if data was set
*/ */
SWITCH_DECLARE(switch_status) switch_channel_set_private(switch_channel *channel, void *private); SWITCH_DECLARE(switch_status) switch_channel_set_private(switch_channel *channel, void *private_info);
/*! /*!
\brief Retrieve private from a given channel \brief Retrieve private from a given channel
......
...@@ -283,24 +283,24 @@ SWITCH_DECLARE(void *) switch_core_session_get_private(switch_core_session *sess ...@@ -283,24 +283,24 @@ SWITCH_DECLARE(void *) switch_core_session_get_private(switch_core_session *sess
/*! /*!
\brief Add private user data to a session \brief Add private user data to a session
\param session the session to add used data to \param session the session to add used data to
\param private the used data to add \param private_info the used data to add
\return SWITCH_STATUS_SUCCESS if data is added \return SWITCH_STATUS_SUCCESS if data is added
*/ */
SWITCH_DECLARE(switch_status) switch_core_session_set_private(switch_core_session *session, void *private); SWITCH_DECLARE(switch_status) switch_core_session_set_private(switch_core_session *session, void *private_info);
/*! /*!
\brief Add a logical stream to a session \brief Add a logical stream to a session
\param session the session to add the stream to \param session the session to add the stream to
\param private an optional pointer to private data for the new stream \param private_info an optional pointer to private data for the new stream
\return the stream id of the new stream \return the stream id of the new stream
*/ */
SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session *session, void *private); SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session *session, void *private_info);
/*! /*!
\brief Retreive a logical stream from a session \brief Retreive a logical stream from a session
\param session the session to add the stream to \param session the session to add the stream to
\param index the index to retrieve \param index the index to retrieve
\return the private data (if any) \return the stream
*/ */
SWITCH_DECLARE(void *) switch_core_session_get_stream(switch_core_session *session, int index); SWITCH_DECLARE(void *) switch_core_session_get_stream(switch_core_session *session, int index);
......
...@@ -186,7 +186,7 @@ struct switch_endpoint_interface { ...@@ -186,7 +186,7 @@ struct switch_endpoint_interface {
const switch_state_handler_table *state_handler; const switch_state_handler_table *state_handler;
/*! private information */ /*! private information */
void *private; void *private_info;
/* to facilitate linking */ /* to facilitate linking */
const struct switch_endpoint_interface *next; const struct switch_endpoint_interface *next;
...@@ -207,7 +207,7 @@ struct switch_timer { ...@@ -207,7 +207,7 @@ struct switch_timer {
/*! the timer's memory pool */ /*! the timer's memory pool */
switch_memory_pool *memory_pool; switch_memory_pool *memory_pool;
/*! private data for loadable modules to store information */ /*! private data for loadable modules to store information */
void *private; void *private_info;
}; };
/*! \brief A table of functions that a timer module implements */ /*! \brief A table of functions that a timer module implements */
...@@ -276,7 +276,7 @@ struct switch_file_handle { ...@@ -276,7 +276,7 @@ struct switch_file_handle {
/*! the handle's memory pool */ /*! the handle's memory pool */
switch_memory_pool *memory_pool; switch_memory_pool *memory_pool;
/*! private data for the format module to store handle specific info */ /*! private data for the format module to store handle specific info */
void *private; void *private_info;
}; };
...@@ -316,7 +316,7 @@ struct switch_speech_handle { ...@@ -316,7 +316,7 @@ struct switch_speech_handle {
/*! the handle's memory pool */ /*! the handle's memory pool */
switch_memory_pool *memory_pool; switch_memory_pool *memory_pool;
/*! private data for the format module to store handle specific info */ /*! private data for the format module to store handle specific info */
void *private; void *private_info;
}; };
...@@ -349,7 +349,7 @@ struct switch_directory_handle { ...@@ -349,7 +349,7 @@ struct switch_directory_handle {
/*! the handle's memory pool */ /*! the handle's memory pool */
switch_memory_pool *memory_pool; switch_memory_pool *memory_pool;
/*! private data for the format module to store handle specific info */ /*! private data for the format module to store handle specific info */
void *private; void *private_info;
}; };
...@@ -403,7 +403,7 @@ struct switch_codec { ...@@ -403,7 +403,7 @@ struct switch_codec {
/*! the handle's memory pool*/ /*! the handle's memory pool*/
switch_memory_pool *memory_pool; switch_memory_pool *memory_pool;
/*! private data for the codec module to store handle specific info */ /*! private data for the codec module to store handle specific info */
void *private; void *private_info;
}; };
/*! \brief A table of settings and callbacks that define a paticular implementation of a codec */ /*! \brief A table of settings and callbacks that define a paticular implementation of a codec */
......
...@@ -64,7 +64,7 @@ static switch_status switch_g729_init(switch_codec *codec, switch_codec_flag fla ...@@ -64,7 +64,7 @@ static switch_status switch_g729_init(switch_codec *codec, switch_codec_flag fla
g729_init_decoder(&context->decoder_object); g729_init_decoder(&context->decoder_object);
} }
codec->private = context; codec->private_info = context;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
...@@ -74,7 +74,7 @@ static switch_status switch_g729_init(switch_codec *codec, switch_codec_flag fla ...@@ -74,7 +74,7 @@ static switch_status switch_g729_init(switch_codec *codec, switch_codec_flag fla
static switch_status switch_g729_destroy(switch_codec *codec) static switch_status switch_g729_destroy(switch_codec *codec)
{ {
codec->private = NULL; codec->private_info = NULL;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
...@@ -93,7 +93,7 @@ static switch_status switch_g729_encode(switch_codec *codec, ...@@ -93,7 +93,7 @@ static switch_status switch_g729_encode(switch_codec *codec,
unsigned int *flag) unsigned int *flag)
{ {
struct g729_context *context = codec->private; struct g729_context *context = codec->private_info;
int cbret = 0; int cbret = 0;
if (!context) { if (!context) {
...@@ -139,7 +139,7 @@ static switch_status switch_g729_decode(switch_codec *codec, ...@@ -139,7 +139,7 @@ static switch_status switch_g729_decode(switch_codec *codec,
unsigned int *flag) unsigned int *flag)
{ {
struct g729_context *context = codec->private; struct g729_context *context = codec->private_info;
if (!context) { if (!context) {
......
...@@ -52,26 +52,26 @@ static switch_status switch_gsm_init(switch_codec *codec, switch_codec_flag flag ...@@ -52,26 +52,26 @@ static switch_status switch_gsm_init(switch_codec *codec, switch_codec_flag flag
if (decoding) if (decoding)
context->decoder = gsm_create(); context->decoder = gsm_create();
} }
codec->private = context; codec->private_info = context;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status switch_gsm_destroy(switch_codec *codec) static switch_status switch_gsm_destroy(switch_codec *codec)
{ {
struct gsm_context *context = codec->private; struct gsm_context *context = codec->private_info;
int encoding = (codec->flags & SWITCH_CODEC_FLAG_ENCODE); int encoding = (codec->flags & SWITCH_CODEC_FLAG_ENCODE);
int decoding = (codec->flags & SWITCH_CODEC_FLAG_DECODE); int decoding = (codec->flags & SWITCH_CODEC_FLAG_DECODE);
if (encoding) if (encoding)
gsm_destroy(context->encoder); gsm_destroy(context->encoder);
if (decoding) if (decoding)
gsm_destroy(context->decoder); gsm_destroy(context->decoder);
codec->private = NULL; codec->private_info = NULL;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status switch_gsm_encode(switch_codec *codec, switch_codec *other_codec, void *decoded_data, static switch_status switch_gsm_encode(switch_codec *codec, switch_codec *other_codec, void *decoded_data,
size_t decoded_data_len, int decoded_rate, void *encoded_data, size_t decoded_data_len, int decoded_rate, void *encoded_data,
size_t *encoded_data_len, int *encoded_rate, unsigned int *flag) size_t *encoded_data_len, int *encoded_rate, unsigned int *flag)
{ {
struct gsm_context *context = codec->private; struct gsm_context *context = codec->private_info;
if (!context) { if (!context) {
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
...@@ -100,7 +100,7 @@ static switch_status switch_gsm_decode(switch_codec *codec, switch_codec *other_ ...@@ -100,7 +100,7 @@ static switch_status switch_gsm_decode(switch_codec *codec, switch_codec *other_
size_t encoded_data_len, int encoded_rate, void *decoded_data, size_t encoded_data_len, int encoded_rate, void *decoded_data,
size_t *decoded_data_len, int *decoded_rate, unsigned int *flag) size_t *decoded_data_len, int *decoded_rate, unsigned int *flag)
{ {
struct gsm_context *context = codec->private; struct gsm_context *context = codec->private_info;
if (!context) { if (!context) {
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
......
...@@ -59,14 +59,14 @@ static switch_status switch_ilbc_init(switch_codec *codec, switch_codec_flag fla ...@@ -59,14 +59,14 @@ static switch_status switch_ilbc_init(switch_codec *codec, switch_codec_flag fla
context->decoder = ilbc_create(); context->decoder = ilbc_create();
} }
codec->private = context; codec->private_info = context;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
static switch_status switch_ilbc_destroy(switch_codec *codec) static switch_status switch_ilbc_destroy(switch_codec *codec)
{ {
struct ilbc_context *context = codec->private; struct ilbc_context *context = codec->private_info;
int encoding = (codec->flags & SWITCH_CODEC_FLAG_ENCODE); int encoding = (codec->flags & SWITCH_CODEC_FLAG_ENCODE);
int decoding = (codec->flags & SWITCH_CODEC_FLAG_DECODE); int decoding = (codec->flags & SWITCH_CODEC_FLAG_DECODE);
...@@ -76,7 +76,7 @@ static switch_status switch_ilbc_destroy(switch_codec *codec) ...@@ -76,7 +76,7 @@ static switch_status switch_ilbc_destroy(switch_codec *codec)
if (decoding) if (decoding)
ilbc_destroy(context->decoder); ilbc_destroy(context->decoder);
codec->private = NULL; codec->private_info = NULL;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
...@@ -92,7 +92,7 @@ static switch_status switch_ilbc_encode(switch_codec *codec, ...@@ -92,7 +92,7 @@ static switch_status switch_ilbc_encode(switch_codec *codec,
int *encoded_rate, int *encoded_rate,
unsigned int *flag) unsigned int *flag)
{ {
struct ilbc_context *context = codec->private; struct ilbc_context *context = codec->private_info;
int cbret = 0; int cbret = 0;
if (!context) { if (!context) {
...@@ -132,7 +132,7 @@ static switch_status switch_ilbc_decode(switch_codec *codec, ...@@ -132,7 +132,7 @@ static switch_status switch_ilbc_decode(switch_codec *codec,
int *decoded_rate, int *decoded_rate,
unsigned int *flag) unsigned int *flag)
{ {
struct ilbc_context *context = codec->private; struct ilbc_context *context = codec->private_info;
if (!context) { if (!context) {
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
......
...@@ -152,7 +152,7 @@ static switch_status switch_speex_init(switch_codec *codec, switch_codec_flag fl ...@@ -152,7 +152,7 @@ static switch_status switch_speex_init(switch_codec *codec, switch_codec_flag fl
codec->private = context; codec->private_info = context;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
} }
...@@ -165,7 +165,7 @@ static switch_status switch_speex_encode(switch_codec *codec, ...@@ -165,7 +165,7 @@ static switch_status switch_speex_encode(switch_codec *codec,
void *encoded_data, void *encoded_data,
size_t *encoded_data_len, int *encoded_rate, unsigned int *flag) size_t *encoded_data_len, int *encoded_rate, unsigned int *flag)
{ {
struct speex_context *context = codec->private; struct speex_context *context = codec->private_info;
short *buf; short *buf;
int is_speech = 1; int is_speech = 1;
...@@ -220,7 +220,7 @@ static switch_status switch_speex_decode(switch_codec *codec, ...@@ -220,7 +220,7 @@ static switch_status switch_speex_decode(switch_codec *codec,
void *decoded_data, void *decoded_data,
size_t *decoded_data_len, int *decoded_rate, unsigned int *flag) size_t *decoded_data_len, int *decoded_rate, unsigned int *flag)
{ {
struct speex_context *context = codec->private; struct speex_context *context = codec->private_info;
short *buf; short *buf;
if (!context) { if (!context) {
...@@ -242,7 +242,7 @@ static switch_status switch_speex_decode(switch_codec *codec, ...@@ -242,7 +242,7 @@ static switch_status switch_speex_decode(switch_codec *codec,
static switch_status switch_speex_destroy(switch_codec *codec) static switch_status switch_speex_destroy(switch_codec *codec)
{ {
int encoding, decoding; int encoding, decoding;
struct speex_context *context = codec->private; struct speex_context *context = codec->private_info;
if (!context) { if (!context) {
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
...@@ -261,7 +261,7 @@ static switch_status switch_speex_destroy(switch_codec *codec) ...@@ -261,7 +261,7 @@ static switch_status switch_speex_destroy(switch_codec *codec)
speex_decoder_destroy(context->decoder_state); speex_decoder_destroy(context->decoder_state);
} }
codec->private = NULL; codec->private_info = NULL;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
......
...@@ -81,7 +81,7 @@ static switch_status mod_ldap_open(switch_directory_handle *dh, char *source, ch ...@@ -81,7 +81,7 @@ static switch_status mod_ldap_open(switch_directory_handle *dh, char *source, ch
} }
dh->private = context; dh->private_info = context;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
...@@ -90,7 +90,7 @@ static switch_status mod_ldap_close(switch_directory_handle *dh) ...@@ -90,7 +90,7 @@ static switch_status mod_ldap_close(switch_directory_handle *dh)
{ {
struct ldap_context *context; struct ldap_context *context;
context = dh->private; context = dh->private_info;
assert(context != NULL); assert(context != NULL);
ldap_unbind_s(context->ld); ldap_unbind_s(context->ld);
...@@ -102,7 +102,7 @@ static switch_status mod_ldap_query(switch_directory_handle *dh, char *base, cha ...@@ -102,7 +102,7 @@ static switch_status mod_ldap_query(switch_directory_handle *dh, char *base, cha
{ {
struct ldap_context *context; struct ldap_context *context;
context = dh->private; context = dh->private_info;
assert(context != NULL); assert(context != NULL);
if (ldap_search_s(context->ld, base, LDAP_SCOPE_SUBTREE, query, NULL, 0, &context->msg) != LDAP_SUCCESS) { if (ldap_search_s(context->ld, base, LDAP_SCOPE_SUBTREE, query, NULL, 0, &context->msg) != LDAP_SUCCESS) {
...@@ -120,7 +120,7 @@ static switch_status mod_ldap_next(switch_directory_handle *dh) ...@@ -120,7 +120,7 @@ static switch_status mod_ldap_next(switch_directory_handle *dh)
{ {
struct ldap_context *context; struct ldap_context *context;
context = dh->private; context = dh->private_info;
assert(context != NULL); assert(context != NULL);
context->vitt = 0; context->vitt = 0;
...@@ -144,7 +144,7 @@ switch_status mod_ldap_next_pair(switch_directory_handle *dh, char **var, char * ...@@ -144,7 +144,7 @@ switch_status mod_ldap_next_pair(switch_directory_handle *dh, char **var, char *
{ {
struct ldap_context *context; struct ldap_context *context;
context = dh->private; context = dh->private_info;
assert(context != NULL); assert(context != NULL);
*var = *val = NULL; *var = *val = NULL;
......
...@@ -313,7 +313,7 @@ static switch_status wanpipe_on_hangup(switch_core_session *session) ...@@ -313,7 +313,7 @@ static switch_status wanpipe_on_hangup(switch_core_session *session)
tech_pvt = switch_core_session_get_private(session); tech_pvt = switch_core_session_get_private(session);
assert(tech_pvt != NULL); assert(tech_pvt != NULL);
chanmap = tech_pvt->spri->private; chanmap = tech_pvt->spri->private_info;
sangoma_socket_close(&tech_pvt->socket); sangoma_socket_close(&tech_pvt->socket);
...@@ -423,7 +423,7 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit ...@@ -423,7 +423,7 @@ static switch_status wanpipe_outgoing_channel(switch_core_session *session, swit
do { do {
if ((spri = &SPANS[span]->spri)) { if ((spri = &SPANS[span]->spri)) {
chanmap = spri->private; chanmap = spri->private_info;
if (channo == 0) { if (channo == 0) {
if (autochan > 0) { if (autochan > 0) {
for(channo = 1; channo < SANGOMA_MAX_CHAN_PER_SPAN; channo++) { for(channo = 1; channo < SANGOMA_MAX_CHAN_PER_SPAN; channo++) {
...@@ -813,7 +813,7 @@ static int on_hangup(struct sangoma_pri *spri, sangoma_pri_event_t event_type, p ...@@ -813,7 +813,7 @@ static int on_hangup(struct sangoma_pri *spri, sangoma_pri_event_t event_type, p
switch_core_session *session; switch_core_session *session;
struct private_object *tech_pvt; struct private_object *tech_pvt;
chanmap = spri->private; chanmap = spri->private_info;
if ((session = chanmap->map[event->hangup.channel])) { if ((session = chanmap->map[event->hangup.channel])) {
switch_channel *channel = NULL; switch_channel *channel = NULL;
...@@ -843,7 +843,7 @@ static int on_answer(struct sangoma_pri *spri, sangoma_pri_event_t event_type, p ...@@ -843,7 +843,7 @@ static int on_answer(struct sangoma_pri *spri, sangoma_pri_event_t event_type, p
switch_channel *channel; switch_channel *channel;
struct channel_map *chanmap; struct channel_map *chanmap;
chanmap = spri->private; chanmap = spri->private_info;
if ((session = chanmap->map[event->answer.channel])) { if ((session = chanmap->map[event->answer.channel])) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "-- Answer on channel %d\n", event->answer.channel); switch_console_printf(SWITCH_CHANNEL_CONSOLE, "-- Answer on channel %d\n", event->answer.channel);
...@@ -864,7 +864,7 @@ static int on_proceed(struct sangoma_pri *spri, sangoma_pri_event_t event_type, ...@@ -864,7 +864,7 @@ static int on_proceed(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
switch_channel *channel; switch_channel *channel;
struct channel_map *chanmap; struct channel_map *chanmap;
chanmap = spri->private; chanmap = spri->private_info;
if ((session = chanmap->map[event->proceeding.channel])) { if ((session = chanmap->map[event->proceeding.channel])) {
switch_caller_profile *originator; switch_caller_profile *originator;
...@@ -902,7 +902,7 @@ static int on_ringing(struct sangoma_pri *spri, sangoma_pri_event_t event_type, ...@@ -902,7 +902,7 @@ static int on_ringing(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
struct channel_map *chanmap; struct channel_map *chanmap;
struct private_object *tech_pvt; struct private_object *tech_pvt;
chanmap = spri->private; chanmap = spri->private_info;
if ((session = chanmap->map[event->ringing.channel])) { if ((session = chanmap->map[event->ringing.channel])) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "-- Ringing on channel %d\n", event->ringing.channel); switch_console_printf(SWITCH_CHANNEL_CONSOLE, "-- Ringing on channel %d\n", event->ringing.channel);
...@@ -935,7 +935,7 @@ static int on_ring(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri ...@@ -935,7 +935,7 @@ static int on_ring(struct sangoma_pri *spri, sangoma_pri_event_t event_type, pri
chanmap = spri->private; chanmap = spri->private_info;
if (chanmap->map[event->ring.channel]) { if (chanmap->map[event->ring.channel]) {
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "--Duplicate Ring on channel %d (ignored)\n", switch_console_printf(SWITCH_CHANNEL_CONSOLE, "--Duplicate Ring on channel %d (ignored)\n",
event->ring.channel); event->ring.channel);
...@@ -1027,7 +1027,7 @@ static int on_restart(struct sangoma_pri *spri, sangoma_pri_event_t event_type, ...@@ -1027,7 +1027,7 @@ static int on_restart(struct sangoma_pri *spri, sangoma_pri_event_t event_type,
switch_console_printf(SWITCH_CHANNEL_CONSOLE, "-- Restarting channel %d\n", event->restart.channel); switch_console_printf(SWITCH_CHANNEL_CONSOLE, "-- Restarting channel %d\n", event->restart.channel);
chanmap = spri->private; chanmap = spri->private_info;
if ((session = chanmap->map[event->restart.channel])) { if ((session = chanmap->map[event->restart.channel])) {
switch_channel *channel; switch_channel *channel;
...@@ -1070,7 +1070,7 @@ static void *pri_thread_run(switch_thread *thread, void *obj) ...@@ -1070,7 +1070,7 @@ static void *pri_thread_run(switch_thread *thread, void *obj)
SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_RESTART, on_restart); SANGOMA_MAP_PRI_EVENT((*spri), SANGOMA_PRI_EVENT_RESTART, on_restart);
spri->on_loop = check_flags; spri->on_loop = check_flags;
spri->private = &chanmap; spri->private_info = &chanmap;
if (switch_event_create(&s_event, SWITCH_EVENT_PUBLISH) == SWITCH_STATUS_SUCCESS) { if (switch_event_create(&s_event, SWITCH_EVENT_PUBLISH) == SWITCH_STATUS_SUCCESS) {
switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "service", "_pri._tcp"); switch_event_add_header(s_event, SWITCH_STACK_BOTTOM, "service", "_pri._tcp");
......
...@@ -139,14 +139,14 @@ switch_status sndfile_file_open(switch_file_handle *handle, char *path) ...@@ -139,14 +139,14 @@ switch_status sndfile_file_open(switch_file_handle *handle, char *path)
handle->sections = context->sfinfo.sections; handle->sections = context->sfinfo.sections;
handle->seekable = context->sfinfo.seekable; handle->seekable = context->sfinfo.seekable;
handle->private = context; handle->private_info = context;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
switch_status sndfile_file_close(switch_file_handle *handle) switch_status sndfile_file_close(switch_file_handle *handle)
{ {
sndfile_context *context = handle->private; sndfile_context *context = handle->private_info;
sf_close(context->handle); sf_close(context->handle);
...@@ -155,7 +155,7 @@ switch_status sndfile_file_close(switch_file_handle *handle) ...@@ -155,7 +155,7 @@ switch_status sndfile_file_close(switch_file_handle *handle)
switch_status sndfile_file_seek(switch_file_handle *handle, unsigned int *cur_sample, unsigned int samples, int whence) switch_status sndfile_file_seek(switch_file_handle *handle, unsigned int *cur_sample, unsigned int samples, int whence)
{ {
sndfile_context *context = handle->private; sndfile_context *context = handle->private_info;
if (!handle->seekable) { if (!handle->seekable) {
return SWITCH_STATUS_NOTIMPL; return SWITCH_STATUS_NOTIMPL;
...@@ -170,7 +170,7 @@ switch_status sndfile_file_seek(switch_file_handle *handle, unsigned int *cur_sa ...@@ -170,7 +170,7 @@ switch_status sndfile_file_seek(switch_file_handle *handle, unsigned int *cur_sa
switch_status sndfile_file_read(switch_file_handle *handle, void *data, size_t *len) switch_status sndfile_file_read(switch_file_handle *handle, void *data, size_t *len)
{ {
size_t inlen = *len; size_t inlen = *len;
sndfile_context *context = handle->private; sndfile_context *context = handle->private_info;
if (switch_test_flag(handle, SWITCH_FILE_DATA_RAW)) { if (switch_test_flag(handle, SWITCH_FILE_DATA_RAW)) {
*len = (size_t) sf_read_raw(context->handle, data, inlen); *len = (size_t) sf_read_raw(context->handle, data, inlen);
...@@ -192,7 +192,7 @@ switch_status sndfile_file_read(switch_file_handle *handle, void *data, size_t * ...@@ -192,7 +192,7 @@ switch_status sndfile_file_read(switch_file_handle *handle, void *data, size_t *
switch_status sndfile_file_write(switch_file_handle *handle, void *data, size_t *len) switch_status sndfile_file_write(switch_file_handle *handle, void *data, size_t *len)
{ {
size_t inlen = *len; size_t inlen = *len;
sndfile_context *context = handle->private; sndfile_context *context = handle->private_info;
if (switch_test_flag(handle, SWITCH_FILE_DATA_RAW)) { if (switch_test_flag(handle, SWITCH_FILE_DATA_RAW)) {
*len = (size_t) sf_write_raw(context->handle, data, inlen); *len = (size_t) sf_write_raw(context->handle, data, inlen);
......
...@@ -53,7 +53,7 @@ static switch_status soft_timer_init(switch_timer *timer) ...@@ -53,7 +53,7 @@ static switch_status soft_timer_init(switch_timer *timer)
struct timer_private *private; struct timer_private *private;
private = switch_core_alloc(timer->memory_pool, sizeof(*private)); private = switch_core_alloc(timer->memory_pool, sizeof(*private));
timer->private = private; timer->private_info = private;
#ifdef WINTIMER #ifdef WINTIMER
QueryPerformanceFrequency(&private->freq); QueryPerformanceFrequency(&private->freq);
...@@ -67,7 +67,7 @@ static switch_status soft_timer_init(switch_timer *timer) ...@@ -67,7 +67,7 @@ static switch_status soft_timer_init(switch_timer *timer)
static switch_status soft_timer_next(switch_timer *timer) static switch_status soft_timer_next(switch_timer *timer)
{ {
struct timer_private *private = timer->private; struct timer_private *private = timer->private_info;
#ifdef WINTIMER #ifdef WINTIMER
private->base.QuadPart += timer->interval * (private->freq.QuadPart / 1000); private->base.QuadPart += timer->interval * (private->freq.QuadPart / 1000);
...@@ -93,7 +93,7 @@ static switch_status soft_timer_next(switch_timer *timer) ...@@ -93,7 +93,7 @@ static switch_status soft_timer_next(switch_timer *timer)
static switch_status soft_timer_destroy(switch_timer *timer) static switch_status soft_timer_destroy(switch_timer *timer)
{ {
timer->private = NULL; timer->private_info = NULL;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
......
...@@ -46,7 +46,7 @@ struct switch_channel { ...@@ -46,7 +46,7 @@ struct switch_channel {
int state_handler_index; int state_handler_index;
switch_hash *variables; switch_hash *variables;
switch_channel_timetable_t times; switch_channel_timetable_t times;
void *private; void *private_info;
int freq; int freq;
int bits; int bits;
int channels; int channels;
...@@ -185,17 +185,17 @@ SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel *channel, char ...@@ -185,17 +185,17 @@ SWITCH_DECLARE(char *) switch_channel_get_variable(switch_channel *channel, char
return switch_core_hash_find(channel->variables, varname); return switch_core_hash_find(channel->variables, varname);
} }
SWITCH_DECLARE(switch_status) switch_channel_set_private(switch_channel *channel, void *private) SWITCH_DECLARE(switch_status) switch_channel_set_private(switch_channel *channel, void *private_info)
{ {
assert(channel != NULL); assert(channel != NULL);
channel->private = private; channel->private_info = private_info;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel *channel) SWITCH_DECLARE(void *) switch_channel_get_private(switch_channel *channel)
{ {
assert(channel != NULL); assert(channel != NULL);
return channel->private; return channel->private_info;
} }
SWITCH_DECLARE(switch_status) switch_channel_set_name(switch_channel *channel, char *name) SWITCH_DECLARE(switch_status) switch_channel_set_name(switch_channel *channel, char *name)
......
...@@ -82,7 +82,7 @@ struct switch_core_session { ...@@ -82,7 +82,7 @@ struct switch_core_session {
int stream_count; int stream_count;
char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1];
void *private; void *private_info;
}; };
struct switch_core_runtime { struct switch_core_runtime {
...@@ -741,20 +741,20 @@ SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool *pool, char *todup) ...@@ -741,20 +741,20 @@ SWITCH_DECLARE(char *) switch_core_strdup(switch_memory_pool *pool, char *todup)
SWITCH_DECLARE(void *) switch_core_session_get_private(switch_core_session *session) SWITCH_DECLARE(void *) switch_core_session_get_private(switch_core_session *session)
{ {
assert(session != NULL); assert(session != NULL);
return session->private; return session->private_info;
} }
SWITCH_DECLARE(switch_status) switch_core_session_set_private(switch_core_session *session, void *private) SWITCH_DECLARE(switch_status) switch_core_session_set_private(switch_core_session *session, void *private_info)
{ {
assert(session != NULL); assert(session != NULL);
session->private = private; session->private_info = private_info;
return SWITCH_STATUS_SUCCESS; return SWITCH_STATUS_SUCCESS;
} }
SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session *session, void *private) SWITCH_DECLARE(int) switch_core_session_add_stream(switch_core_session *session, void *private_info)
{ {
session->streams[session->stream_count++] = private; session->streams[session->stream_count++] = private_info;
return session->stream_count - 1; return session->stream_count - 1;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论