New upstream version 24.0.1+dfsg1
This commit is contained in:
parent
b14f9eae6d
commit
5a730d6ec3
842 changed files with 42245 additions and 33385 deletions
9
plugins/rtmp-services/data/locale/bg-BG.ini
Normal file
9
plugins/rtmp-services/data/locale/bg-BG.ini
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
Service="Услуга"
|
||||
Server="Сървър"
|
||||
Server.Auto="Автоматично (препоръчва се)"
|
||||
StreamKey="Ключ за поточно излъчване"
|
||||
UseAuth="Използване на удостоверение"
|
||||
Username="Потребителско име"
|
||||
Password="Парола"
|
||||
ShowAll="Показване на всички услуги"
|
||||
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
StreamingServices="Streaming-Plattformen"
|
||||
StreamingServices="Streaming‐Plattformen"
|
||||
CustomStreamingServer="Benutzerdefinierter Streamingserver"
|
||||
Service="Plattform"
|
||||
Server="Server"
|
||||
|
|
|
|||
11
plugins/rtmp-services/data/locale/fa-IR.ini
Normal file
11
plugins/rtmp-services/data/locale/fa-IR.ini
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
StreamingServices="سرویس پخش زنده"
|
||||
CustomStreamingServer="سرویس پخش زنده جریانی"
|
||||
Service="سرویس"
|
||||
Server="سرور"
|
||||
Server.Auto="خودکار (پیشنهاد شده)"
|
||||
StreamKey="کلید پخش زنده"
|
||||
UseAuth="استفاده از تایید اعتبار"
|
||||
Username="نام کاربری"
|
||||
Password="رمزعبور"
|
||||
ShowAll="همه سرویس ها را نمایش بده"
|
||||
|
||||
|
|
@ -1,8 +1,9 @@
|
|||
StreamingServices="Servizos de retransmisión"
|
||||
CustomStreamingServer="Presonalizar o servidor de retranmisión"
|
||||
StreamingServices="Servizos de emisións"
|
||||
CustomStreamingServer="Personalizar o servidor de emisións"
|
||||
Service="Servizo"
|
||||
Server="Servidor"
|
||||
StreamKey="Chave de retransmisión"
|
||||
Server.Auto="Automático (recomendado)"
|
||||
StreamKey="Clave da emisión"
|
||||
UseAuth="Usar a autenticación"
|
||||
Username="Nome de usuario"
|
||||
Password="Contrasinal"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,11 @@
|
|||
StreamingServices="Storitev oddajanja"
|
||||
CustomStreamingServer="Streming Server po želji"
|
||||
StreamingServices="Storitve pretakanja"
|
||||
CustomStreamingServer="Strežnik pretakanja po meri"
|
||||
Service="Storitev"
|
||||
Server="Strežnik"
|
||||
Server.Auto="Samodejno (priporočeno)"
|
||||
StreamKey="Ključ pretoka"
|
||||
UseAuth="Uporabi overitev"
|
||||
Username="Uporabniško ime"
|
||||
Password="Geslo"
|
||||
ShowAll="Prikaži vse storitve"
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
{
|
||||
"url": "https://obsproject.com/obs2_update/rtmp-services",
|
||||
"version": 107,
|
||||
"version": 112,
|
||||
"files": [
|
||||
{
|
||||
"name": "services.json",
|
||||
"version": 107
|
||||
"version": 112
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,6 +69,10 @@
|
|||
"name": "EU: Milan, Italy",
|
||||
"url": "rtmp://live-mil.twitch.tv/app"
|
||||
},
|
||||
{
|
||||
"name": "EU: Norway, Oslo",
|
||||
"url": "rtmp://live-osl.twitch.tv/app"
|
||||
},
|
||||
{
|
||||
"name": "EU: Paris, FR",
|
||||
"url": "rtmp://live-cdg.twitch.tv/app"
|
||||
|
|
@ -214,7 +218,6 @@
|
|||
},
|
||||
{
|
||||
"name": "Smashcast",
|
||||
"common": true,
|
||||
"servers": [
|
||||
{
|
||||
"name": "Default",
|
||||
|
|
@ -461,21 +464,6 @@
|
|||
"max audio bitrate": 160
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "GamePlank",
|
||||
"servers": [
|
||||
{
|
||||
"name": "Primary",
|
||||
"url": "rtmp://live.gameplank.tv/go"
|
||||
}
|
||||
],
|
||||
"recommended": {
|
||||
"keyint": 1,
|
||||
"profile": "main",
|
||||
"max video bitrate": 2500,
|
||||
"max audio bitrate": 160
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Web.TV",
|
||||
"servers": [
|
||||
|
|
@ -573,21 +561,6 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "DJlive.pl",
|
||||
"servers": [
|
||||
{
|
||||
"name": "Default",
|
||||
"url": "rtmp://live.djlive.pl/live"
|
||||
}
|
||||
],
|
||||
"recommended": {
|
||||
"keyint": 1,
|
||||
"profile": "high",
|
||||
"max video bitrate": 1300,
|
||||
"max audio bitrate": 320
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Facebook Live",
|
||||
"common": true,
|
||||
|
|
@ -617,63 +590,83 @@
|
|||
},
|
||||
{
|
||||
"name": "EU-West (London, GB)",
|
||||
"url": "rtmp://eu-london.restream.io/live"
|
||||
"url": "rtmp://london.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "EU-West (Amsterdam, NL)",
|
||||
"url": "rtmp://eu-ams.restream.io/live"
|
||||
"url": "rtmp://amsterdam.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "EU-West (Luxembourg)",
|
||||
"url": "rtmp://eu-luxembourg.restream.io/live"
|
||||
"url": "rtmp://luxembourg.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "EU-West (Paris, FR)",
|
||||
"url": "rtmp://eu-paris.restream.io/live"
|
||||
"url": "rtmp://paris.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "EU-West (Milan, IT)",
|
||||
"url": "rtmp://milan.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "EU-Central (Frankfurt, DE)",
|
||||
"url": "rtmp://eu-central.restream.io/live"
|
||||
"url": "rtmp://frankfurt.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "EU-East (Falkenstein, DE)",
|
||||
"url": "rtmp://eu-east.restream.io/live"
|
||||
"url": "rtmp://falkenstein.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "EU-South (Madrid, Spain)",
|
||||
"url": "rtmp://eu-madrid.restream.io/live"
|
||||
"url": "rtmp://madrid.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "Russia (Moscow)",
|
||||
"url": "rtmp://ru.restream.io/live"
|
||||
"url": "rtmp://moscow.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "Turkey (Istanbul)",
|
||||
"url": "rtmp://istanbul.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "Israel (Tel Aviv)",
|
||||
"url": "rtmp://telaviv.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "US-West (Seattle, WA)",
|
||||
"url": "rtmp://us-seattle.restream.io/live"
|
||||
"url": "rtmp://seattle.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "US-West (San Jose, CA)",
|
||||
"url": "rtmp://us-west.restream.io/live"
|
||||
"url": "rtmp://sanjose.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "US-Central (Dallas, TX)",
|
||||
"url": "rtmp://us-central.restream.io/live"
|
||||
"url": "rtmp://dallas.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "US-East (Washington, DC)",
|
||||
"url": "rtmp://us-east.restream.io/live"
|
||||
"url": "rtmp://washington.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "US-East (Miami, FL)",
|
||||
"url": "rtmp://us-miami.restream.io/live"
|
||||
"url": "rtmp://miami.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "US-East (Chicago, IL)",
|
||||
"url": "rtmp://chicago.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "NA-East (Toronto, Canada)",
|
||||
"url": "rtmp://na-toronto.restream.io/live"
|
||||
"url": "rtmp://toronto.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "SA (Saint Paul, Brazil)",
|
||||
"url": "rtmp://sa.restream.io/live"
|
||||
"url": "rtmp://saopaulo.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "India (Bangalore)",
|
||||
"url": "rtmp://bangalore.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "Asia (Singapore)",
|
||||
|
|
@ -687,13 +680,9 @@
|
|||
"name": "Asia (Tokyo, Japan)",
|
||||
"url": "rtmp://tokyo.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "India (Bangalore)",
|
||||
"url": "rtmp://india.restream.io/live"
|
||||
},
|
||||
{
|
||||
"name": "Australia (Sydney)",
|
||||
"url": "rtmp://au.restream.io/live"
|
||||
"url": "rtmp://sydney.restream.io/live"
|
||||
}
|
||||
],
|
||||
"recommended": {
|
||||
|
|
@ -710,63 +699,83 @@
|
|||
},
|
||||
{
|
||||
"name": "EU-West (London, GB)",
|
||||
"url": "eu-london.restream.io"
|
||||
"url": "london.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "EU-West (Amsterdam, NL)",
|
||||
"url": "eu-ams.restream.io"
|
||||
"url": "amsterdam.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "EU-West (Luxembourg)",
|
||||
"url": "eu-luxembourg.restream.io"
|
||||
"url": "luxembourg.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "EU-West (Paris, FR)",
|
||||
"url": "eu-paris.restream.io"
|
||||
"url": "paris.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "EU-West (Milan, IT)",
|
||||
"url": "milan.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "EU-Central (Frankfurt, DE)",
|
||||
"url": "eu-central.restream.io"
|
||||
"url": "frankfurt.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "EU-East (Falkenstein, DE)",
|
||||
"url": "eu-east.restream.io"
|
||||
"url": "falkenstein.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "EU-South (Madrid, Spain)",
|
||||
"url": "eu-madrid.restream.io"
|
||||
"url": "madrid.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "Russia (Moscow)",
|
||||
"url": "ru.restream.io"
|
||||
"url": "moscow.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "Turkey (Istanbul)",
|
||||
"url": "istanbul.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "Israel (Tel Aviv)",
|
||||
"url": "telaviv.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "US-West (Seattle, WA)",
|
||||
"url": "us-seattle.restream.io"
|
||||
"url": "seattle.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "US-West (San Jose, CA)",
|
||||
"url": "us-west.restream.io"
|
||||
"url": "sanjose.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "US-Central (Dallas, TX)",
|
||||
"url": "us-central.restream.io"
|
||||
"url": "dallas.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "US-East (Washington, DC)",
|
||||
"url": "us-east.restream.io"
|
||||
"url": "washington.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "US-East (Miami, FL)",
|
||||
"url": "us-miami.restream.io"
|
||||
"url": "miami.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "US-East (Chicago, IL)",
|
||||
"url": "chicago.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "NA-East (Toronto, Canada)",
|
||||
"url": "na-toronto.restream.io"
|
||||
"url": "toronto.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "SA (Saint Paul, Brazil)",
|
||||
"url": "sa.restream.io"
|
||||
"url": "saopaulo.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "India (Bangalore)",
|
||||
"url": "bangalore.restream.io"
|
||||
},
|
||||
{
|
||||
"name": "Asia (Singapore)",
|
||||
|
|
@ -782,7 +791,7 @@
|
|||
},
|
||||
{
|
||||
"name": "Australia (Sydney)",
|
||||
"url": "au.restream.io"
|
||||
"url": "sydney.restream.io"
|
||||
}
|
||||
],
|
||||
"recommended": {
|
||||
|
|
@ -798,8 +807,12 @@
|
|||
"name": "GameTips.TV",
|
||||
"servers": [
|
||||
{
|
||||
"name": "Server Iran",
|
||||
"name": "Iran - Rasht",
|
||||
"url": "rtmp://rtmp.cdn.server1.gametips.tv:1935/hls"
|
||||
},
|
||||
{
|
||||
"name": "Germany - Falkenstein/Vogtland",
|
||||
"url": "rtmp://rtmp.cdn.server2.gametips.tv:1935/hls"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -1083,6 +1096,23 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Stripchat",
|
||||
"servers": [
|
||||
{
|
||||
"name": "Auto",
|
||||
"url": "rtmp://s-sd.stripcdn.com/ext"
|
||||
}
|
||||
],
|
||||
"recommended": {
|
||||
"keyint": 2,
|
||||
"profile": "main",
|
||||
"bframes": 0,
|
||||
"max video bitrate": 6000,
|
||||
"max audio bitrate": 128,
|
||||
"x264opts": "tune=zerolatency"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Chaturbate",
|
||||
"servers": [
|
||||
|
|
@ -1230,10 +1260,6 @@
|
|||
{
|
||||
"name": "Australia East",
|
||||
"url": "rtmp://ingest-au-east.a.switchboard.zone/live"
|
||||
},
|
||||
{
|
||||
"name": "Asia Central",
|
||||
"url": "rtmp://ingest-as-central.a.switchboard.zone/live"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
|
@ -1253,38 +1279,6 @@
|
|||
"max audio bitrate": 160
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Stream.me",
|
||||
"common": false,
|
||||
"servers": [
|
||||
{
|
||||
"name": "US, Central",
|
||||
"url": "rtmp://uc-origin.stream.me/origin"
|
||||
},
|
||||
{
|
||||
"name": "US, East",
|
||||
"url": "rtmp://ue-origin.stream.me/origin"
|
||||
},
|
||||
{
|
||||
"name": "US, West",
|
||||
"url": "rtmp://uw-origin.stream.me/origin"
|
||||
},
|
||||
{
|
||||
"name": "Europe, West",
|
||||
"url": "rtmp://ew-origin.stream.me/origin"
|
||||
},
|
||||
{
|
||||
"name": "Asia, East",
|
||||
"url": "rtmp://ae-origin.stream.me/origin"
|
||||
}
|
||||
],
|
||||
"recommended": {
|
||||
"keyint": 2,
|
||||
"profile": "main",
|
||||
"max video bitrate": 20000,
|
||||
"max audio bitrate": 192
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Eventials",
|
||||
"servers": [
|
||||
|
|
@ -1505,6 +1499,66 @@
|
|||
"bframes": 0,
|
||||
"x264opts": "tune=zerolatency"
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Steam",
|
||||
"common": false,
|
||||
"servers": [
|
||||
{
|
||||
"name": "Chicago, US",
|
||||
"url": "rtmp://ingest-any-ord1.broadcast.steamcontent.com/app"
|
||||
},
|
||||
{
|
||||
"name": "Seattle, US",
|
||||
"url": "rtmp://ingest-any-sea1.broadcast.steamcontent.com/app"
|
||||
},
|
||||
{
|
||||
"name": "Los Angeles, US",
|
||||
"url": "rtmp://ingest-any-lax1.broadcast.steamcontent.com/app"
|
||||
},
|
||||
{
|
||||
"name": "Washington DC, US",
|
||||
"url": "rtmp://ingest-any-iad1.broadcast.steamcontent.com/app"
|
||||
},
|
||||
{
|
||||
"name": "Frankfurt, DE",
|
||||
"url": "rtmp://ingest-any-fra1.broadcast.steamcontent.com/app"
|
||||
},
|
||||
{
|
||||
"name": "London, UK",
|
||||
"url": "rtmp://ingest-any-lhr1.broadcast.steamcontent.com/app"
|
||||
},
|
||||
{
|
||||
"name": "Stockholm, SE",
|
||||
"url": "rtmp://ingest-any-sto1.broadcast.steamcontent.com/app"
|
||||
},
|
||||
{
|
||||
"name": "Tokyo, JP",
|
||||
"url": "rtmp://ingest-any-tyo1.broadcast.steamcontent.com/app"
|
||||
},
|
||||
{
|
||||
"name": "Hong Kong, HK",
|
||||
"url": "rtmp://ingest-any-hkg1.broadcast.steamcontent.com/app"
|
||||
},
|
||||
{
|
||||
"name": "Singapore, SG",
|
||||
"url": "rtmp://ingest-any-sgp1.broadcast.steamcontent.com/app"
|
||||
},
|
||||
{
|
||||
"name": "Sydney, AU",
|
||||
"url": "rtmp://ingest-any-syd1.broadcast.steamcontent.com/app"
|
||||
},
|
||||
{
|
||||
"name": "São Paulo, BR",
|
||||
"url": "rtmp://ingest-any-gru1.broadcast.steamcontent.com/app"
|
||||
}
|
||||
],
|
||||
"recommended": {
|
||||
"keyint": 2,
|
||||
"profile": "high",
|
||||
"max video bitrate": 7000,
|
||||
"max audio bitrate": 128
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,13 +22,13 @@ static const char *rtmp_common_getname(void *unused)
|
|||
|
||||
static json_t *open_services_file(void);
|
||||
static inline json_t *find_service(json_t *root, const char *name,
|
||||
const char **p_new_name);
|
||||
const char **p_new_name);
|
||||
static inline const char *get_string_val(json_t *service, const char *key);
|
||||
|
||||
extern void twitch_ingests_refresh(int seconds);
|
||||
|
||||
static void ensure_valid_url(struct rtmp_common *service, json_t *json,
|
||||
obs_data_t *settings)
|
||||
obs_data_t *settings)
|
||||
{
|
||||
json_t *servers = json_object_get(json, "servers");
|
||||
const char *top_url = NULL;
|
||||
|
|
@ -70,9 +70,9 @@ static void rtmp_common_update(void *data, obs_data_t *settings)
|
|||
bfree(service->key);
|
||||
|
||||
service->service = bstrdup(obs_data_get_string(settings, "service"));
|
||||
service->server = bstrdup(obs_data_get_string(settings, "server"));
|
||||
service->key = bstrdup(obs_data_get_string(settings, "key"));
|
||||
service->output = NULL;
|
||||
service->server = bstrdup(obs_data_get_string(settings, "server"));
|
||||
service->key = bstrdup(obs_data_get_string(settings, "key"));
|
||||
service->output = NULL;
|
||||
|
||||
json_t *root = open_services_file();
|
||||
if (root) {
|
||||
|
|
@ -86,7 +86,7 @@ static void rtmp_common_update(void *data, obs_data_t *settings)
|
|||
|
||||
if (serv) {
|
||||
json_t *rec = json_object_get(serv, "recommended");
|
||||
if (rec && json_is_object(rec)) {
|
||||
if (json_is_object(rec)) {
|
||||
const char *out = get_string_val(rec, "output");
|
||||
if (out)
|
||||
service->output = bstrdup(out);
|
||||
|
|
@ -149,7 +149,7 @@ static inline bool get_bool_val(json_t *service, const char *key)
|
|||
}
|
||||
|
||||
static void add_service(obs_property_t *list, json_t *service, bool show_all,
|
||||
const char *cur_service)
|
||||
const char *cur_service)
|
||||
{
|
||||
json_t *servers;
|
||||
const char *name;
|
||||
|
|
@ -157,14 +157,14 @@ static void add_service(obs_property_t *list, json_t *service, bool show_all,
|
|||
|
||||
if (!json_is_object(service)) {
|
||||
blog(LOG_WARNING, "rtmp-common.c: [add_service] service "
|
||||
"is not an object");
|
||||
"is not an object");
|
||||
return;
|
||||
}
|
||||
|
||||
name = get_string_val(service, "name");
|
||||
if (!name) {
|
||||
blog(LOG_WARNING, "rtmp-common.c: [add_service] service "
|
||||
"has no name");
|
||||
"has no name");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -175,8 +175,10 @@ static void add_service(obs_property_t *list, json_t *service, bool show_all,
|
|||
|
||||
servers = json_object_get(service, "servers");
|
||||
if (!servers || !json_is_array(servers)) {
|
||||
blog(LOG_WARNING, "rtmp-common.c: [add_service] service "
|
||||
"'%s' has no servers", name);
|
||||
blog(LOG_WARNING,
|
||||
"rtmp-common.c: [add_service] service "
|
||||
"'%s' has no servers",
|
||||
name);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -184,14 +186,14 @@ static void add_service(obs_property_t *list, json_t *service, bool show_all,
|
|||
}
|
||||
|
||||
static void add_services(obs_property_t *list, json_t *root, bool show_all,
|
||||
const char *cur_service)
|
||||
const char *cur_service)
|
||||
{
|
||||
json_t *service;
|
||||
size_t index;
|
||||
|
||||
if (!json_is_array(root)) {
|
||||
blog(LOG_WARNING, "rtmp-common.c: [add_services] JSON file "
|
||||
"root is not an array");
|
||||
"root is not an array");
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -202,18 +204,18 @@ static void add_services(obs_property_t *list, json_t *root, bool show_all,
|
|||
service = find_service(root, cur_service, NULL);
|
||||
if (!service && cur_service && *cur_service) {
|
||||
obs_property_list_insert_string(list, 0, cur_service,
|
||||
cur_service);
|
||||
cur_service);
|
||||
obs_property_list_item_disable(list, 0, true);
|
||||
}
|
||||
}
|
||||
|
||||
static json_t *open_json_file(const char *file)
|
||||
{
|
||||
char *file_data = os_quick_read_utf8_file(file);
|
||||
char *file_data = os_quick_read_utf8_file(file);
|
||||
json_error_t error;
|
||||
json_t *root;
|
||||
json_t *list;
|
||||
int format_ver;
|
||||
json_t *root;
|
||||
json_t *list;
|
||||
int format_ver;
|
||||
|
||||
if (!file_data)
|
||||
return NULL;
|
||||
|
|
@ -222,18 +224,20 @@ static json_t *open_json_file(const char *file)
|
|||
bfree(file_data);
|
||||
|
||||
if (!root) {
|
||||
blog(LOG_WARNING, "rtmp-common.c: [open_json_file] "
|
||||
"Error reading JSON file (%d): %s",
|
||||
error.line, error.text);
|
||||
blog(LOG_WARNING,
|
||||
"rtmp-common.c: [open_json_file] "
|
||||
"Error reading JSON file (%d): %s",
|
||||
error.line, error.text);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
format_ver = get_int_val(root, "format_version");
|
||||
|
||||
if (format_ver != RTMP_SERVICES_FORMAT_VERSION) {
|
||||
blog(LOG_DEBUG, "rtmp-common.c: [open_json_file] "
|
||||
"Wrong format version (%d), expected %d",
|
||||
format_ver, RTMP_SERVICES_FORMAT_VERSION);
|
||||
blog(LOG_DEBUG,
|
||||
"rtmp-common.c: [open_json_file] "
|
||||
"Wrong format version (%d), expected %d",
|
||||
format_ver, RTMP_SERVICES_FORMAT_VERSION);
|
||||
json_decref(root);
|
||||
return NULL;
|
||||
}
|
||||
|
|
@ -245,7 +249,7 @@ static json_t *open_json_file(const char *file)
|
|||
|
||||
if (!list) {
|
||||
blog(LOG_WARNING, "rtmp-common.c: [open_json_file] "
|
||||
"No services list");
|
||||
"No services list");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
@ -275,7 +279,7 @@ static json_t *open_services_file(void)
|
|||
}
|
||||
|
||||
static void build_service_list(obs_property_t *list, json_t *root,
|
||||
bool show_all, const char *cur_service)
|
||||
bool show_all, const char *cur_service)
|
||||
{
|
||||
obs_property_list_clear(list);
|
||||
add_services(list, root, show_all, cur_service);
|
||||
|
|
@ -293,7 +297,7 @@ static bool fill_twitch_servers_locked(obs_property_t *servers_prop)
|
|||
size_t count = twitch_ingest_count();
|
||||
|
||||
obs_property_list_add_string(servers_prop,
|
||||
obs_module_text("Server.Auto"), "auto");
|
||||
obs_module_text("Server.Auto"), "auto");
|
||||
|
||||
if (count <= 1)
|
||||
return false;
|
||||
|
|
@ -318,7 +322,7 @@ static inline bool fill_twitch_servers(obs_property_t *servers_prop)
|
|||
}
|
||||
|
||||
static void fill_servers(obs_property_t *servers_prop, json_t *service,
|
||||
const char *name)
|
||||
const char *name)
|
||||
{
|
||||
json_t *servers, *server;
|
||||
size_t index;
|
||||
|
|
@ -328,15 +332,16 @@ static void fill_servers(obs_property_t *servers_prop, json_t *service,
|
|||
servers = json_object_get(service, "servers");
|
||||
|
||||
if (!json_is_array(servers)) {
|
||||
blog(LOG_WARNING, "rtmp-common.c: [fill_servers] "
|
||||
"Servers for service '%s' not a valid object",
|
||||
name);
|
||||
blog(LOG_WARNING,
|
||||
"rtmp-common.c: [fill_servers] "
|
||||
"Servers for service '%s' not a valid object",
|
||||
name);
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp(name, "Mixer.com - FTL") == 0) {
|
||||
obs_property_list_add_string(servers_prop,
|
||||
obs_module_text("Server.Auto"), "auto");
|
||||
obs_property_list_add_string(
|
||||
servers_prop, obs_module_text("Server.Auto"), "auto");
|
||||
}
|
||||
if (strcmp(name, "Twitch") == 0) {
|
||||
if (fill_twitch_servers(servers_prop))
|
||||
|
|
@ -345,7 +350,7 @@ static void fill_servers(obs_property_t *servers_prop, json_t *service,
|
|||
|
||||
json_array_foreach (servers, index, server) {
|
||||
const char *server_name = get_string_val(server, "name");
|
||||
const char *url = get_string_val(server, "url");
|
||||
const char *url = get_string_val(server, "url");
|
||||
|
||||
if (!server_name || !url)
|
||||
continue;
|
||||
|
|
@ -355,12 +360,13 @@ static void fill_servers(obs_property_t *servers_prop, json_t *service,
|
|||
}
|
||||
|
||||
static inline json_t *find_service(json_t *root, const char *name,
|
||||
const char **p_new_name)
|
||||
const char **p_new_name)
|
||||
{
|
||||
size_t index;
|
||||
json_t *service;
|
||||
|
||||
if (p_new_name) *p_new_name = NULL;
|
||||
if (p_new_name)
|
||||
*p_new_name = NULL;
|
||||
|
||||
json_array_foreach (root, index, service) {
|
||||
const char *cur_name = get_string_val(service, "name");
|
||||
|
|
@ -376,7 +382,8 @@ static inline json_t *find_service(json_t *root, const char *name,
|
|||
json_array_foreach (alt_names, alt_name_idx, alt_name_obj) {
|
||||
const char *alt_name = json_string_value(alt_name_obj);
|
||||
if (alt_name && strcmp(name, alt_name) == 0) {
|
||||
if (p_new_name) *p_new_name = cur_name;
|
||||
if (p_new_name)
|
||||
*p_new_name = cur_name;
|
||||
return service;
|
||||
}
|
||||
}
|
||||
|
|
@ -386,10 +393,10 @@ static inline json_t *find_service(json_t *root, const char *name,
|
|||
}
|
||||
|
||||
static bool service_selected(obs_properties_t *props, obs_property_t *p,
|
||||
obs_data_t *settings)
|
||||
obs_data_t *settings)
|
||||
{
|
||||
const char *name = obs_data_get_string(settings, "service");
|
||||
json_t *root = obs_properties_get_param(props);
|
||||
json_t *root = obs_properties_get_param(props);
|
||||
json_t *service;
|
||||
const char *new_name;
|
||||
|
||||
|
|
@ -418,8 +425,8 @@ static bool service_selected(obs_properties_t *props, obs_property_t *p,
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool show_all_services_toggled(obs_properties_t *ppts,
|
||||
obs_property_t *p, obs_data_t *settings)
|
||||
static bool show_all_services_toggled(obs_properties_t *ppts, obs_property_t *p,
|
||||
obs_data_t *settings)
|
||||
{
|
||||
const char *cur_service = obs_data_get_string(settings, "service");
|
||||
bool show_all = obs_data_get_bool(settings, "show_all");
|
||||
|
|
@ -429,7 +436,7 @@ static bool show_all_services_toggled(obs_properties_t *ppts,
|
|||
return false;
|
||||
|
||||
build_service_list(obs_properties_get(ppts, "service"), root, show_all,
|
||||
cur_service);
|
||||
cur_service);
|
||||
|
||||
UNUSED_PARAMETER(p);
|
||||
return true;
|
||||
|
|
@ -440,37 +447,37 @@ static obs_properties_t *rtmp_common_properties(void *unused)
|
|||
UNUSED_PARAMETER(unused);
|
||||
|
||||
obs_properties_t *ppts = obs_properties_create();
|
||||
obs_property_t *p;
|
||||
json_t *root;
|
||||
obs_property_t *p;
|
||||
json_t *root;
|
||||
|
||||
root = open_services_file();
|
||||
if (root)
|
||||
obs_properties_set_param(ppts, root, properties_data_destroy);
|
||||
|
||||
p = obs_properties_add_list(ppts, "service",
|
||||
obs_module_text("Service"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
p = obs_properties_add_list(ppts, "service", obs_module_text("Service"),
|
||||
OBS_COMBO_TYPE_LIST,
|
||||
OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
obs_property_set_modified_callback(p, service_selected);
|
||||
|
||||
p = obs_properties_add_bool(ppts, "show_all",
|
||||
obs_module_text("ShowAll"));
|
||||
obs_module_text("ShowAll"));
|
||||
|
||||
obs_property_set_modified_callback(p, show_all_services_toggled);
|
||||
|
||||
obs_properties_add_list(ppts, "server", obs_module_text("Server"),
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING);
|
||||
|
||||
obs_properties_add_text(ppts, "key", obs_module_text("StreamKey"),
|
||||
OBS_TEXT_PASSWORD);
|
||||
OBS_TEXT_PASSWORD);
|
||||
return ppts;
|
||||
}
|
||||
|
||||
static void apply_video_encoder_settings(obs_data_t *settings,
|
||||
json_t *recommended)
|
||||
json_t *recommended)
|
||||
{
|
||||
json_t *item = json_object_get(recommended, "keyint");
|
||||
if (item && json_is_integer(item)) {
|
||||
if (json_is_integer(item)) {
|
||||
int keyint = (int)json_integer_value(item);
|
||||
obs_data_set_int(settings, "keyint_sec", keyint);
|
||||
}
|
||||
|
|
@ -478,13 +485,13 @@ static void apply_video_encoder_settings(obs_data_t *settings,
|
|||
obs_data_set_string(settings, "rate_control", "CBR");
|
||||
|
||||
item = json_object_get(recommended, "profile");
|
||||
if (item && json_is_string(item)) {
|
||||
if (json_is_string(item)) {
|
||||
const char *profile = json_string_value(item);
|
||||
obs_data_set_string(settings, "profile", profile);
|
||||
}
|
||||
|
||||
item = json_object_get(recommended, "max video bitrate");
|
||||
if (item && json_is_integer(item)) {
|
||||
if (json_is_integer(item)) {
|
||||
int max_bitrate = (int)json_integer_value(item);
|
||||
if (obs_data_get_int(settings, "bitrate") > max_bitrate) {
|
||||
obs_data_set_int(settings, "bitrate", max_bitrate);
|
||||
|
|
@ -493,11 +500,11 @@ static void apply_video_encoder_settings(obs_data_t *settings,
|
|||
}
|
||||
|
||||
item = json_object_get(recommended, "bframes");
|
||||
if (item && json_is_integer(item))
|
||||
if (json_is_integer(item))
|
||||
obs_data_set_int(settings, "bf", 0);
|
||||
|
||||
item = json_object_get(recommended, "x264opts");
|
||||
if (item && json_is_string(item)) {
|
||||
if (json_is_string(item)) {
|
||||
const char *x264_settings = json_string_value(item);
|
||||
const char *cur_settings =
|
||||
obs_data_get_string(settings, "x264opts");
|
||||
|
|
@ -514,10 +521,10 @@ static void apply_video_encoder_settings(obs_data_t *settings,
|
|||
}
|
||||
|
||||
static void apply_audio_encoder_settings(obs_data_t *settings,
|
||||
json_t *recommended)
|
||||
json_t *recommended)
|
||||
{
|
||||
json_t *item = json_object_get(recommended, "max audio bitrate");
|
||||
if (item && json_is_integer(item)) {
|
||||
if (json_is_integer(item)) {
|
||||
int max_bitrate = (int)json_integer_value(item);
|
||||
if (obs_data_get_int(settings, "bitrate") > max_bitrate)
|
||||
obs_data_set_int(settings, "bitrate", max_bitrate);
|
||||
|
|
@ -525,16 +532,18 @@ static void apply_audio_encoder_settings(obs_data_t *settings,
|
|||
}
|
||||
|
||||
static void initialize_output(struct rtmp_common *service, json_t *root,
|
||||
obs_data_t *video_settings, obs_data_t *audio_settings)
|
||||
obs_data_t *video_settings,
|
||||
obs_data_t *audio_settings)
|
||||
{
|
||||
json_t *json_service = find_service(root, service->service, NULL);
|
||||
json_t *recommended;
|
||||
json_t *json_service = find_service(root, service->service, NULL);
|
||||
json_t *recommended;
|
||||
|
||||
if (!json_service) {
|
||||
if (service->service && *service->service)
|
||||
blog(LOG_WARNING, "rtmp-common.c: [initialize_output] "
|
||||
"Could not find service '%s'",
|
||||
service->service);
|
||||
blog(LOG_WARNING,
|
||||
"rtmp-common.c: [initialize_output] "
|
||||
"Could not find service '%s'",
|
||||
service->service);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -548,15 +557,15 @@ static void initialize_output(struct rtmp_common *service, json_t *root,
|
|||
apply_audio_encoder_settings(audio_settings, recommended);
|
||||
}
|
||||
|
||||
static void rtmp_common_apply_settings(void *data,
|
||||
obs_data_t *video_settings, obs_data_t *audio_settings)
|
||||
static void rtmp_common_apply_settings(void *data, obs_data_t *video_settings,
|
||||
obs_data_t *audio_settings)
|
||||
{
|
||||
struct rtmp_common *service = data;
|
||||
json_t *root = open_services_file();
|
||||
json_t *root = open_services_file();
|
||||
|
||||
if (root) {
|
||||
initialize_output(service, root, video_settings,
|
||||
audio_settings);
|
||||
audio_settings);
|
||||
json_decref(root);
|
||||
}
|
||||
}
|
||||
|
|
@ -595,14 +604,14 @@ static const char *rtmp_common_key(void *data)
|
|||
}
|
||||
|
||||
struct obs_service_info rtmp_common_service = {
|
||||
.id = "rtmp_common",
|
||||
.get_name = rtmp_common_getname,
|
||||
.create = rtmp_common_create,
|
||||
.destroy = rtmp_common_destroy,
|
||||
.update = rtmp_common_update,
|
||||
.id = "rtmp_common",
|
||||
.get_name = rtmp_common_getname,
|
||||
.create = rtmp_common_create,
|
||||
.destroy = rtmp_common_destroy,
|
||||
.update = rtmp_common_update,
|
||||
.get_properties = rtmp_common_properties,
|
||||
.get_url = rtmp_common_url,
|
||||
.get_key = rtmp_common_key,
|
||||
.get_url = rtmp_common_url,
|
||||
.get_key = rtmp_common_key,
|
||||
.apply_encoder_settings = rtmp_common_apply_settings,
|
||||
.get_output_type = rtmp_common_get_output_type,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@ static void rtmp_custom_update(void *data, obs_data_t *settings)
|
|||
bfree(service->key);
|
||||
|
||||
service->server = bstrdup(obs_data_get_string(settings, "server"));
|
||||
service->key = bstrdup(obs_data_get_string(settings, "key"));
|
||||
service->key = bstrdup(obs_data_get_string(settings, "key"));
|
||||
service->use_auth = obs_data_get_bool(settings, "use_auth");
|
||||
service->username = bstrdup(obs_data_get_string(settings, "username"));
|
||||
service->password = bstrdup(obs_data_get_string(settings, "password"));
|
||||
|
|
@ -47,7 +47,7 @@ static void *rtmp_custom_create(obs_data_t *settings, obs_service_t *service)
|
|||
}
|
||||
|
||||
static bool use_auth_modified(obs_properties_t *ppts, obs_property_t *p,
|
||||
obs_data_t *settings)
|
||||
obs_data_t *settings)
|
||||
{
|
||||
bool use_auth = obs_data_get_bool(settings, "use_auth");
|
||||
p = obs_properties_get(ppts, "username");
|
||||
|
|
@ -67,13 +67,14 @@ static obs_properties_t *rtmp_custom_properties(void *unused)
|
|||
obs_properties_add_text(ppts, "server", "URL", OBS_TEXT_DEFAULT);
|
||||
|
||||
obs_properties_add_text(ppts, "key", obs_module_text("StreamKey"),
|
||||
OBS_TEXT_PASSWORD);
|
||||
OBS_TEXT_PASSWORD);
|
||||
|
||||
p = obs_properties_add_bool(ppts, "use_auth", obs_module_text("UseAuth"));
|
||||
p = obs_properties_add_bool(ppts, "use_auth",
|
||||
obs_module_text("UseAuth"));
|
||||
obs_properties_add_text(ppts, "username", obs_module_text("Username"),
|
||||
OBS_TEXT_DEFAULT);
|
||||
OBS_TEXT_DEFAULT);
|
||||
obs_properties_add_text(ppts, "password", obs_module_text("Password"),
|
||||
OBS_TEXT_PASSWORD);
|
||||
OBS_TEXT_PASSWORD);
|
||||
obs_property_set_modified_callback(p, use_auth_modified);
|
||||
return ppts;
|
||||
}
|
||||
|
|
@ -107,14 +108,14 @@ static const char *rtmp_custom_password(void *data)
|
|||
}
|
||||
|
||||
struct obs_service_info rtmp_custom_service = {
|
||||
.id = "rtmp_custom",
|
||||
.get_name = rtmp_custom_name,
|
||||
.create = rtmp_custom_create,
|
||||
.destroy = rtmp_custom_destroy,
|
||||
.update = rtmp_custom_update,
|
||||
.id = "rtmp_custom",
|
||||
.get_name = rtmp_custom_name,
|
||||
.create = rtmp_custom_create,
|
||||
.destroy = rtmp_custom_destroy,
|
||||
.update = rtmp_custom_update,
|
||||
.get_properties = rtmp_custom_properties,
|
||||
.get_url = rtmp_custom_url,
|
||||
.get_key = rtmp_custom_key,
|
||||
.get_username = rtmp_custom_username,
|
||||
.get_password = rtmp_custom_password
|
||||
.get_url = rtmp_custom_url,
|
||||
.get_key = rtmp_custom_key,
|
||||
.get_username = rtmp_custom_username,
|
||||
.get_password = rtmp_custom_password,
|
||||
};
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ static bool confirm_service_file(void *param, struct file_download_data *file)
|
|||
obs_data_t *data;
|
||||
int format_version;
|
||||
|
||||
data = obs_data_create_from_json((char*)file->buffer.array);
|
||||
data = obs_data_create_from_json((char *)file->buffer.array);
|
||||
if (!data)
|
||||
return false;
|
||||
|
||||
|
|
@ -78,20 +78,18 @@ bool obs_module_load(void)
|
|||
|
||||
proc_handler_t *ph = obs_get_proc_handler();
|
||||
proc_handler_add(ph, "void twitch_ingests_refresh(int seconds)",
|
||||
refresh_callback, NULL);
|
||||
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,
|
||||
module_name.array,
|
||||
RTMP_SERVICES_URL,
|
||||
local_dir,
|
||||
cache_dir,
|
||||
confirm_service_file, NULL);
|
||||
update_info = update_info_create(RTMP_SERVICES_LOG_STR,
|
||||
module_name.array,
|
||||
RTMP_SERVICES_URL, local_dir,
|
||||
cache_dir,
|
||||
confirm_service_file, NULL);
|
||||
}
|
||||
|
||||
load_twitch_data();
|
||||
|
|
|
|||
|
|
@ -145,7 +145,7 @@ struct twitch_ingest twitch_ingest(size_t idx)
|
|||
ingest.name = NULL;
|
||||
ingest.url = NULL;
|
||||
} else {
|
||||
ingest = *(struct twitch_ingest*)(cur_ingests.array + idx);
|
||||
ingest = *(struct twitch_ingest *)(cur_ingests.array + idx);
|
||||
}
|
||||
|
||||
return ingest;
|
||||
|
|
@ -168,10 +168,9 @@ void twitch_ingests_refresh(int seconds)
|
|||
os_atomic_set_bool(&ingests_refreshing, true);
|
||||
|
||||
twitch_update_info = update_info_create_single(
|
||||
"[twitch ingest update] ",
|
||||
get_module_name(),
|
||||
"https://ingest.twitch.tv/api/v2/ingests",
|
||||
twitch_ingest_update, NULL);
|
||||
"[twitch ingest update] ", get_module_name(),
|
||||
"https://ingest.twitch.tv/api/v2/ingests",
|
||||
twitch_ingest_update, NULL);
|
||||
}
|
||||
|
||||
/* wait five seconds max when loading ingests for the first time */
|
||||
|
|
@ -189,10 +188,8 @@ void load_twitch_data(void)
|
|||
{
|
||||
char *twitch_cache = obs_module_config_path("twitch_ingests.json");
|
||||
|
||||
struct ingest def = {
|
||||
.name = bstrdup("Default"),
|
||||
.url = bstrdup("rtmp://live.twitch.tv/app")
|
||||
};
|
||||
struct ingest def = {.name = bstrdup("Default"),
|
||||
.url = bstrdup("rtmp://live.twitch.tv/app")};
|
||||
|
||||
pthread_mutex_lock(&mutex);
|
||||
da_push_back(cur_ingests, &def);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue