Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ env:
CEF_BUILD_VERSION_WIN: '5060'
QT_VERSION_MAC: '6.4.3'
QT_VERSION_WIN: '6.4.3'
DEPS_VERSION_WIN: '2023-04-12'
DEPS_VERSION_WIN: '2023-06-01'
VLC_VERSION_WIN: '3.0.0-git'
TWITCH_CLIENTID: ${{ secrets.TWITCH_CLIENT_ID }}
TWITCH_HASH: ${{ secrets.TWITCH_HASH }}
Expand Down
1 change: 1 addition & 0 deletions CI/linux/02_build_obs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ _configure_obs() {
-DLINUX_PORTABLE=${PORTABLE_BUILD:-OFF} \
-DENABLE_AJA=OFF \
-DENABLE_NEW_MPEGTS_OUTPUT=OFF \
-DENABLE_WEBRTC=OFF \
${PIPEWIRE_OPTION} \
${YOUTUBE_OPTIONS} \
${TWITCH_OPTIONS} \
Expand Down
1 change: 1 addition & 0 deletions UI/data/locale/en-US.ini
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ Basic.AutoConfig.StreamPage.Server="Server"
Basic.AutoConfig.StreamPage.StreamKey="Stream Key"
Basic.AutoConfig.StreamPage.StreamKey.ToolTip="RIST: enter the encryption passphrase.\nRTMP: enter the key provided by the service.\nSRT: enter the streamid if the service uses one."
Basic.AutoConfig.StreamPage.EncoderKey="Encoder Key"
Basic.AutoConfig.StreamPage.BearerToken="Bearer Token"
Basic.AutoConfig.StreamPage.ConnectedAccount="Connected account"
Basic.AutoConfig.StreamPage.PerformBandwidthTest="Estimate bitrate with bandwidth test (may take a few minutes)"
Basic.AutoConfig.StreamPage.PreferHardwareEncoding="Prefer hardware encoding"
Expand Down
3 changes: 2 additions & 1 deletion UI/window-basic-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1369,7 +1369,8 @@ bool OBSBasic::LoadService()
return false;

/* Enforce Opus on FTL if needed */
if (strcmp(obs_service_get_protocol(service), "FTL") == 0) {
if (strcmp(obs_service_get_protocol(service), "FTL") == 0 ||
strcmp(obs_service_get_protocol(service), "WHIP") == 0) {
const char *option = config_get_string(
basicConfig, "SimpleOutput", "StreamAudioEncoder");
if (strcmp(option, "opus") != 0)
Expand Down
71 changes: 59 additions & 12 deletions UI/window-basic-settings-stream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ extern QCefCookieManager *panel_cookies;
enum class ListOpt : int {
ShowAll = 1,
Custom,
WHIP,
};

enum class Section : int {
Expand All @@ -41,6 +42,11 @@ inline bool OBSBasicSettings::IsCustomService() const
return ui->service->currentData().toInt() == (int)ListOpt::Custom;
}

inline bool OBSBasicSettings::IsWHIP() const
{
return ui->service->currentData().toInt() == (int)ListOpt::WHIP;
}

void OBSBasicSettings::InitStreamPage()
{
ui->connectAccount2->setVisible(false);
Expand Down Expand Up @@ -91,6 +97,9 @@ void OBSBasicSettings::LoadStream1Settings()

obs_service_t *service_obj = main->GetService();
const char *type = obs_service_get_type(service_obj);
bool is_rtmp_custom = (strcmp(type, "rtmp_custom") == 0);
bool is_rtmp_common = (strcmp(type, "rtmp_common") == 0);
bool is_whip = (strcmp(type, "whip_custom") == 0);

loading = true;

Expand All @@ -100,10 +109,14 @@ void OBSBasicSettings::LoadStream1Settings()
const char *server = obs_data_get_string(settings, "server");
const char *key = obs_data_get_string(settings, "key");
protocol = QT_UTF8(obs_service_get_protocol(service_obj));
const char *bearer_token =
obs_data_get_string(settings, "bearer_token");

if (strcmp(type, "rtmp_custom") == 0) {
ui->service->setCurrentIndex(0);
if (is_rtmp_custom || is_whip)
ui->customServer->setText(server);

if (is_rtmp_custom) {
ui->service->setCurrentIndex(0);
lastServiceIdx = 0;
lastCustomServer = ui->customServer->text();

Expand Down Expand Up @@ -157,7 +170,7 @@ void OBSBasicSettings::LoadStream1Settings()

UpdateServerList();

if (strcmp(type, "rtmp_common") == 0) {
if (is_rtmp_common) {
int idx = ui->server->findData(server);
if (idx == -1) {
if (server && *server)
Expand All @@ -167,7 +180,10 @@ void OBSBasicSettings::LoadStream1Settings()
ui->server->setCurrentIndex(idx);
}

ui->key->setText(key);
if (is_whip)
ui->key->setText(bearer_token);
else
ui->key->setText(key);

lastService.clear();
ServiceChanged();
Expand All @@ -191,14 +207,21 @@ void OBSBasicSettings::LoadStream1Settings()
void OBSBasicSettings::SaveStream1Settings()
{
bool customServer = IsCustomService();
const char *service_id = customServer ? "rtmp_custom" : "rtmp_common";
bool whip = IsWHIP();
const char *service_id = "rtmp_common";

if (customServer) {
service_id = "rtmp_custom";
} else if (whip) {
service_id = "whip_custom";
}

obs_service_t *oldService = main->GetService();
OBSDataAutoRelease hotkeyData = obs_hotkeys_save_service(oldService);

OBSDataAutoRelease settings = obs_data_create();

if (!customServer) {
if (!customServer && !whip) {
obs_data_set_string(settings, "service",
QT_TO_UTF8(ui->service->currentText()));
obs_data_set_string(settings, "protocol", QT_TO_UTF8(protocol));
Expand Down Expand Up @@ -239,7 +262,12 @@ void OBSBasicSettings::SaveStream1Settings()
obs_data_set_bool(settings, "bwtest", false);
}

obs_data_set_string(settings, "key", QT_TO_UTF8(ui->key->text()));
if (whip)
obs_data_set_string(settings, "bearer_token",
QT_TO_UTF8(ui->key->text()));
else
obs_data_set_string(settings, "key",
QT_TO_UTF8(ui->key->text()));

OBSServiceAutoRelease newService = obs_service_create(
service_id, "default_service", settings, hotkeyData);
Expand All @@ -262,7 +290,7 @@ void OBSBasicSettings::SaveStream1Settings()

void OBSBasicSettings::UpdateMoreInfoLink()
{
if (IsCustomService()) {
if (IsCustomService() || IsWHIP()) {
ui->moreInfoButton->hide();
return;
}
Expand Down Expand Up @@ -312,6 +340,9 @@ void OBSBasicSettings::UpdateKeyLink()
if (serviceName == "Dacast") {
ui->streamKeyLabel->setText(
QTStr("Basic.AutoConfig.StreamPage.EncoderKey"));
} else if (IsWHIP()) {
ui->streamKeyLabel->setText(
QTStr("Basic.AutoConfig.StreamPage.BearerToken"));
} else if (!IsCustomService()) {
ui->streamKeyLabel->setText(
QTStr("Basic.AutoConfig.StreamPage.StreamKey"));
Expand Down Expand Up @@ -356,6 +387,8 @@ void OBSBasicSettings::LoadServices(bool showAll)
for (QString &name : names)
ui->service->addItem(name);

ui->service->insertItem(0, QTStr("WHIP"), QVariant((int)ListOpt::WHIP));

if (!showAll) {
ui->service->addItem(
QTStr("Basic.AutoConfig.StreamPage.Service.ShowAll"),
Expand Down Expand Up @@ -484,6 +517,7 @@ void OBSBasicSettings::ServiceChanged()
{
std::string service = QT_TO_UTF8(ui->service->currentText());
bool custom = IsCustomService();
bool whip = IsWHIP();

ui->disconnectAccount->setVisible(false);
ui->bandwidthTestEnable->setVisible(false);
Expand All @@ -500,7 +534,7 @@ void OBSBasicSettings::ServiceChanged()
ui->authPwLabel->setVisible(custom);
ui->authPwWidget->setVisible(custom);

if (custom) {
if (custom || whip) {
ui->streamkeyPageLayout->insertRow(1, ui->serverLabel,
ui->serverStackedWidget);

Expand Down Expand Up @@ -625,11 +659,18 @@ void OBSBasicSettings::on_authPwShow_clicked()
OBSService OBSBasicSettings::SpawnTempService()
{
bool custom = IsCustomService();
const char *service_id = custom ? "rtmp_custom" : "rtmp_common";
bool whip = IsWHIP();
const char *service_id = "rtmp_common";

if (custom) {
service_id = "rtmp_custom";
} else if (whip) {
service_id = "whip_custom";
}

OBSDataAutoRelease settings = obs_data_create();

if (!custom) {
if (!custom && !whip) {
obs_data_set_string(settings, "service",
QT_TO_UTF8(ui->service->currentText()));
obs_data_set_string(
Expand All @@ -640,7 +681,13 @@ OBSService OBSBasicSettings::SpawnTempService()
settings, "server",
QT_TO_UTF8(ui->customServer->text().trimmed()));
}
obs_data_set_string(settings, "key", QT_TO_UTF8(ui->key->text()));

if (whip)
obs_data_set_string(settings, "bearer_token",
QT_TO_UTF8(ui->key->text()));
else
obs_data_set_string(settings, "key",
QT_TO_UTF8(ui->key->text()));

OBSServiceAutoRelease newService = obs_service_create(
service_id, "temp_service", settings, nullptr);
Expand Down
1 change: 1 addition & 0 deletions UI/window-basic-settings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ class OBSBasicSettings : public QDialog {
/* stream */
void InitStreamPage();
inline bool IsCustomService() const;
inline bool IsWHIP() const;
void LoadServices(bool showAll);
void OnOAuthStreamKeyConnected();
void OnAuthConnected();
Expand Down
3 changes: 3 additions & 0 deletions build-aux/com.obsproject.Studio.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@
"modules/20-x264.json",
"modules/30-ffmpeg.json",
"modules/40-luajit.json",
"modules/40-plog.json",
"modules/40-usrsctp.json",
"modules/50-jansson.json",
"modules/50-libdatachannel.json",
"modules/50-ntv2.json",
"modules/50-pipewire.json",
"modules/50-swig.json",
Expand Down
18 changes: 18 additions & 0 deletions build-aux/modules/40-plog.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "plog",
"buildsystem": "cmake-ninja",
"config-opts": [
"-DPLOG_BUILD_SAMPLES=OFF"
],
"cleanup": [
"*"
],
"sources": [
{
"type": "git",
"url": "https://github.com/SergiusTheBest/plog.git",
"tag": "1.1.9",
"commit": "f47149410a4c927643148b96799f28b2d80d451b"
}
]
}
21 changes: 21 additions & 0 deletions build-aux/modules/40-usrsctp.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "usrsctp",
"buildsystem": "cmake-ninja",
"//": "Disable SCTP IP code. Packets are handle by WebRTC so we don't need it",
"config-opts": [
"-Dsctp_build_shared_lib=ON",
"-Dsctp_build_programs=OFF",
"-Dsctp_inet=OFF",
"-Dsctp_inet6=OFF",
"-Dsctp_werror=OFF",
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON"
],
"sources": [
{
"type": "git",
"url": "https://github.com/sctplab/usrsctp.git",
"tag": "0.9.5.0",
"commit": "07f871bda23943c43c9e74cc54f25130459de830"
}
]
}
20 changes: 20 additions & 0 deletions build-aux/modules/50-libdatachannel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "libdatachannel",
"buildsystem": "cmake-ninja",
"config-opts": [
"-DNO_EXAMPLES=ON",
"-DNO_TESTS=ON",
"-DNO_WEBSOCKET=ON",
"-DUSE_NICE=ON",
"-DPREFER_SYSTEM_LIB=ON"
],
"sources": [
{
"type": "git",
"url": "https://github.com/paullouisageneau/libdatachannel.git",
"disable-submodules": true,
"tag": "v0.19.0-alpha.1",
"commit": "f66f2813c11acaea3b20d9a5f115823777426e63"
}
]
}
24 changes: 12 additions & 12 deletions buildspec.json
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
{
"dependencies": {
"prebuilt": {
"version": "2023-04-12",
"version": "2023-06-01",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"label": "Pre-Built obs-deps",
"hashes": {
"macos-x86_64": "81120ffa33bb050c6c5fcd236e5cedfd7b80f7053fdba271fead5af20be0b5f5",
"macos-arm64": "b9bab79611774c4651d084e14259abe889d2b8d1653787a843d08cf3f0db881c",
"macos-universal": "9535c6e1ad96f7d49960251e85a245774088d48da1d602bb82f734b10219125a",
"windows-x64": "c13a14a1acc4224b21304d97b63da4121de1ed6981297e50496fbc474abc0503",
"linux-x86_64": "056425a8a7a4a0c242ed5ab9c1eba4dd6b004386877de4304524e7bea11c0ee2"
"macos-x86_64": "fdd3f85f597cb8237041673f4cb0b0908d548791126cfd0d12fa7886bea3745f",
"macos-arm64": "17a954636998b07355c66a3d242191bfde75467985cc64ab3c292859b1f54d28",
"macos-universal": "ecbfba9473abced9bd16ef2ac29ed61ce036c10a3135039d464a7611daf27fb8",
"windows-x64": "cacb858777edaa0251b90350192d175b9b977f186f872a16d1e6b67fc5b4f9f0",
"linux-x86_64": "b97ed74fde7a01ba8e90916318733e0d0bf89ed30e84a53d1ccd425f4afe5d7f"
}
},
"qt6": {
"version": "2023-04-12",
"version": "2023-06-01",
"baseUrl": "https://github.com/obsproject/obs-deps/releases/download",
"label": "Pre-Built Qt6",
"hashes": {
"macos-x86_64": "2622d6ecd484a596da12b6a45b709fe563821eda558d0bbb27335c8c2f63945c",
"macos-arm64": "4f72aa1103d88a00d90c01bb3650276ffa1408e16ef40579177605483b986dc9",
"macos-universal": "eb7614544ab4f3d2c6052c797635602280ca5b028a6b987523d8484222ce45d1",
"windows-x64": "4d39364b8a8dee5aa24fcebd8440d5c22bb4551c6b440ffeacce7d61f2ed1add"
"macos-x86_64": "b874b9aefbb42e586661c8cc652c889413dd68ff683307de54af8074139e69ab",
"macos-arm64": "e95d6461b8cafea6125aa82e3f9888eea5c5101a3911e88543631fadeb5faa9f",
"macos-universal": "5c1880af8fe8e6a0e85924952e8c756410c37e6f13e36667be86cd0979a2ae8b",
"windows-x64": "aa77caa98d34263a97e0bd0435a18e5c981e915636af562557bb4bf09d49be04"
},
"debugSymbols": {
"windows-x64": "f34ee5067be19ed370268b15c53684b7b8aaa867dc800b68931df905d679e31f"
"windows-x64": "7d955aca2b2976f9e085040795f5642b3cac1f76c5534a47fe8e6c6cf351a4fb"
}
},
"cef": {
Expand Down
4 changes: 3 additions & 1 deletion cmake/Modules/CopyMSVCBins.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,9 @@ file(
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/libbz2*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin${_bin_suffix}/zlib*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/libbz2*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/zlib*.dll")
"${FFMPEG_avcodec_INCLUDE_DIR}/bin${_bin_suffix}/zlib*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/../bin/libdatachannel*.dll"
"${FFMPEG_avcodec_INCLUDE_DIR}/bin/libdatachannel*.dll")

file(GLOB X264_BIN_FILES "${X264_INCLUDE_DIR}/../bin${_bin_suffix}/libx264-*.dll"
"${X264_INCLUDE_DIR}/../bin/libx264-*.dll" "${X264_INCLUDE_DIR}/bin/libx264-*.dll"
Expand Down
1 change: 1 addition & 0 deletions libobs/obs-service.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ enum obs_service_connect_info {
OBS_SERVICE_CONNECT_INFO_USERNAME = 4,
OBS_SERVICE_CONNECT_INFO_PASSWORD = 6,
OBS_SERVICE_CONNECT_INFO_ENCRYPT_PASSPHRASE = 8,
OBS_SERVICE_CONNECT_INFO_BEARER_TOKEN = 10,
};

struct obs_service_info {
Expand Down
2 changes: 2 additions & 0 deletions plugins/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ if(OBS_CMAKE_VERSION VERSION_GREATER_EQUAL 3.0.0)
OR OS_LINUX)
add_subdirectory(obs-vst)
endif()
add_subdirectory(obs-webrtc)
check_obs_websocket()
add_subdirectory(obs-x264)
add_subdirectory(rtmp-services)
Expand Down Expand Up @@ -191,3 +192,4 @@ add_subdirectory(obs-transitions)
add_subdirectory(rtmp-services)
add_subdirectory(text-freetype2)
add_subdirectory(aja)
add_subdirectory(obs-webrtc)
21 changes: 21 additions & 0 deletions plugins/obs-webrtc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cmake_minimum_required(VERSION 3.16...3.25)

legacy_check()

option(ENABLE_WEBRTC "Enable WebRTC Output support" ON)
if(NOT ENABLE_WEBRTC)
message(STATUS "OBS: DISABLED obs-webrtc")
return()
endif()

find_package(LibDataChannel REQUIRED)
find_package(CURL REQUIRED)

add_library(obs-webrtc MODULE)
add_library(OBS::webrtc ALIAS obs-webrtc)

target_sources(obs-webrtc PRIVATE obs-webrtc.cpp whip-output.cpp whip-output.h whip-service.cpp whip-service.h)

target_link_libraries(obs-webrtc PRIVATE OBS::libobs LibDataChannel::LibDataChannel CURL::libcurl)

set_target_properties_obs(obs-webrtc PROPERTIES FOLDER plugins PREFIX "")
Loading