bool obs_reset_video(struct obs_video_info *ovi) { if (!obs) return false; /* don't allow changing of video settings if active. */ if (obs->video.video && video_output_active(obs->video.video)) return false; struct obs_core_video *video = &obs->video; /* align to multiple-of-two and SSE alignment sizes */ ovi->output_width &= 0xFFFFFFFC; ovi->output_height &= 0xFFFFFFFE; stop_video(); obs_free_video(); if (!ovi) { obs_free_graphics(); return true; } if (!video->graphics && !obs_init_graphics(ovi)) return false; return obs_init_video(ovi); }
void obs_shutdown(void) { if (!obs) return; da_free(obs->input_types); da_free(obs->filter_types); da_free(obs->encoder_types); da_free(obs->transition_types); da_free(obs->output_types); da_free(obs->service_types); da_free(obs->modal_ui_callbacks); da_free(obs->modeless_ui_callbacks); stop_video(); obs_free_data(); obs_free_video(); obs_free_graphics(); obs_free_audio(); proc_handler_destroy(obs->procs); signal_handler_destroy(obs->signals); for (size_t i = 0; i < obs->modules.num; i++) free_module(obs->modules.array+i); da_free(obs->modules); bfree(obs->locale); bfree(obs); obs = NULL; }
void obs_shutdown(void) { size_t i; if (!obs) return; da_free(obs->input_types); da_free(obs->filter_types); da_free(obs->transition_types); da_free(obs->output_types); da_free(obs->service_types); obs_free_data(); obs_free_video(); obs_free_graphics(); obs_free_audio(); media_close(obs->media); proc_handler_destroy(obs->procs); signal_handler_destroy(obs->signals); for (i = 0; i < obs->modules.num; i++) free_module(obs->modules.array+i); da_free(obs->modules); bfree(obs); obs = NULL; }
int obs_reset_video(struct obs_video_info *ovi) { if (!obs) return OBS_VIDEO_FAIL; /* don't allow changing of video settings if active. */ if (obs->video.video && video_output_active(obs->video.video)) return OBS_VIDEO_CURRENTLY_ACTIVE; if (!size_valid(ovi->output_width, ovi->output_height) || !size_valid(ovi->base_width, ovi->base_height)) return OBS_VIDEO_INVALID_PARAM; struct obs_core_video *video = &obs->video; stop_video(); obs_free_video(); if (!ovi) { obs_free_graphics(); return OBS_VIDEO_SUCCESS; } /* align to multiple-of-two and SSE alignment sizes */ ovi->output_width &= 0xFFFFFFFC; ovi->output_height &= 0xFFFFFFFE; if (!video->graphics) { int errorcode = obs_init_graphics(ovi); if (errorcode != OBS_VIDEO_SUCCESS) { obs_free_graphics(); return errorcode; } } blog(LOG_INFO, "video settings reset:\n" "\tbase resolution: %dx%d\n" "\toutput resolution: %dx%d\n" "\tfps: %d/%d", ovi->base_width, ovi->base_height, ovi->output_width, ovi->output_height, ovi->fps_num, ovi->fps_den); return obs_init_video(ovi); }
bool obs_reset_video(struct obs_video_info *ovi) { struct obs_video *video = &obs->video; obs_free_video(); if (!ovi) { obs_free_graphics(); return true; } if (!video->graphics && !obs_init_graphics(ovi)) return false; return obs_init_video(ovi); }
void obs_shutdown(void) { struct obs_module *module; if (!obs) return; da_free(obs->input_types); da_free(obs->filter_types); da_free(obs->encoder_types); da_free(obs->transition_types); da_free(obs->output_types); da_free(obs->service_types); da_free(obs->modal_ui_callbacks); da_free(obs->modeless_ui_callbacks); stop_video(); obs_free_data(); obs_free_video(); obs_free_graphics(); obs_free_audio(); proc_handler_destroy(obs->procs); signal_handler_destroy(obs->signals); module = obs->first_module; while (module) { struct obs_module *next = module->next; free_module(module); module = next; } obs->first_module = NULL; for (size_t i = 0; i < obs->module_paths.num; i++) free_module_path(obs->module_paths.array+i); da_free(obs->module_paths); bfree(obs->locale); bfree(obs); obs = NULL; }