提交 96ef45ce 编写于 作者: H Hayden McAfee 提交者: Jim

UI: Support FTL URLs for custom streaming service

Custom streaming service URLs beginning with `ftl` are handled by the
`ftl_output` plugin.
上级 46118470
......@@ -16,6 +16,7 @@ volatile bool recording_paused = false;
volatile bool replaybuf_active = false;
volatile bool virtualcam_active = false;
#define FTL_PROTOCOL "ftl"
#define RTMP_PROTOCOL "rtmp"
static void OBSStreamStarting(void *data, calldata_t *params)
......@@ -763,7 +764,10 @@ bool SimpleOutput::SetupStreaming(obs_service_t *service)
type = "rtmp_output";
const char *url = obs_service_get_url(service);
if (url != NULL &&
strncmp(url, RTMP_PROTOCOL, strlen(RTMP_PROTOCOL)) != 0) {
strncmp(url, FTL_PROTOCOL, strlen(FTL_PROTOCOL)) == 0) {
type = "ftl_output";
} else if (url != NULL && strncmp(url, RTMP_PROTOCOL,
strlen(RTMP_PROTOCOL)) != 0) {
type = "ffmpeg_mpegts_muxer";
}
}
......@@ -1684,7 +1688,10 @@ bool AdvancedOutput::SetupStreaming(obs_service_t *service)
type = "rtmp_output";
const char *url = obs_service_get_url(service);
if (url != NULL &&
strncmp(url, RTMP_PROTOCOL, strlen(RTMP_PROTOCOL)) != 0) {
strncmp(url, FTL_PROTOCOL, strlen(FTL_PROTOCOL)) == 0) {
type = "ftl_output";
} else if (url != NULL && strncmp(url, RTMP_PROTOCOL,
strlen(RTMP_PROTOCOL)) != 0) {
type = "ffmpeg_mpegts_muxer";
}
}
......
......@@ -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");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册