New upstream version 24.0.5+dfsg1
This commit is contained in:
parent
52fa83f147
commit
4c2ea24267
61 changed files with 710 additions and 130 deletions
|
|
@ -373,14 +373,6 @@ if (APPLE)
|
|||
target_link_libraries(obs
|
||||
Qt5::MacExtras)
|
||||
set_target_properties(obs PROPERTIES LINK_FLAGS "-pagezero_size 10000 -image_base 100000000")
|
||||
set_property(
|
||||
TARGET obs
|
||||
APPEND
|
||||
PROPERTY INSTALL_RPATH
|
||||
"/usr/local/Cellar/python3/3.6.4_2/Frameworks/Python.framework/Versions/3.6/lib/"
|
||||
"/Library/Frameworks/Python.framework/Versions/3.6/lib/"
|
||||
"/opt/local/Library/Frameworks/Python.framework/Versions/3.6/lib/"
|
||||
)
|
||||
endif()
|
||||
|
||||
define_graphic_modules(obs)
|
||||
|
|
|
|||
|
|
@ -216,7 +216,8 @@ void TwitchAuth::LoadUI()
|
|||
chat->SetWidget(browser);
|
||||
cef->add_force_popup_url(moderation_tools_url, chat.data());
|
||||
|
||||
script = bttv_script;
|
||||
script = "localStorage.setItem('twilight.theme', 1);";
|
||||
script += bttv_script;
|
||||
script += ffz_script;
|
||||
browser->setStartupScript(script);
|
||||
|
||||
|
|
|
|||
|
|
@ -3685,19 +3685,19 @@
|
|||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="sampleRate">
|
||||
<property name="currentText">
|
||||
<string notr="true">44.1khz</string>
|
||||
<string notr="true">44.1 kHz</string>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>44.1khz</string>
|
||||
<string>44.1 kHz</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>48khz</string>
|
||||
<string>48 kHz</string>
|
||||
</property>
|
||||
</item>
|
||||
</widget>
|
||||
|
|
|
|||
|
|
@ -126,10 +126,17 @@ static std::string GetWindowTitle(size_t i)
|
|||
if (status >= Success && name != nullptr) {
|
||||
std::string str(name);
|
||||
windowTitle = str;
|
||||
XFree(name);
|
||||
} else {
|
||||
XTextProperty xtp_new_name;
|
||||
if (XGetWMName(disp(), w, &xtp_new_name) != 0 &&
|
||||
xtp_new_name.value != nullptr) {
|
||||
std::string str((const char *)xtp_new_name.value);
|
||||
windowTitle = str;
|
||||
XFree(xtp_new_name.value);
|
||||
}
|
||||
}
|
||||
|
||||
XFree(name);
|
||||
|
||||
return windowTitle;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -28,11 +28,29 @@
|
|||
|
||||
using namespace std;
|
||||
|
||||
bool isInBundle()
|
||||
{
|
||||
NSRunningApplication *app = [NSRunningApplication currentApplication];
|
||||
return [app bundleIdentifier] != nil;
|
||||
}
|
||||
|
||||
bool GetDataFilePath(const char *data, string &output)
|
||||
{
|
||||
stringstream str;
|
||||
str << OBS_DATA_PATH "/obs-studio/" << data;
|
||||
output = str.str();
|
||||
if (isInBundle()) {
|
||||
NSRunningApplication *app =
|
||||
[NSRunningApplication currentApplication];
|
||||
NSURL *bundleURL = [app bundleURL];
|
||||
NSString *path = [NSString
|
||||
stringWithFormat:@"Contents/Resources/data/obs-studio/%@",
|
||||
[NSString stringWithUTF8String:data]];
|
||||
NSURL *dataURL = [bundleURL URLByAppendingPathComponent:path];
|
||||
output = [[dataURL path] UTF8String];
|
||||
} else {
|
||||
stringstream str;
|
||||
str << OBS_DATA_PATH "/obs-studio/" << data;
|
||||
output = str.str();
|
||||
}
|
||||
|
||||
return !access(output.c_str(), R_OK);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1820,7 +1820,7 @@ void WidgetInfo::ControlChanged()
|
|||
break;
|
||||
case OBS_PROPERTY_GROUP:
|
||||
GroupChanged(setting);
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
if (view->callback && !view->deferUpdate)
|
||||
|
|
|
|||
|
|
@ -417,6 +417,8 @@ void AutoConfigStreamPage::on_connectAccount_clicked()
|
|||
#ifdef BROWSER_AVAILABLE
|
||||
std::string service = QT_TO_UTF8(ui->service->currentText());
|
||||
|
||||
OAuth::DeleteCookies(service);
|
||||
|
||||
auth = OAuthStreamKey::Login(this, service);
|
||||
if (!!auth)
|
||||
OnAuthConnected();
|
||||
|
|
|
|||
|
|
@ -59,6 +59,10 @@ OBSBasicInteraction::OBSBasicInteraction(QWidget *parent, OBSSource source_)
|
|||
const char *name = obs_source_get_name(source);
|
||||
setWindowTitle(QTStr("Basic.InteractionWindow").arg(QT_UTF8(name)));
|
||||
|
||||
Qt::WindowFlags flags = windowFlags();
|
||||
Qt::WindowFlags helpFlag = Qt::WindowContextHelpButtonHint;
|
||||
setWindowFlags(flags & (~helpFlag));
|
||||
|
||||
auto addDrawCallback = [this]() {
|
||||
obs_display_add_draw_callback(ui->preview->GetDisplay(),
|
||||
OBSBasicInteraction::DrawPreview,
|
||||
|
|
|
|||
|
|
@ -643,6 +643,7 @@ void SimpleOutput::UpdateRecordingSettings()
|
|||
} else if (videoEncoder == SIMPLE_ENCODER_NVENC) {
|
||||
UpdateRecordingSettings_nvenc(crf);
|
||||
}
|
||||
UpdateRecordingAudioSettings();
|
||||
}
|
||||
|
||||
inline void SimpleOutput::SetupOutputs()
|
||||
|
|
|
|||
|
|
@ -88,6 +88,38 @@ static bool SceneCollectionExists(const char *findName)
|
|||
return found;
|
||||
}
|
||||
|
||||
static bool GetUnusedSceneCollectionFile(std::string &name, std::string &file)
|
||||
{
|
||||
char path[512];
|
||||
size_t len;
|
||||
int ret;
|
||||
|
||||
if (!GetFileSafeName(name.c_str(), file)) {
|
||||
blog(LOG_WARNING, "Failed to create safe file name for '%s'",
|
||||
name.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
ret = GetConfigPath(path, sizeof(path), "obs-studio/basic/scenes/");
|
||||
if (ret <= 0) {
|
||||
blog(LOG_WARNING, "Failed to get scene collection config path");
|
||||
return false;
|
||||
}
|
||||
|
||||
len = file.size();
|
||||
file.insert(0, path);
|
||||
|
||||
if (!GetClosestUnusedFileName(file, "json")) {
|
||||
blog(LOG_WARNING, "Failed to get closest file name for %s",
|
||||
file.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
file.erase(file.size() - 5, 5);
|
||||
file.erase(0, file.size() - len);
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool GetSceneCollectionName(QWidget *parent, std::string &name,
|
||||
std::string &file,
|
||||
const char *oldName = nullptr)
|
||||
|
|
@ -95,9 +127,6 @@ static bool GetSceneCollectionName(QWidget *parent, std::string &name,
|
|||
bool rename = oldName != nullptr;
|
||||
const char *title;
|
||||
const char *text;
|
||||
char path[512];
|
||||
size_t len;
|
||||
int ret;
|
||||
|
||||
if (rename) {
|
||||
title = Str("Basic.Main.RenameSceneCollection.Title");
|
||||
|
|
@ -128,29 +157,10 @@ static bool GetSceneCollectionName(QWidget *parent, std::string &name,
|
|||
break;
|
||||
}
|
||||
|
||||
if (!GetFileSafeName(name.c_str(), file)) {
|
||||
blog(LOG_WARNING, "Failed to create safe file name for '%s'",
|
||||
name.c_str());
|
||||
if (!GetUnusedSceneCollectionFile(name, file)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ret = GetConfigPath(path, sizeof(path), "obs-studio/basic/scenes/");
|
||||
if (ret <= 0) {
|
||||
blog(LOG_WARNING, "Failed to get scene collection config path");
|
||||
return false;
|
||||
}
|
||||
|
||||
len = file.size();
|
||||
file.insert(0, path);
|
||||
|
||||
if (!GetClosestUnusedFileName(file, "json")) {
|
||||
blog(LOG_WARNING, "Failed to get closest file name for %s",
|
||||
file.c_str());
|
||||
return false;
|
||||
}
|
||||
|
||||
file.erase(file.size() - 5, 5);
|
||||
file.erase(0, file.size() - len);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -166,6 +176,10 @@ bool OBSBasic::AddSceneCollection(bool create_new, const QString &qname)
|
|||
name = QT_TO_UTF8(qname);
|
||||
if (SceneCollectionExists(name.c_str()))
|
||||
return false;
|
||||
|
||||
if (!GetUnusedSceneCollectionFile(name, file)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
SaveProjectNow();
|
||||
|
|
|
|||
|
|
@ -466,6 +466,8 @@ void OBSBasicSettings::on_connectAccount_clicked()
|
|||
#ifdef BROWSER_AVAILABLE
|
||||
std::string service = QT_TO_UTF8(ui->service->currentText());
|
||||
|
||||
OAuth::DeleteCookies(service);
|
||||
|
||||
auth = OAuthStreamKey::Login(this, service);
|
||||
if (!!auth)
|
||||
OnAuthConnected();
|
||||
|
|
|
|||
|
|
@ -2189,9 +2189,9 @@ void OBSBasicSettings::LoadAudioSettings()
|
|||
|
||||
const char *str;
|
||||
if (sampleRate == 48000)
|
||||
str = "48khz";
|
||||
str = "48 kHz";
|
||||
else
|
||||
str = "44.1khz";
|
||||
str = "44.1 kHz";
|
||||
|
||||
int sampleRateIdx = ui->sampleRate->findText(str);
|
||||
if (sampleRateIdx != -1)
|
||||
|
|
@ -3253,7 +3253,7 @@ void OBSBasicSettings::SaveAudioSettings()
|
|||
}
|
||||
|
||||
int sampleRate = 44100;
|
||||
if (sampleRateStr == "48khz")
|
||||
if (sampleRateStr == "48 kHz")
|
||||
sampleRate = 48000;
|
||||
|
||||
if (WidgetChanged(ui->sampleRate))
|
||||
|
|
|
|||
|
|
@ -533,6 +533,24 @@ void OBSBasic::AddExtraBrowserDock(const QString &title, const QString &url,
|
|||
|
||||
dock->SetWidget(browser);
|
||||
|
||||
/* Add support for Twitch Dashboard panels */
|
||||
if (url.contains("twitch.tv/popout") &&
|
||||
url.contains("dashboard/live")) {
|
||||
QRegularExpression re("twitch.tv\/popout\/([^/]+)\/");
|
||||
QRegularExpressionMatch match = re.match(url);
|
||||
QString username = match.captured(1);
|
||||
if (username.length() > 0) {
|
||||
std::string script;
|
||||
script =
|
||||
"Object.defineProperty(document, 'referrer', { get: () => '";
|
||||
script += "https://twitch.tv/";
|
||||
script += QT_TO_UTF8(username);
|
||||
script += "/dashboard/live";
|
||||
script += "'});";
|
||||
browser->setStartupScript(script);
|
||||
}
|
||||
}
|
||||
|
||||
addDockWidget(Qt::RightDockWidgetArea, dock);
|
||||
|
||||
if (firstCreate) {
|
||||
|
|
|
|||
|
|
@ -653,6 +653,9 @@ void OBSProjector::OBSRender(void *data, uint32_t cx, uint32_t cy)
|
|||
source = curSource;
|
||||
window->source = source;
|
||||
}
|
||||
} else if (window->type == ProjectorType::Preview &&
|
||||
!main->IsPreviewProgramMode()) {
|
||||
window->source = nullptr;
|
||||
}
|
||||
|
||||
if (source)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue