static void ffmpeg_source_defaults(obs_data_t *settings) { obs_data_set_default_bool(settings, "is_local_file", true); obs_data_set_default_bool(settings, "looping", false); obs_data_set_default_bool(settings, "clear_on_media_end", true); obs_data_set_default_bool(settings, "restart_on_activate", true); obs_data_set_default_bool(settings, "force_scale", true); #if defined(_WIN32) || defined(__APPLE__) obs_data_set_default_bool(settings, "hw_decode", true); #endif }
/** * Get the default settings for the capture */ static void xshm_defaults(obs_data_t defaults) { obs_data_set_default_int(defaults, "screen", 0); obs_data_set_default_bool(defaults, "show_cursor", true); }
static void crop_filter_defaults(obs_data_t *settings) { obs_data_set_default_bool(settings, "relative", true); }
void OBSProjector::UpdateMultiview() { multiviewScenes.clear(); multiviewLabels.clear(); struct obs_video_info ovi; obs_get_video_info(&ovi); uint32_t w = ovi.base_width; uint32_t h = ovi.base_height; fw = float(w); fh = float(h); ratio = fw / fh; struct obs_frontend_source_list scenes = {}; obs_frontend_get_scenes(&scenes); multiviewLabels.emplace_back(CreateLabel(Str("StudioMode.Preview"), h / 2)); multiviewLabels.emplace_back(CreateLabel(Str("StudioMode.Program"), h / 2)); multiviewLayout = static_cast<MultiviewLayout>(config_get_int( GetGlobalConfig(), "BasicWindow", "MultiviewLayout")); drawLabel = config_get_bool(GetGlobalConfig(), "BasicWindow", "MultiviewDrawNames"); drawSafeArea = config_get_bool(GetGlobalConfig(), "BasicWindow", "MultiviewDrawAreas"); mouseSwitching = config_get_bool(GetGlobalConfig(), "BasicWindow", "MultiviewMouseSwitch"); transitionOnDoubleClick = config_get_bool(GetGlobalConfig(), "BasicWindow", "TransitionOnDoubleClick"); switch(multiviewLayout) { case MultiviewLayout::HORIZONTAL_TOP_24_SCENES: pvwprgCX = fw / 3; pvwprgCY = fh / 3; maxSrcs = 24; break; default: pvwprgCX = fw / 2; pvwprgCY = fh / 2; maxSrcs = 8; } ppiCX = pvwprgCX - thicknessx2; ppiCY = pvwprgCY - thicknessx2; ppiScaleX = (pvwprgCX - thicknessx2) / fw; ppiScaleY = (pvwprgCY - thicknessx2) / fh; scenesCX = pvwprgCX / 2; scenesCY = pvwprgCY / 2; siCX = scenesCX - thicknessx2; siCY = scenesCY - thicknessx2; siScaleX = (scenesCX - thicknessx2) / fw; siScaleY = (scenesCY - thicknessx2) / fh; numSrcs = 0; size_t i = 0; while (i < scenes.sources.num && numSrcs < maxSrcs) { obs_source_t *src = scenes.sources.array[i++]; OBSData data = obs_source_get_private_settings(src); obs_data_release(data); obs_data_set_default_bool(data, "show_in_multiview", true); if (!obs_data_get_bool(data, "show_in_multiview")) continue; // We have a displayable source. numSrcs++; multiviewScenes.emplace_back(OBSGetWeakRef(src)); obs_source_inc_showing(src); std::string name = std::to_string(numSrcs) + " - " + obs_source_get_name(src); multiviewLabels.emplace_back(CreateLabel(name.c_str(), h / 3)); } obs_frontend_source_list_free(&scenes); }
static void scale_filter_defaults(obs_data_t *settings) { obs_data_set_default_string(settings, S_SAMPLING, S_SAMPLING_BICUBIC); obs_data_set_default_string(settings, S_RESOLUTION, T_NONE); obs_data_set_default_bool(settings, S_UNDISTORT, 0); }
static void monitor_capture_defaults(obs_data_t settings) { obs_data_set_default_int(settings, "monitor", 0); obs_data_set_default_bool(settings, "capture_cursor", true); obs_data_set_default_bool(settings, "compatibility", false); }
static void image_source_defaults(obs_data_t *settings) { obs_data_set_default_bool(settings, "unload", false); }
static void libfdk_defaults(obs_data_t settings) { obs_data_set_default_int(settings, "bitrate", 128); obs_data_set_default_bool(settings, "afterburner", true); }
static void decklink_get_defaults(obs_data_t *settings) { obs_data_set_default_bool(settings, BUFFERING, true); obs_data_set_default_int(settings, PIXEL_FORMAT, bmdFormat8BitYUV); obs_data_set_default_int(settings, CHANNEL_FORMAT, SPEAKERS_STEREO); }
static void duplicator_capture_defaults(obs_data_t *settings) { obs_data_set_default_int(settings, "monitor", 0); obs_data_set_default_bool(settings, "capture_cursor", true); }