UI: Support FTL URLs for custom streaming service

Custom streaming service URLs beginning with `ftl` are handled by the
`ftl_output` plugin.
This commit is contained in:
Hayden McAfee
2020-12-06 01:54:29 -08:00
committed by Jim
parent 46118470ab
commit 96ef45cef5
2 changed files with 20 additions and 4 deletions

View File

@@ -45,6 +45,8 @@
#define OPT_MAX_SHUTDOWN_TIME_SEC "max_shutdown_time_sec"
#define OPT_BIND_IP "bind_ip"
#define FTL_URL_PROTOCOL "ftl://"
typedef struct _nalu_t {
int len;
int dts_usec;
@@ -1020,7 +1022,7 @@ static int init_connect(struct ftl_stream *stream)
{
obs_service_t *service;
obs_data_t *settings;
const char *bind_ip, *key;
const char *bind_ip, *key, *ingest_url;
ftl_status_t status_code;
info("init_connect");
@@ -1046,7 +1048,14 @@ static int init_connect(struct ftl_stream *stream)
obs_output_get_video_encoder(stream->output);
obs_data_t *video_settings = obs_encoder_get_settings(video_encoder);
dstr_copy(&stream->path, obs_service_get_url(service));
ingest_url = obs_service_get_url(service);
if (strncmp(ingest_url, FTL_URL_PROTOCOL, strlen(FTL_URL_PROTOCOL)) ==
0) {
dstr_copy(&stream->path, ingest_url + strlen(FTL_URL_PROTOCOL));
} else {
dstr_copy(&stream->path, ingest_url);
}
key = obs_service_get_key(service);
int target_bitrate = (int)obs_data_get_int(video_settings, "bitrate");