Compare commits
5 Commits
2f8d28f7fa
...
e8dc70d0ee
Author | SHA1 | Date |
---|---|---|
derrod | e8dc70d0ee | |
jp9000 | 4563413d15 | |
Ryan Foster | 7d853fb155 | |
jp9000 | 76c9b2b297 | |
jp9000 | bfa2053b08 |
|
@ -1285,6 +1285,11 @@ AddUrl.Title="Add Source via URL"
|
|||
AddUrl.Text="You have dragged a URL into OBS. This will automatically add the link as a source. Continue?"
|
||||
AddUrl.Text.Url="URL: %1"
|
||||
|
||||
# Dynamic output size
|
||||
ResizeOutputSizeOfSource="Resize output (source size)"
|
||||
ResizeOutputSizeOfSource.Text="The base and output resolutions will be resized to the size of the current source."
|
||||
ResizeOutputSizeOfSource.Continue="Do you want to continue?"
|
||||
|
||||
PreviewTransition="Preview Transition"
|
||||
|
||||
# Import Dialog
|
||||
|
|
|
@ -1873,6 +1873,18 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, LPWSTR lpCmdLine, int)
|
|||
|
||||
is32bit = wcsstr(cwd, L"bin\\32bit") != nullptr;
|
||||
|
||||
if (!IsWindows10OrGreater()) {
|
||||
MessageBox(
|
||||
nullptr,
|
||||
L"OBS Studio 28 and newer no longer support Windows 7,"
|
||||
L" Windows 8, or Windows 8.1. You can disable the"
|
||||
L" following setting to opt out of future updates:"
|
||||
L" Settings → General → General → Automatically check"
|
||||
L" for updates on startup",
|
||||
L"Unsupported Operating System", MB_ICONWARNING);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!HasElevation()) {
|
||||
|
||||
WinHandle hMutex = OpenMutex(
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#define ZLIB_CONST
|
||||
|
||||
#include <windows.h>
|
||||
#include <versionhelpers.h>
|
||||
#include <winhttp.h>
|
||||
#include <commctrl.h>
|
||||
#include <Wincrypt.h>
|
||||
|
|
|
@ -5642,6 +5642,18 @@ void OBSBasic::CreateSourcePopupMenu(int idx, bool preview)
|
|||
popup.addSeparator();
|
||||
}
|
||||
|
||||
QAction *resizeOutput =
|
||||
popup.addAction(QTStr("ResizeOutputSizeOfSource"), this,
|
||||
SLOT(ResizeOutputSizeOfSource()));
|
||||
|
||||
int width = obs_source_get_width(source);
|
||||
int height = obs_source_get_height(source);
|
||||
|
||||
resizeOutput->setEnabled(!obs_video_active());
|
||||
|
||||
if (width < 8 || height < 8)
|
||||
resizeOutput->setEnabled(false);
|
||||
|
||||
scaleFilteringMenu = new QMenu(QTStr("ScaleFiltering"));
|
||||
popup.addMenu(
|
||||
AddScaleFilteringMenu(scaleFilteringMenu, sceneItem));
|
||||
|
@ -9725,6 +9737,40 @@ void OBSBasic::on_actionShowAbout_triggered()
|
|||
about->setAttribute(Qt::WA_DeleteOnClose, true);
|
||||
}
|
||||
|
||||
void OBSBasic::ResizeOutputSizeOfSource()
|
||||
{
|
||||
if (obs_video_active())
|
||||
return;
|
||||
|
||||
QMessageBox resize_output(this);
|
||||
resize_output.setText(QTStr("ResizeOutputSizeOfSource.Text") + "\n\n" +
|
||||
QTStr("ResizeOutputSizeOfSource.Continue"));
|
||||
QAbstractButton *Yes =
|
||||
resize_output.addButton(QTStr("Yes"), QMessageBox::YesRole);
|
||||
resize_output.addButton(QTStr("No"), QMessageBox::NoRole);
|
||||
resize_output.setIcon(QMessageBox::Warning);
|
||||
resize_output.setWindowTitle(QTStr("ResizeOutputSizeOfSource"));
|
||||
resize_output.exec();
|
||||
|
||||
if (resize_output.clickedButton() != Yes)
|
||||
return;
|
||||
|
||||
OBSSource source = obs_sceneitem_get_source(GetCurrentSceneItem());
|
||||
|
||||
int width = obs_source_get_width(source);
|
||||
int height = obs_source_get_height(source);
|
||||
|
||||
config_set_uint(basicConfig, "Video", "BaseCX", width);
|
||||
config_set_uint(basicConfig, "Video", "BaseCY", height);
|
||||
config_set_uint(basicConfig, "Video", "OutputCX", width);
|
||||
config_set_uint(basicConfig, "Video", "OutputCY", height);
|
||||
|
||||
ResetVideo();
|
||||
ResetOutputs();
|
||||
config_save_safe(basicConfig, "tmp", nullptr);
|
||||
on_actionFitToScreen_triggered();
|
||||
}
|
||||
|
||||
QAction *OBSBasic::AddDockWidget(QDockWidget *dock)
|
||||
{
|
||||
QAction *action = ui->menuDocks->addAction(dock->windowTitle());
|
||||
|
|
|
@ -1174,6 +1174,8 @@ private slots:
|
|||
|
||||
void StackedMixerAreaContextMenuRequested();
|
||||
|
||||
void ResizeOutputSizeOfSource();
|
||||
|
||||
public slots:
|
||||
void on_actionResetTransform_triggered();
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
*
|
||||
* Reset to zero each major or minor version
|
||||
*/
|
||||
#define LIBOBS_API_PATCH_VER 0
|
||||
#define LIBOBS_API_PATCH_VER 1
|
||||
|
||||
#define MAKE_SEMANTIC_VERSION(major, minor, patch) \
|
||||
((major << 24) | (minor << 16) | patch)
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit a64bffd38b405580ea56288a91b4aea2f8628033
|
||||
Subproject commit a93f1a34c14e91b5c540f264fb965f32caf77336
|
|
@ -177,7 +177,6 @@ enum class Action {
|
|||
ConfigAudio,
|
||||
ConfigCrossbar1,
|
||||
ConfigCrossbar2,
|
||||
SaveSettings,
|
||||
};
|
||||
|
||||
static DWORD CALLBACK DShowThread(LPVOID ptr);
|
||||
|
@ -205,7 +204,6 @@ struct DShowInput {
|
|||
|
||||
WinHandle semaphore;
|
||||
WinHandle activated_event;
|
||||
WinHandle saved_event;
|
||||
WinHandle thread;
|
||||
CriticalSection mutex;
|
||||
vector<Action> actions;
|
||||
|
@ -245,10 +243,6 @@ struct DShowInput {
|
|||
if (!activated_event)
|
||||
throw "Failed to create activated_event";
|
||||
|
||||
saved_event = CreateEvent(nullptr, false, false, nullptr);
|
||||
if (!saved_event)
|
||||
throw "Failed to create saved_event";
|
||||
|
||||
thread =
|
||||
CreateThread(nullptr, 0, DShowThread, this, 0, nullptr);
|
||||
if (!thread)
|
||||
|
@ -293,8 +287,6 @@ struct DShowInput {
|
|||
|
||||
bool UpdateVideoConfig(obs_data_t *settings);
|
||||
bool UpdateAudioConfig(obs_data_t *settings);
|
||||
bool UpdateVideoProperties(obs_data_t *settings);
|
||||
void SaveVideoProperties();
|
||||
void SetActive(bool active);
|
||||
inline enum video_colorspace GetColorSpace(obs_data_t *settings) const;
|
||||
inline enum video_range_type GetColorRange(obs_data_t *settings) const;
|
||||
|
@ -389,9 +381,6 @@ void DShowInput::DShowLoop()
|
|||
device.OpenDialog(nullptr, DialogType::ConfigCrossbar2);
|
||||
break;
|
||||
|
||||
case Action::SaveSettings:
|
||||
SaveVideoProperties();
|
||||
break;
|
||||
case Action::None:;
|
||||
}
|
||||
}
|
||||
|
@ -1029,102 +1018,6 @@ bool DShowInput::UpdateVideoConfig(obs_data_t *settings)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool DShowInput::UpdateVideoProperties(obs_data_t *settings)
|
||||
{
|
||||
OBSDataArrayAutoRelease cca =
|
||||
obs_data_get_array(settings, "CameraControl");
|
||||
|
||||
if (cca) {
|
||||
std::vector<VideoDeviceProperty> properties;
|
||||
const auto count = obs_data_array_count(cca);
|
||||
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
OBSDataAutoRelease item = obs_data_array_item(cca, i);
|
||||
if (!item)
|
||||
continue;
|
||||
|
||||
VideoDeviceProperty prop{};
|
||||
prop.property =
|
||||
(long)obs_data_get_int(item, "property");
|
||||
prop.flags = (long)obs_data_get_int(item, "flags");
|
||||
prop.val = (long)obs_data_get_int(item, "val");
|
||||
properties.push_back(prop);
|
||||
}
|
||||
|
||||
if (!properties.empty()) {
|
||||
device.SetCameraControlProperties(&properties);
|
||||
}
|
||||
}
|
||||
|
||||
OBSDataArrayAutoRelease vpaa =
|
||||
obs_data_get_array(settings, "VideoProcAmp");
|
||||
|
||||
if (vpaa) {
|
||||
std::vector<VideoDeviceProperty> properties;
|
||||
const auto count = obs_data_array_count(vpaa);
|
||||
|
||||
for (size_t i = 0; i < count; i++) {
|
||||
OBSDataAutoRelease item = obs_data_array_item(vpaa, i);
|
||||
if (!item)
|
||||
continue;
|
||||
|
||||
VideoDeviceProperty prop{};
|
||||
prop.property =
|
||||
(long)obs_data_get_int(item, "property");
|
||||
prop.flags = (long)obs_data_get_int(item, "flags");
|
||||
prop.val = (long)obs_data_get_int(item, "val");
|
||||
properties.push_back(prop);
|
||||
}
|
||||
|
||||
if (!properties.empty()) {
|
||||
device.SetVideoProcAmpProperties(&properties);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void DShowInput::SaveVideoProperties()
|
||||
{
|
||||
OBSDataAutoRelease settings = obs_source_get_settings(source);
|
||||
if (!settings) {
|
||||
SetEvent(saved_event);
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector<VideoDeviceProperty> properties;
|
||||
OBSDataArrayAutoRelease ccp = obs_data_array_create();
|
||||
|
||||
if (device.GetCameraControlProperties(properties)) {
|
||||
for (const auto property : properties) {
|
||||
OBSDataAutoRelease obj = obs_data_create();
|
||||
obs_data_set_int(obj, "property", property.property);
|
||||
obs_data_set_int(obj, "flags", property.flags);
|
||||
obs_data_set_int(obj, "val", property.val);
|
||||
obs_data_array_push_back(ccp, obj);
|
||||
}
|
||||
}
|
||||
|
||||
obs_data_set_array(settings, "CameraControl", ccp);
|
||||
properties.clear();
|
||||
|
||||
OBSDataArrayAutoRelease vpap = obs_data_array_create();
|
||||
|
||||
if (device.GetVideoProcAmpProperties(properties)) {
|
||||
for (const auto property : properties) {
|
||||
OBSDataAutoRelease obj = obs_data_create();
|
||||
obs_data_set_int(obj, "property", property.property);
|
||||
obs_data_set_int(obj, "flags", property.flags);
|
||||
obs_data_set_int(obj, "val", property.val);
|
||||
obs_data_array_push_back(vpap, obj);
|
||||
}
|
||||
}
|
||||
|
||||
obs_data_set_array(settings, "VideoProcAmp", vpap);
|
||||
|
||||
SetEvent(saved_event);
|
||||
}
|
||||
|
||||
bool DShowInput::UpdateAudioConfig(obs_data_t *settings)
|
||||
{
|
||||
string audio_device_id = obs_data_get_string(settings, AUDIO_DEVICE_ID);
|
||||
|
@ -1262,11 +1155,6 @@ inline bool DShowInput::Activate(obs_data_t *settings)
|
|||
if (device.Start() != Result::Success)
|
||||
return false;
|
||||
|
||||
if (!UpdateVideoProperties(settings)) {
|
||||
blog(LOG_WARNING, "%s: Setting video device properties failed",
|
||||
obs_source_get_name(source));
|
||||
}
|
||||
|
||||
const enum video_colorspace cs = GetColorSpace(settings);
|
||||
const enum video_range_type range = GetColorRange(settings);
|
||||
|
||||
|
@ -1351,16 +1239,6 @@ static void UpdateDShowInput(void *data, obs_data_t *settings)
|
|||
input->QueueActivate(settings);
|
||||
}
|
||||
|
||||
static void SaveDShowInput(void *data, obs_data_t *settings)
|
||||
{
|
||||
DShowInput *input = reinterpret_cast<DShowInput *>(data);
|
||||
if (!input->active)
|
||||
return;
|
||||
|
||||
input->QueueAction(Action::SaveSettings);
|
||||
WaitForSingleObject(input->saved_event, INFINITE);
|
||||
}
|
||||
|
||||
static void GetDShowDefaults(obs_data_t *settings)
|
||||
{
|
||||
obs_data_set_default_int(settings, FRAME_INTERVAL, FPS_MATCHING);
|
||||
|
@ -2223,7 +2101,6 @@ void RegisterDShowSource()
|
|||
info.update = UpdateDShowInput;
|
||||
info.get_defaults = GetDShowDefaults;
|
||||
info.get_properties = GetDShowProperties;
|
||||
info.save = SaveDShowInput;
|
||||
info.icon_type = OBS_ICON_TYPE_CAMERA;
|
||||
obs_register_source(&info);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue