mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-10-30 23:24:18 +00:00
FS-7514 FS-7505: clean up more from yesterday
This commit is contained in:
1 parent
4289a7ec59
commit
a42f40f938
6 files changed
+111
-46
No files matched your search
@@ -1580,7 +1580,7 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
|
||||
switch_frame_t write_frame = { 0 };
|
||||
uint8_t *packet = NULL;
|
||||
layout_group_t *lg = NULL;
|
||||
switch_image_t *write_img = NULL, *free_img = NULL;
|
||||
switch_image_t *write_img = NULL, *file_img = NULL;
|
||||
|
||||
#ifdef TRACK_FPS
|
||||
uint64_t frames = 0;
|
||||
@@ -1617,8 +1617,10 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
|
||||
switch_core_timer_init(&conference->canvas->timer, "soft", conference->video_fps.ms, conference->video_fps.samples, NULL);
|
||||
need_reset = SWITCH_TRUE;
|
||||
}
|
||||
|
||||
switch_core_timer_next(&conference->canvas->timer);
|
||||
|
||||
if (!conference->record_fh) {
|
||||
switch_core_timer_next(&conference->canvas->timer);
|
||||
}
|
||||
|
||||
now = switch_micro_time_now();
|
||||
|
||||
@@ -1635,7 +1637,7 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
|
||||
continue;
|
||||
}
|
||||
|
||||
if (switch_test_flag(imember, MFLAG_NO_MINIMIZE_ENCODING)) {
|
||||
if (!switch_test_flag(imember, MFLAG_NO_MINIMIZE_ENCODING)) {
|
||||
min_members++;
|
||||
}
|
||||
|
||||
@@ -1844,8 +1846,11 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
|
||||
|
||||
if (conference->fnode) {
|
||||
if (switch_core_file_read_video(&conference->fnode->fh, &write_frame) == SWITCH_STATUS_SUCCESS) {
|
||||
write_img = free_img = write_frame.img;
|
||||
switch_img_free(&file_img);
|
||||
write_img = file_img = write_frame.img;
|
||||
}
|
||||
} else if (file_img) {
|
||||
switch_img_free(&file_img);
|
||||
}
|
||||
|
||||
if (conference->record_fh) {
|
||||
@@ -1894,10 +1899,9 @@ static void *SWITCH_THREAD_FUNC conference_video_muxing_thread_run(switch_thread
|
||||
switch_core_session_rwunlock(imember->session);
|
||||
}
|
||||
}
|
||||
|
||||
switch_mutex_unlock(conference->member_mutex);
|
||||
|
||||
|
||||
switch_img_free(&free_img);
|
||||
}
|
||||
|
||||
for (i = 0; i < MCU_MAX_LAYERS; i++) {
|
||||
|
||||
@@ -283,6 +283,12 @@ static void vlc_video_av_unlock_callback(void *data, void *id, void *const *p_pi
|
||||
{
|
||||
vlc_video_context_t *context = (vlc_video_context_t *) data;
|
||||
|
||||
if (context->img) {
|
||||
if (context->img->d_w != context->width || context->img->d_h != context->height) {
|
||||
switch_img_free(&context->img);
|
||||
}
|
||||
}
|
||||
|
||||
if (!context->img) context->img = switch_img_alloc(NULL, SWITCH_IMG_FMT_I420, context->width, context->height, 0);
|
||||
|
||||
switch_assert(context->img);
|
||||
@@ -344,10 +350,13 @@ static void vlc_video_display_callback(void *data, void *id)
|
||||
vlc_video_context_t *context = (vlc_video_context_t *) data;
|
||||
|
||||
if (context->channel && !switch_channel_test_flag(context->channel, CF_VIDEO)) return;
|
||||
if (!context->img) return;
|
||||
|
||||
if (context->video_queue) {
|
||||
switch_queue_push(context->video_queue, context->img);
|
||||
context->img = NULL;
|
||||
switch_image_t *img_copy = NULL;
|
||||
switch_img_copy(context->img, &img_copy);
|
||||
switch_queue_push(context->video_queue, img_copy);
|
||||
|
||||
} else {
|
||||
context->vid_frame->img = context->img;
|
||||
context->vid_frame->packet = context->video_packet;
|
||||
@@ -650,12 +659,21 @@ static switch_status_t vlc_file_open(switch_file_handle_t *handle, const char *p
|
||||
{
|
||||
vlc_file_context_t *context;
|
||||
libvlc_event_manager_t *mp_event_manager, *m_event_manager;
|
||||
|
||||
char *ext = NULL;
|
||||
|
||||
context = switch_core_alloc(handle->memory_pool, sizeof(*context));
|
||||
context->pool = handle->memory_pool;
|
||||
context->path = switch_core_strdup(context->pool, path);
|
||||
context->vlc_handle = libvlc_new(sizeof(vlc_args)/sizeof(char *), vlc_args);
|
||||
|
||||
|
||||
if (switch_test_flag(handle, SWITCH_FILE_FLAG_VIDEO) && switch_test_flag(handle, SWITCH_FILE_FLAG_WRITE) &&
|
||||
(ext = strrchr(path, '.')) && !strcasecmp(ext, ".mp4")) {
|
||||
path = switch_core_sprintf(context->pool, "#transcode{vcodec=h264,acodec=mp3}:std{access=file,mux=mp4,dst=%s}", path);
|
||||
}
|
||||
|
||||
context->path = switch_core_strdup(context->pool, path);
|
||||
|
||||
|
||||
if (!switch_test_flag(handle, SWITCH_FILE_FLAG_VIDEO)) {
|
||||
switch_buffer_create_dynamic(&(context->audio_buffer), VLC_BUFFER_SIZE, VLC_BUFFER_SIZE * 8, 0);
|
||||
switch_mutex_init(&context->audio_mutex, SWITCH_MUTEX_NESTED, context->pool);
|
||||
@@ -2202,8 +2220,9 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_vlc_load)
|
||||
|
||||
/* connect my internal structure to the blank pointer passed to me */
|
||||
*module_interface = switch_loadable_module_create_module_interface(pool, modname);
|
||||
|
||||
|
||||
vlc_file_supported_formats[0] = "vlc";
|
||||
vlc_file_supported_formats[1] = "mp4"; /* maybe add config for this mod to enable or disable */
|
||||
|
||||
file_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_FILE_INTERFACE);
|
||||
file_interface->interface_name = modname;
|
||||
|
||||
Reference in new issue
Block a user