mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-29 06:34:19 +00:00
FS-8909 #resolve [Add feature to play background video while recording inbound video]
This commit is contained in:
1 parent
3ca6ed4365
commit
b7227465b6
9 files changed
+264
-46
No files matched your search
@@ -1770,6 +1770,23 @@ static switch_status_t av_file_write(switch_file_handle_t *handle, void *data, s
|
||||
return status;
|
||||
}
|
||||
|
||||
static switch_status_t av_file_command(switch_file_handle_t *handle, switch_file_command_t command)
|
||||
{
|
||||
av_file_context_t *context = (av_file_context_t *)handle->private_info;
|
||||
|
||||
switch(command) {
|
||||
case SCFC_FLUSH_AUDIO:
|
||||
switch_mutex_lock(context->mutex);
|
||||
switch_buffer_zero(context->audio_buffer);
|
||||
switch_mutex_unlock(context->mutex);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t av_file_close(switch_file_handle_t *handle)
|
||||
{
|
||||
av_file_context_t *context = (av_file_context_t *)handle->private_info;
|
||||
@@ -1840,9 +1857,8 @@ static switch_status_t av_file_read(switch_file_handle_t *handle, void *data, si
|
||||
}
|
||||
|
||||
switch_mutex_lock(context->mutex);
|
||||
size = switch_buffer_inuse(context->audio_buffer);
|
||||
if (size > *len * context->audio_st.channels * 2) size = *len * context->audio_st.channels * 2;
|
||||
if (size) size = switch_buffer_read(context->audio_buffer, data, size);
|
||||
|
||||
size = switch_buffer_read(context->audio_buffer, data, need);
|
||||
switch_mutex_unlock(context->mutex);
|
||||
|
||||
if (size == 0) {
|
||||
@@ -2174,6 +2190,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_avformat_load)
|
||||
file_interface->file_seek = av_file_seek;
|
||||
file_interface->file_set_string = av_file_set_string;
|
||||
file_interface->file_get_string = av_file_get_string;
|
||||
file_interface->file_command = av_file_command;
|
||||
|
||||
SWITCH_ADD_API(api_interface, "av_format", "av information", av_format_api_function, "");
|
||||
|
||||
|
||||
@@ -1340,6 +1340,23 @@ static switch_status_t vlc_file_av_close(switch_file_handle_t *handle)
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t vlc_file_command(switch_file_handle_t *handle, switch_file_command_t command)
|
||||
{
|
||||
vlc_file_context_t *context = handle->private_info;
|
||||
|
||||
switch(command) {
|
||||
case SCFC_FLUSH_AUDIO:
|
||||
switch_mutex_lock(context->audio_mutex);
|
||||
switch_buffer_zero(context->audio_buffer);
|
||||
switch_mutex_unlock(context->audio_mutex);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
static switch_status_t vlc_file_close(switch_file_handle_t *handle)
|
||||
{
|
||||
vlc_file_context_t *context = handle->private_info;
|
||||
@@ -2608,6 +2625,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_vlc_load)
|
||||
file_interface->extens = vlc_file_supported_formats;
|
||||
file_interface->file_open = vlc_file_open;
|
||||
file_interface->file_close = vlc_file_close;
|
||||
file_interface->file_command = vlc_file_command;
|
||||
file_interface->file_read = vlc_file_read;
|
||||
file_interface->file_write = vlc_file_write;
|
||||
file_interface->file_read_video = vlc_file_read_video;
|
||||
|
||||
Reference in new issue
Block a user