提交 59d1bdae authored 作者: William King's avatar William King

FS-7845 whitespace and indention

上级 d8194e9e
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/ * http://www.mozilla.org/MPL/
* *
* Software distributed under the License is distributed on an "AS IS" basis, * Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the * for the specific language governing rights and limitations under the
* License. * License.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* the Initial Developer. All Rights Reserved. * the Initial Developer. All Rights Reserved.
* *
* Contributor(s): * Contributor(s):
* *
* Anthony Minessale II <anthm@freeswitch.org> * Anthony Minessale II <anthm@freeswitch.org>
* Neal Horman <neal at wanlink dot com> * Neal Horman <neal at wanlink dot com>
* Bret McDanel <trixter at 0xdecafbad dot com> * Bret McDanel <trixter at 0xdecafbad dot com>
...@@ -95,7 +95,7 @@ void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t ...@@ -95,7 +95,7 @@ void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t
if (stream) { if (stream) {
stream->write_function(stream, "Member %d (%s) 0.0:0.0:0.0\n", member->id, switch_channel_get_name(member->channel)); stream->write_function(stream, "Member %d (%s) 0.0:0.0:0.0\n", member->id, switch_channel_get_name(member->channel));
} else { } else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Member %d (%s) 0.0:0.0:0.0\n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Member %d (%s) 0.0:0.0:0.0\n",
member->id, switch_channel_get_name(member->channel)); member->id, switch_channel_get_name(member->channel));
} }
} }
...@@ -109,7 +109,7 @@ void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t ...@@ -109,7 +109,7 @@ void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t
radius = 1.0f; radius = 1.0f;
pos = -90.0f; pos = -90.0f;
for (member = conference->members; member; member = member->next) { for (member = conference->members; member; member = member->next) {
if (!member->channel || conference_utils_member_test_flag(member, MFLAG_NO_POSITIONAL) || !conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) { if (!member->channel || conference_utils_member_test_flag(member, MFLAG_NO_POSITIONAL) || !conference_utils_member_test_flag(member, MFLAG_CAN_SPEAK)) {
...@@ -146,13 +146,13 @@ void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t ...@@ -146,13 +146,13 @@ void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t
if (stream) { if (stream) {
stream->write_function(stream, "Member %d (%s) %0.2f:0.0:%0.2f\n", member->id, switch_channel_get_name(member->channel), x, z); stream->write_function(stream, "Member %d (%s) %0.2f:0.0:%0.2f\n", member->id, switch_channel_get_name(member->channel), x, z);
} else { } else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Member %d (%s) %0.2f:0.0:%0.2f\n", switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Member %d (%s) %0.2f:0.0:%0.2f\n",
member->id, switch_channel_get_name(member->channel), x, z); member->id, switch_channel_get_name(member->channel), x, z);
} }
pos += offset; pos += offset;
} }
end: end:
switch_mutex_unlock(conference->member_mutex); switch_mutex_unlock(conference->member_mutex);
...@@ -184,16 +184,16 @@ void conference_al_process(al_handle_t *al, void *data, switch_size_t datalen, i ...@@ -184,16 +184,16 @@ void conference_al_process(al_handle_t *al, void *data, switch_size_t datalen, i
if ((al->device = alcLoopbackOpenDeviceSOFT(NULL))) { if ((al->device = alcLoopbackOpenDeviceSOFT(NULL))) {
const ALshort silence[16] = { 0 }; const ALshort silence[16] = { 0 };
float orient[6] = { /*fwd:*/ 0., 0., -1., /*up:*/ 0., 1., 0. }; float orient[6] = { /*fwd:*/ 0., 0., -1., /*up:*/ 0., 1., 0. };
al->context = alcCreateContext(al->device, contextAttr); al->context = alcCreateContext(al->device, contextAttr);
alcSetThreadContext(al->context); alcSetThreadContext(al->context);
/* listener at origin, facing down -z (ears at 0.0m height) */ /* listener at origin, facing down -z (ears at 0.0m height) */
alListener3f( AL_POSITION, 0. ,0, 0. ); alListener3f( AL_POSITION, 0. ,0, 0. );
alListener3f( AL_VELOCITY, 0., 0., 0. ); alListener3f( AL_VELOCITY, 0., 0., 0. );
alListenerfv( AL_ORIENTATION, orient ); alListenerfv( AL_ORIENTATION, orient );
alGenSources(1, &al->source); alGenSources(1, &al->source);
alSourcef( al->source, AL_PITCH, 1.); alSourcef( al->source, AL_PITCH, 1.);
alSourcef( al->source, AL_GAIN, 1.); alSourcef( al->source, AL_GAIN, 1.);
...@@ -210,17 +210,17 @@ void conference_al_process(al_handle_t *al, void *data, switch_size_t datalen, i ...@@ -210,17 +210,17 @@ void conference_al_process(al_handle_t *al, void *data, switch_size_t datalen, i
if (al->device) { if (al->device) {
ALint processed = 0, state = 0; ALint processed = 0, state = 0;
//alcSetThreadContext(al->context); //alcSetThreadContext(al->context);
alGetSourcei(al->source, AL_SOURCE_STATE, &state); alGetSourcei(al->source, AL_SOURCE_STATE, &state);
alGetSourcei(al->source, AL_BUFFERS_PROCESSED, &processed); alGetSourcei(al->source, AL_BUFFERS_PROCESSED, &processed);
if (al->setpos) { if (al->setpos) {
al->setpos = 0; al->setpos = 0;
alSource3f(al->source, AL_POSITION, al->pos_x, al->pos_y, al->pos_z); alSource3f(al->source, AL_POSITION, al->pos_x, al->pos_y, al->pos_z);
//alSource3f(al->source, AL_VELOCITY, .01, 0., 0.); //alSource3f(al->source, AL_VELOCITY, .01, 0., 0.);
} }
if (processed > 0) { if (processed > 0) {
ALuint bufid; ALuint bufid;
alSourceUnqueueBuffers(al->source, 1, &bufid); alSourceUnqueueBuffers(al->source, 1, &bufid);
...@@ -231,29 +231,29 @@ void conference_al_process(al_handle_t *al, void *data, switch_size_t datalen, i ...@@ -231,29 +231,29 @@ void conference_al_process(al_handle_t *al, void *data, switch_size_t datalen, i
if (state != AL_PLAYING) { if (state != AL_PLAYING) {
alSourcePlay(al->source); alSourcePlay(al->source);
} }
alcRenderSamplesSOFT(al->device, data, datalen / 2); alcRenderSamplesSOFT(al->device, data, datalen / 2);
} }
} }
#endif #endif
#ifndef OPENAL_POSITIONING #ifndef OPENAL_POSITIONING
switch_status_t conference_al_parse_position(al_handle_t *al, const char *data) switch_status_t conference_al_parse_position(al_handle_t *al, const char *data)
{ {
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
#else #else
switch_status_t conference_al_parse_position(al_handle_t *al, const char *data) switch_status_t conference_al_parse_position(al_handle_t *al, const char *data)
{ {
char *args[3]; char *args[3];
int num; int num;
char *dup; char *dup;
dup = strdup((char *)data); dup = strdup((char *)data);
switch_assert(dup); switch_assert(dup);
if ((num = switch_split(dup, ':', args)) != 3) { if ((num = switch_split(dup, ':', args)) != 3) {
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
...@@ -274,7 +274,7 @@ void conference_al_close(al_handle_t *al) ...@@ -274,7 +274,7 @@ void conference_al_close(al_handle_t *al)
{ {
if (!al) return; if (!al) return;
switch_mutex_lock(conference_globals.setup_mutex); switch_mutex_lock(conference_globals.setup_mutex);
if (al->source) { if (al->source) {
alDeleteSources(1, &al->source); alDeleteSources(1, &al->source);
al->source = 0; al->source = 0;
...@@ -299,3 +299,13 @@ void conference_al_close(al_handle_t *al) ...@@ -299,3 +299,13 @@ void conference_al_close(al_handle_t *al)
} }
#endif #endif
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
*/
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/ * http://www.mozilla.org/MPL/
* *
* Software distributed under the License is distributed on an "AS IS" basis, * Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the * for the specific language governing rights and limitations under the
* License. * License.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* the Initial Developer. All Rights Reserved. * the Initial Developer. All Rights Reserved.
* *
* Contributor(s): * Contributor(s):
* *
* Anthony Minessale II <anthm@freeswitch.org> * Anthony Minessale II <anthm@freeswitch.org>
* Neal Horman <neal at wanlink dot com> * Neal Horman <neal at wanlink dot com>
* Bret McDanel <trixter at 0xdecafbad dot com> * Bret McDanel <trixter at 0xdecafbad dot com>
...@@ -49,7 +49,7 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f ...@@ -49,7 +49,7 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f
if (test_eflag(conference, EFLAG_PLAY_FILE_DONE) && if (test_eflag(conference, EFLAG_PLAY_FILE_DONE) &&
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
conference_event_add_data(conference, event); conference_event_add_data(conference, event);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "seconds", "%ld", (long) node->fh.samples_in / node->fh.native_rate); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "seconds", "%ld", (long) node->fh.samples_in / node->fh.native_rate);
...@@ -62,7 +62,7 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f ...@@ -62,7 +62,7 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f
if (node->member_id) { if (node->member_id) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "play-file-member-done"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "play-file-member-done");
if ((member = conference_member_get(conference, node->member_id))) { if ((member = conference_member_get(conference, node->member_id))) {
conference_member_add_event_data(member, event); conference_member_add_event_data(member, event);
switch_thread_rwlock_unlock(member->rwlock); switch_thread_rwlock_unlock(member->rwlock);
...@@ -81,7 +81,7 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f ...@@ -81,7 +81,7 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f
switch_event_fire(&event); switch_event_fire(&event);
} }
#ifdef OPENAL_POSITIONING #ifdef OPENAL_POSITIONING
if (node->al && node->al->device) { if (node->al && node->al->device) {
conference_al_close(node->al); conference_al_close(node->al);
} }
...@@ -227,7 +227,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u ...@@ -227,7 +227,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u
/* positional requires mono input */ /* positional requires mono input */
fnode->fh.channels = channels = 1; fnode->fh.channels = channels = 1;
} }
retry: retry:
flags = SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT; flags = SWITCH_FILE_FLAG_READ | SWITCH_FILE_DATA_SHORT;
...@@ -245,11 +245,11 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u ...@@ -245,11 +245,11 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u
if (test_eflag(conference, EFLAG_PLAY_FILE) && if (test_eflag(conference, EFLAG_PLAY_FILE) &&
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
conference_event_add_data(conference, event); conference_event_add_data(conference, event);
if (fnode->fh.params) { if (fnode->fh.params) {
switch_event_merge(event, conference->fnode->fh.params); switch_event_merge(event, conference->fnode->fh.params);
} }
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "play-file"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "play-file");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "File", file); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "File", file);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Async", async ? "true" : "false"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Async", async ? "true" : "false");
...@@ -286,7 +286,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u ...@@ -286,7 +286,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u
fnode->pool = pool; fnode->pool = pool;
fnode->async = async; fnode->async = async;
fnode->file = switch_core_strdup(fnode->pool, file); fnode->file = switch_core_strdup(fnode->pool, file);
if (!conference->fnode || (async && !conference->async_fnode)) { if (!conference->fnode || (async && !conference->async_fnode)) {
conference_video_fnode_check(fnode); conference_video_fnode_check(fnode);
} }
...@@ -319,7 +319,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u ...@@ -319,7 +319,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u
switch_mutex_unlock(conference->mutex); switch_mutex_unlock(conference->mutex);
done: done:
switch_safe_free(expanded); switch_safe_free(expanded);
switch_safe_free(dfile); switch_safe_free(dfile);
...@@ -329,7 +329,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u ...@@ -329,7 +329,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u
/* Play a file */ /* Play a file */
switch_status_t conference_file_local_play(conference_obj_t *conference, switch_core_session_t *session, char *path, uint32_t leadin, void *buf, switch_status_t conference_file_local_play(conference_obj_t *conference, switch_core_session_t *session, char *path, uint32_t leadin, void *buf,
uint32_t buflen) uint32_t buflen)
{ {
uint32_t x = 0; uint32_t x = 0;
switch_status_t status = SWITCH_STATUS_SUCCESS; switch_status_t status = SWITCH_STATUS_SUCCESS;
...@@ -385,8 +385,19 @@ switch_status_t conference_file_local_play(conference_obj_t *conference, switch_ ...@@ -385,8 +385,19 @@ switch_status_t conference_file_local_play(conference_obj_t *conference, switch_
switch_safe_free(dpath); switch_safe_free(dpath);
} }
done: done:
switch_safe_free(expanded); switch_safe_free(expanded);
return status; return status;
} }
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
*/
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/ * http://www.mozilla.org/MPL/
* *
* Software distributed under the License is distributed on an "AS IS" basis, * Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the * for the specific language governing rights and limitations under the
* License. * License.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* the Initial Developer. All Rights Reserved. * the Initial Developer. All Rights Reserved.
* *
* Contributor(s): * Contributor(s):
* *
* Anthony Minessale II <anthm@freeswitch.org> * Anthony Minessale II <anthm@freeswitch.org>
* Neal Horman <neal at wanlink dot com> * Neal Horman <neal at wanlink dot com>
* Bret McDanel <trixter at 0xdecafbad dot com> * Bret McDanel <trixter at 0xdecafbad dot com>
...@@ -115,27 +115,27 @@ switch_status_t conference_record_action(conference_obj_t *conference, char *pat ...@@ -115,27 +115,27 @@ switch_status_t conference_record_action(conference_obj_t *conference, char *pat
switch_assert(conference != NULL); switch_assert(conference != NULL);
switch_mutex_lock(conference->member_mutex); switch_mutex_lock(conference->member_mutex);
for (member = conference->members; member; member = member->next) for (member = conference->members; member; member = member->next)
{
if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL) && (!path || !strcmp(path, member->rec_path)))
{ {
//switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Action: %d\n", action); if (conference_utils_member_test_flag(member, MFLAG_NOCHANNEL) && (!path || !strcmp(path, member->rec_path)))
switch (action) {
{ //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Action: %d\n", action);
case REC_ACTION_STOP: switch (action)
conference_utils_member_clear_flag_locked(member, MFLAG_RUNNING); {
count++; case REC_ACTION_STOP:
break; conference_utils_member_clear_flag_locked(member, MFLAG_RUNNING);
case REC_ACTION_PAUSE: count++;
conference_utils_member_set_flag_locked(member, MFLAG_PAUSE_RECORDING); break;
count = 1; case REC_ACTION_PAUSE:
break; conference_utils_member_set_flag_locked(member, MFLAG_PAUSE_RECORDING);
case REC_ACTION_RESUME: count = 1;
conference_utils_member_clear_flag_locked(member, MFLAG_PAUSE_RECORDING); break;
count = 1; case REC_ACTION_RESUME:
break; conference_utils_member_clear_flag_locked(member, MFLAG_PAUSE_RECORDING);
} count = 1;
break;
}
} }
} }
switch_mutex_unlock(conference->member_mutex); switch_mutex_unlock(conference->member_mutex);
return count; return count;
} }
...@@ -225,7 +225,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v ...@@ -225,7 +225,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
flags |= SWITCH_FILE_FLAG_VIDEO; flags |= SWITCH_FILE_FLAG_VIDEO;
if (conference->canvas) { if (conference->canvas) {
char *orig_path = rec->path; char *orig_path = rec->path;
rec->path = switch_core_sprintf(rec->pool, "{channels=%d,samplerate=%d,vw=%d,vh=%d,fps=%0.2f}%s", rec->path = switch_core_sprintf(rec->pool, "{channels=%d,samplerate=%d,vw=%d,vh=%d,fps=%0.2f}%s",
conference->channels, conference->channels,
conference->rate, conference->rate,
conference->canvas->width, conference->canvas->width,
...@@ -277,7 +277,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v ...@@ -277,7 +277,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
switch_core_file_set_string(&member->rec->fh, SWITCH_AUDIO_COL_STR_ARTIST, "FreeSWITCH mod_conference Software Conference Module"); switch_core_file_set_string(&member->rec->fh, SWITCH_AUDIO_COL_STR_ARTIST, "FreeSWITCH mod_conference Software Conference Module");
if (test_eflag(conference, EFLAG_RECORD) && if (test_eflag(conference, EFLAG_RECORD) &&
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) { switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
conference_event_add_data(conference, event); conference_event_add_data(conference, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "start-recording"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "start-recording");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Path", rec->path); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Path", rec->path);
...@@ -325,7 +325,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v ...@@ -325,7 +325,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
if (len == 0) { if (len == 0) {
mux_used = (uint32_t) switch_buffer_inuse(member->mux_buffer); mux_used = (uint32_t) switch_buffer_inuse(member->mux_buffer);
if (mux_used >= data_buf_len) { if (mux_used >= data_buf_len) {
goto again; goto again;
} }
...@@ -346,16 +346,16 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v ...@@ -346,16 +346,16 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
switch_core_timer_next(&timer); switch_core_timer_next(&timer);
} /* Rinse ... Repeat */ } /* Rinse ... Repeat */
end: end:
for(;;) { for(;;) {
switch_mutex_lock(member->audio_out_mutex); switch_mutex_lock(member->audio_out_mutex);
rlen = (uint32_t) switch_buffer_read(member->mux_buffer, data_buf, data_buf_len); rlen = (uint32_t) switch_buffer_read(member->mux_buffer, data_buf, data_buf_len);
switch_mutex_unlock(member->audio_out_mutex); switch_mutex_unlock(member->audio_out_mutex);
if (rlen > 0) { if (rlen > 0) {
len = (switch_size_t) rlen / sizeof(int16_t)/ conference->channels; len = (switch_size_t) rlen / sizeof(int16_t)/ conference->channels;
switch_core_file_write(&member->rec->fh, data_buf, &len); switch_core_file_write(&member->rec->fh, data_buf, &len);
} else { } else {
break; break;
} }
...@@ -382,9 +382,9 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v ...@@ -382,9 +382,9 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
conference_event_add_data(conference, event); conference_event_add_data(conference, event);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "stop-recording"); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "stop-recording");
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Path", rec->path); switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Path", rec->path);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Samples-Out", "%ld", (long) member->rec->fh.samples_out); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Samples-Out", "%ld", (long) member->rec->fh.samples_out);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Samplerate", "%ld", (long) member->rec->fh.samplerate); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Samplerate", "%ld", (long) member->rec->fh.samplerate);
switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Milliseconds-Elapsed", "%ld", (long) member->rec->fh.samples_out / (member->rec->fh.samplerate / 1000)); switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Milliseconds-Elapsed", "%ld", (long) member->rec->fh.samples_out / (member->rec->fh.samplerate / 1000));
switch_event_fire(&event); switch_event_fire(&event);
} }
...@@ -419,5 +419,13 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v ...@@ -419,5 +419,13 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
return NULL; return NULL;
} }
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
*/
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
* the License. You may obtain a copy of the License at * the License. You may obtain a copy of the License at
* http://www.mozilla.org/MPL/ * http://www.mozilla.org/MPL/
* *
* Software distributed under the License is distributed on an "AS IS" basis, * Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the * for the specific language governing rights and limitations under the
* License. * License.
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
* the Initial Developer. All Rights Reserved. * the Initial Developer. All Rights Reserved.
* *
* Contributor(s): * Contributor(s):
* *
* Anthony Minessale II <anthm@freeswitch.org> * Anthony Minessale II <anthm@freeswitch.org>
* Neal Horman <neal at wanlink dot com> * Neal Horman <neal at wanlink dot com>
* Bret McDanel <trixter at 0xdecafbad dot com> * Bret McDanel <trixter at 0xdecafbad dot com>
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
*/ */
#include <mod_conference.h> #include <mod_conference.h>
const char *conference_utils_combine_flag_var(switch_core_session_t *session, const char *var_name) const char *conference_utils_combine_flag_var(switch_core_session_t *session, const char *var_name)
{ {
switch_event_header_t *hp; switch_event_header_t *hp;
switch_event_t *event, *cevent; switch_event_t *event, *cevent;
...@@ -52,7 +52,7 @@ const char *conference_utils_combine_flag_var(switch_core_session_t *session, co ...@@ -52,7 +52,7 @@ const char *conference_utils_combine_flag_var(switch_core_session_t *session, co
switch_channel_get_variables(channel, &cevent); switch_channel_get_variables(channel, &cevent);
switch_event_merge(event, cevent); switch_event_merge(event, cevent);
for (hp = event->headers; hp; hp = hp->next) { for (hp = event->headers; hp; hp = hp->next) {
char *var = hp->name; char *var = hp->name;
char *val = hp->value; char *val = hp->value;
...@@ -76,7 +76,7 @@ const char *conference_utils_combine_flag_var(switch_core_session_t *session, co ...@@ -76,7 +76,7 @@ const char *conference_utils_combine_flag_var(switch_core_session_t *session, co
} }
} }
} }
switch_event_destroy(&event); switch_event_destroy(&event);
switch_event_destroy(&cevent); switch_event_destroy(&cevent);
...@@ -196,7 +196,7 @@ void conference_utils_set_cflags(const char *flags, conference_flag_t *f) ...@@ -196,7 +196,7 @@ void conference_utils_set_cflags(const char *flags, conference_flag_t *f)
} else if (!strcasecmp(argv[i], "video-muxing-personal-canvas")) { } else if (!strcasecmp(argv[i], "video-muxing-personal-canvas")) {
f[CFLAG_PERSONAL_CANVAS] = 1; f[CFLAG_PERSONAL_CANVAS] = 1;
} }
} }
free(dup); free(dup);
} }
...@@ -358,3 +358,13 @@ switch_bool_t conference_utils_member_test_flag(conference_member_t *member, mem ...@@ -358,3 +358,13 @@ switch_bool_t conference_utils_member_test_flag(conference_member_t *member, mem
return !!member->flags[flag]; return !!member->flags[flag];
} }
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 noet:
*/
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论