New upstream version 21.0.2+dfsg1
This commit is contained in:
parent
1f1bbb3518
commit
baafb6325b
706 changed files with 49633 additions and 5044 deletions
|
|
@ -18,6 +18,12 @@ extern struct obs_service_info rtmp_common_service;
|
|||
extern struct obs_service_info rtmp_custom_service;
|
||||
|
||||
static update_info_t *update_info = NULL;
|
||||
static struct dstr module_name = {0};
|
||||
|
||||
const char *get_module_name(void)
|
||||
{
|
||||
return module_name.array;
|
||||
}
|
||||
|
||||
static bool confirm_service_file(void *param, struct file_download_data *file)
|
||||
{
|
||||
|
|
@ -40,23 +46,55 @@ static bool confirm_service_file(void *param, struct file_download_data *file)
|
|||
return true;
|
||||
}
|
||||
|
||||
extern void init_twitch_data(void);
|
||||
extern void load_twitch_data(void);
|
||||
extern void unload_twitch_data(void);
|
||||
extern void twitch_ingests_refresh(int seconds);
|
||||
|
||||
static void refresh_callback(void *unused, calldata_t *cd)
|
||||
{
|
||||
int seconds = (int)calldata_int(cd, "seconds");
|
||||
if (seconds <= 0)
|
||||
seconds = 3;
|
||||
if (seconds > 10)
|
||||
seconds = 10;
|
||||
|
||||
twitch_ingests_refresh(seconds);
|
||||
|
||||
UNUSED_PARAMETER(unused);
|
||||
}
|
||||
|
||||
bool obs_module_load(void)
|
||||
{
|
||||
init_twitch_data();
|
||||
|
||||
dstr_copy(&module_name, "rtmp-services plugin (libobs ");
|
||||
dstr_cat(&module_name, obs_get_version_string());
|
||||
dstr_cat(&module_name, ")");
|
||||
|
||||
proc_handler_t *ph = obs_get_proc_handler();
|
||||
proc_handler_add(ph, "void twitch_ingests_refresh(int seconds)",
|
||||
refresh_callback, NULL);
|
||||
|
||||
#if !defined(_WIN32) || CHECK_FOR_SERVICE_UPDATES
|
||||
char *local_dir = obs_module_file("");
|
||||
char *cache_dir = obs_module_config_path("");
|
||||
|
||||
if (cache_dir) {
|
||||
update_info = update_info_create(
|
||||
RTMP_SERVICES_LOG_STR,
|
||||
RTMP_SERVICES_VER_STR,
|
||||
module_name.array,
|
||||
RTMP_SERVICES_URL,
|
||||
local_dir,
|
||||
cache_dir,
|
||||
confirm_service_file, NULL);
|
||||
}
|
||||
|
||||
load_twitch_data();
|
||||
|
||||
bfree(local_dir);
|
||||
bfree(cache_dir);
|
||||
#endif
|
||||
|
||||
obs_register_service(&rtmp_common_service);
|
||||
obs_register_service(&rtmp_custom_service);
|
||||
|
|
@ -66,4 +104,6 @@ bool obs_module_load(void)
|
|||
void obs_module_unload(void)
|
||||
{
|
||||
update_info_destroy(update_info);
|
||||
unload_twitch_data();
|
||||
dstr_free(&module_name);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue