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

FS-7845 whitespace and indention

上级 d8194e9e
......@@ -9,7 +9,7 @@
* the License. You may obtain a copy of the License at
* 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
* for the specific language governing rights and limitations under the
* License.
......@@ -22,7 +22,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Anthony Minessale II <anthm@freeswitch.org>
* Neal Horman <neal at wanlink 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
if (stream) {
stream->write_function(stream, "Member %d (%s) 0.0:0.0:0.0\n", member->id, switch_channel_get_name(member->channel));
} 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));
}
}
......@@ -109,7 +109,7 @@ void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t
radius = 1.0f;
pos = -90.0f;
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)) {
......@@ -146,13 +146,13 @@ void conference_al_gen_arc(conference_obj_t *conference, switch_stream_handle_t
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);
} 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);
}
pos += offset;
}
end:
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
if ((al->device = alcLoopbackOpenDeviceSOFT(NULL))) {
const ALshort silence[16] = { 0 };
float orient[6] = { /*fwd:*/ 0., 0., -1., /*up:*/ 0., 1., 0. };
al->context = alcCreateContext(al->device, contextAttr);
alcSetThreadContext(al->context);
/* listener at origin, facing down -z (ears at 0.0m height) */
alListener3f( AL_POSITION, 0. ,0, 0. );
alListener3f( AL_VELOCITY, 0., 0., 0. );
alListenerfv( AL_ORIENTATION, orient );
alGenSources(1, &al->source);
alSourcef( al->source, AL_PITCH, 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
if (al->device) {
ALint processed = 0, state = 0;
//alcSetThreadContext(al->context);
alGetSourcei(al->source, AL_SOURCE_STATE, &state);
alGetSourcei(al->source, AL_BUFFERS_PROCESSED, &processed);
if (al->setpos) {
al->setpos = 0;
alSource3f(al->source, AL_POSITION, al->pos_x, al->pos_y, al->pos_z);
//alSource3f(al->source, AL_VELOCITY, .01, 0., 0.);
}
if (processed > 0) {
ALuint 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
if (state != AL_PLAYING) {
alSourcePlay(al->source);
}
alcRenderSamplesSOFT(al->device, data, datalen / 2);
}
}
#endif
#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;
}
#else
switch_status_t conference_al_parse_position(al_handle_t *al, const char *data)
#else
switch_status_t conference_al_parse_position(al_handle_t *al, const char *data)
{
char *args[3];
int num;
char *dup;
dup = strdup((char *)data);
switch_assert(dup);
if ((num = switch_split(dup, ':', args)) != 3) {
return SWITCH_STATUS_FALSE;
}
......@@ -274,7 +274,7 @@ void conference_al_close(al_handle_t *al)
{
if (!al) return;
switch_mutex_lock(conference_globals.setup_mutex);
switch_mutex_lock(conference_globals.setup_mutex);
if (al->source) {
alDeleteSources(1, &al->source);
al->source = 0;
......@@ -299,3 +299,13 @@ void conference_al_close(al_handle_t *al)
}
#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 @@
* the License. You may obtain a copy of the License at
* 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
* for the specific language governing rights and limitations under the
* License.
......@@ -22,7 +22,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Anthony Minessale II <anthm@freeswitch.org>
* Neal Horman <neal at wanlink 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
if (test_eflag(conference, EFLAG_PLAY_FILE_DONE) &&
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
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);
......@@ -62,7 +62,7 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f
if (node->member_id) {
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "play-file-member-done");
if ((member = conference_member_get(conference, node->member_id))) {
conference_member_add_event_data(member, event);
switch_thread_rwlock_unlock(member->rwlock);
......@@ -81,7 +81,7 @@ switch_status_t conference_file_close(conference_obj_t *conference, conference_f
switch_event_fire(&event);
}
#ifdef OPENAL_POSITIONING
#ifdef OPENAL_POSITIONING
if (node->al && node->al->device) {
conference_al_close(node->al);
}
......@@ -227,7 +227,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u
/* positional requires mono input */
fnode->fh.channels = channels = 1;
}
retry:
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
if (test_eflag(conference, EFLAG_PLAY_FILE) &&
switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
conference_event_add_data(conference, event);
if (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, "File", file);
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
fnode->pool = pool;
fnode->async = async;
fnode->file = switch_core_strdup(fnode->pool, file);
if (!conference->fnode || (async && !conference->async_fnode)) {
conference_video_fnode_check(fnode);
}
......@@ -319,7 +319,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u
switch_mutex_unlock(conference->mutex);
done:
done:
switch_safe_free(expanded);
switch_safe_free(dfile);
......@@ -329,7 +329,7 @@ switch_status_t conference_file_play(conference_obj_t *conference, char *file, u
/* 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,
uint32_t buflen)
uint32_t buflen)
{
uint32_t x = 0;
switch_status_t status = SWITCH_STATUS_SUCCESS;
......@@ -385,8 +385,19 @@ switch_status_t conference_file_local_play(conference_obj_t *conference, switch_
switch_safe_free(dpath);
}
done:
done:
switch_safe_free(expanded);
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 @@
* the License. You may obtain a copy of the License at
* 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
* for the specific language governing rights and limitations under the
* License.
......@@ -22,7 +22,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Anthony Minessale II <anthm@freeswitch.org>
* Neal Horman <neal at wanlink 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
switch_assert(conference != NULL);
switch_mutex_lock(conference->member_mutex);
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);
switch (action)
{
case REC_ACTION_STOP:
conference_utils_member_clear_flag_locked(member, MFLAG_RUNNING);
count++;
break;
case REC_ACTION_PAUSE:
conference_utils_member_set_flag_locked(member, MFLAG_PAUSE_RECORDING);
count = 1;
break;
case REC_ACTION_RESUME:
conference_utils_member_clear_flag_locked(member, MFLAG_PAUSE_RECORDING);
count = 1;
break;
}
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);
switch (action)
{
case REC_ACTION_STOP:
conference_utils_member_clear_flag_locked(member, MFLAG_RUNNING);
count++;
break;
case REC_ACTION_PAUSE:
conference_utils_member_set_flag_locked(member, MFLAG_PAUSE_RECORDING);
count = 1;
break;
case REC_ACTION_RESUME:
conference_utils_member_clear_flag_locked(member, MFLAG_PAUSE_RECORDING);
count = 1;
break;
}
}
}
}
switch_mutex_unlock(conference->member_mutex);
return count;
}
......@@ -225,7 +225,7 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
flags |= SWITCH_FILE_FLAG_VIDEO;
if (conference->canvas) {
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->rate,
conference->canvas->width,
......@@ -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");
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);
switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, "Action", "start-recording");
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
if (len == 0) {
mux_used = (uint32_t) switch_buffer_inuse(member->mux_buffer);
if (mux_used >= data_buf_len) {
goto again;
}
......@@ -346,16 +346,16 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
switch_core_timer_next(&timer);
} /* Rinse ... Repeat */
end:
end:
for(;;) {
switch_mutex_lock(member->audio_out_mutex);
rlen = (uint32_t) switch_buffer_read(member->mux_buffer, data_buf, data_buf_len);
switch_mutex_unlock(member->audio_out_mutex);
if (rlen > 0) {
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 {
break;
}
......@@ -382,9 +382,9 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
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, "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, "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, "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, "Milliseconds-Elapsed", "%ld", (long) member->rec->fh.samples_out / (member->rec->fh.samplerate / 1000));
switch_event_fire(&event);
}
......@@ -419,5 +419,13 @@ void *SWITCH_THREAD_FUNC conference_record_thread_run(switch_thread_t *thread, v
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 @@
* the License. You may obtain a copy of the License at
* 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
* for the specific language governing rights and limitations under the
* License.
......@@ -22,7 +22,7 @@
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
*
*
* Anthony Minessale II <anthm@freeswitch.org>
* Neal Horman <neal at wanlink dot com>
* Bret McDanel <trixter at 0xdecafbad dot com>
......@@ -41,7 +41,7 @@
*/
#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_t *event, *cevent;
......@@ -52,7 +52,7 @@ const char *conference_utils_combine_flag_var(switch_core_session_t *session, co
switch_channel_get_variables(channel, &cevent);
switch_event_merge(event, cevent);
for (hp = event->headers; hp; hp = hp->next) {
char *var = hp->name;
char *val = hp->value;
......@@ -76,7 +76,7 @@ const char *conference_utils_combine_flag_var(switch_core_session_t *session, co
}
}
}
switch_event_destroy(&event);
switch_event_destroy(&cevent);
......@@ -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")) {
f[CFLAG_PERSONAL_CANVAS] = 1;
}
}
}
free(dup);
}
......@@ -358,3 +358,13 @@ switch_bool_t conference_utils_member_test_flag(conference_member_t *member, mem
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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论