-
-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Architecture: adding windows on ARM support #10997
base: master
Are you sure you want to change the base?
Architecture: adding windows on ARM support #10997
Conversation
Unless you have tested QSV with your arm devices you should drop the proposed changes there and ensure the plugin is not built for arm. |
Please reword the PR as "adding Windows on ARM support", we already support ARM64 on macOS and OBS can be built on Linux aarch64. Also there is no CI build check which does not help to avoid/find build issue on WoA, which is not good at all since not all contributors will have WoA machines to check if it builds. Edit: Also, read our contribution guidelines and split your commits. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please actually read through the contributing document. Changes for different modules/components should be in separate commits. Also the motivation leaves a lot to be desired, there isn't really any explanation for why some of those changes were made/deemed necessary.
UI/volume-control.cpp
Outdated
#if defined(_M_ARM64) | ||
constexpr int min = (std::numeric_limits<int>::min)(); | ||
constexpr int max = (std::numeric_limits<int>::max)(); | ||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the reason for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change was made to address compilation errors related to the use of std::numeric_limits<int>::min()
and std::numeric_limits<int>::max()
. The ()
are included to ensure that we are explicitly invoking the functions from the <limits>
header rather than the macros that are defined.
This approach is derived from a previous PR #5455 that addressed a similar Issue.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like our options are to #define NOMINMAX
whenever doing #include <Windows.h>
in C++ files (and making sure there are no issues), using this syntax all the time, or this (only using this syntax within an appropriate ifdef).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using ()
explicitly the code ensures clarity and avoids macro conflicts. This inline change only affects the particular line if broken, making it a localized fix.
Defining NOMINMAX
affects the entire file, meaning any legitimate use of the min
and max
macros would be disabled throughout the file. This could lead to potential issues elsewhere in the code where the min
and max
macros might be needed.
Introducing conditional statements for this purpose adds redundancy and complexity to the code. It again adds ()
only in specific conditions, which can make the code harder to maintain and understand.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I cannot think of legitimate uses of the min
and max
macros unless you're working with specific Windows headers that require them (such as perhaps GdiPlus headers, which we only use in two places).
The change shown in this review had already introduced conditional preprocessor statements here. The example you linked to unconditionally adds ()
. Unfortunately, this code preview was outdated, and I had not seen that the code was changed to unconditionally add ()
, which is what I was trying to hint at.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thirumalai-qcom, OBS Studio is a multi-platform application which relies on common API like the C library API (a.k.a. libc) and the C++ library API (a.k.a. C++ STL).
As it is, the min
and max
macro that are not part of the common C/C++ APIs. And moreover it interferes with the C++ STL that is multi-platform.
Defining NOMINMAX
is almost mandatory to make sure that the same C/C++ APIs is present on the 3 main platforms.
Those macros are not a thing on macOS or Linux, so disabling is simpler and more sensible than making workaround for macros that OBS multi-platform code will never use.
Edit: Also defines are scoped so they can be set to not affect other headers if needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RytoEX Could you share your thoughts on which approach to implement here? Should we continue using the ()
explicitly, or would it be more efficient to define NOMINMAX
given the context of OBS Studio's multi-platform nature?
UI/obs-app.cpp
Outdated
#if defined(_M_ARM64) | ||
#include <shellapi.h> | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this even used anywhere? It should also be included through windows.h
anyway unless WIN32_LEAN_AND_MEAN
is defined.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This header is used by the ShellExecuteA()
function in obs-app.cpp
.
Line 2926 in 5854f3b
ShellExecuteA(NULL, "open", vcRunInstallerUrl, NULL, NULL, |
As WIN32_LEAN_AND_MEAN
is defined, shellapi.h
is not included by windows.h
. By explicitly including shellapi.h
, we ensure that sources get compiled, preventing compilation errors.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UI/window-basic-preview.cpp
Outdated
#if defined(_M_ARM64) | ||
if (x1 < x2) { | ||
dx = (std::min)(xx1 + 7.5f * offX, x2); | ||
} else { | ||
dx = (std::max)(xx1 + 7.5f * offX, x2); | ||
} | ||
if (y1 < y2) { | ||
dy = (std::min)(yy1 + 7.5f * offY, y2); | ||
} else { | ||
dy = (std::max)(yy1 + 7.5f * offY, y2); | ||
} | ||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See previous comment about changes related to std::max
/std::min
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've provided a brief explanation about the std::max
/std::min
modifications in the previous comment. You can review it here
@@ -28,6 +28,9 @@ | |||
/* clang-format off */ | |||
|
|||
#define S_RATIO "ratio" | |||
#if defined(_M_ARM64) | |||
#undef S_THRESHOLD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this being undefined here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The #undef S_THRESHOLD
is necessary to avoid a macro redefinition warning.
This is because windows.h
, which includes winbase.h
, defines S_THRESHOLD
with a value of 1. Our source file requires S_THRESHOLD
to be defined as "threshold"
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like a namespace conflict (here S_
), the reasonable change would be to change all compressor-filter.c
S_
macros to something like FILTER_S_
in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The majority of the plugins use S_
as the prefix to define setting names. Changing the macro name makes the history dirty. I hope it can be fixed by a compile flag like WIN32_LEAN_AND_MEAN
. Though, IMHO, #undef
is reasonable if it cannot be resolved by any compile flags.
There are various ways in which the setting names are written among the 1st-party plugins. Unfortunately, the majority write string literals directly without macros. The 2nd place is S_
.
Besides this PR, I want to suggest the style should be unified among the plugins. In my opinion, SETTING_
, OPT_
, or PROP_
(no one uses this though) would be descriptive rather than S_
.
More than 34 plugins directly writing string literals
obs-studio/plugins/coreaudio-encoder/encoder.cpp
Lines 1375 to 1386 in ff2fa24
obs_property_t *sample_rates = obs_properties_add_list( props, "samplerate", obs_module_text("OutputSamplerate"), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_property_set_modified_callback(sample_rates, samplerate_updated); obs_property_t *bit_rates = obs_properties_add_list( props, "bitrate", obs_module_text("Bitrate"), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); obs_properties_add_bool(props, "allow he-aac", obs_module_text("AllowHEAAC")); obs-studio/plugins/image-source/color-source.c
Lines 22 to 24 in ff2fa24
uint32_t color = (uint32_t)obs_data_get_int(settings, "color"); uint32_t width = (uint32_t)obs_data_get_int(settings, "width"); uint32_t height = (uint32_t)obs_data_get_int(settings, "height"); obs-studio/plugins/image-source/image-source.c
Lines 104 to 107 in ff2fa24
const char *file = obs_data_get_string(settings, "file"); const bool unload = obs_data_get_bool(settings, "unload"); const bool linear_alpha = obs_data_get_bool(settings, "linear_alpha"); const bool is_slide = obs_data_get_bool(settings, "is_slide"); obs-studio/plugins/linux-alsa/alsa-input.c
Lines 190 to 201 in ff2fa24
device = obs_data_get_string(settings, "device_id"); if (strcmp(device, "__custom__") == 0) device = obs_data_get_string(settings, "custom_pcm"); if (strcmp(data->device, device) != 0) { bfree(data->device); data->device = bstrdup(device); reset = true; } rate = obs_data_get_int(settings, "rate"); obs-studio/plugins/linux-capture/xcomposite-input.c
Lines 855 to 863 in ff2fa24
s->crop_top = obs_data_get_int(settings, "cut_top"); s->crop_left = obs_data_get_int(settings, "cut_left"); s->crop_right = obs_data_get_int(settings, "cut_right"); s->crop_bot = obs_data_get_int(settings, "cut_bot"); s->show_cursor = obs_data_get_bool(settings, "show_cursor"); s->include_border = obs_data_get_bool(settings, "include_border"); s->exclude_alpha = obs_data_get_bool(settings, "exclude_alpha"); s->windowName = obs_data_get_string(settings, "capture_window"); obs-studio/plugins/linux-capture/xshm-input.c
Lines 275 to 283 in ff2fa24
data->screen_id = obs_data_get_int(settings, "screen"); data->show_cursor = obs_data_get_bool(settings, "show_cursor"); data->advanced = obs_data_get_bool(settings, "advanced"); data->server = bstrdup(obs_data_get_string(settings, "server")); data->cut_top = obs_data_get_int(settings, "cut_top"); data->cut_left = obs_data_get_int(settings, "cut_left"); data->cut_right = obs_data_get_int(settings, "cut_right"); data->cut_bot = obs_data_get_int(settings, "cut_bot"); obs-studio/plugins/linux-jack/jack-input.c
Lines 61 to 62 in ff2fa24
bool new_jack_start_server = obs_data_get_bool(settings, "startjack"); int new_channel_count = obs_data_get_int(settings, "channels"); obs-studio/plugins/linux-pipewire/camera-portal.c
Lines 1307 to 1330 in ff2fa24
device_list = obs_properties_add_list( props, "device_id", obs_module_text("PipeWireCameraDevice"), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING); format_list = obs_properties_add_list(props, "pixelformat", obs_module_text("VideoFormat"), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_INT); resolution_list = obs_properties_add_list(props, "resolution", obs_module_text("Resolution"), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING); framerate_list = obs_properties_add_list(props, "framerate", obs_module_text("FrameRate"), OBS_COMBO_TYPE_LIST, OBS_COMBO_FORMAT_STRING); // a group to contain the camera control controls_props = obs_properties_create(); obs_properties_add_group(props, "controls", obs_module_text("CameraControls"), OBS_GROUP_NORMAL, controls_props); obs-studio/plugins/linux-pipewire/screencast-portal.c
Lines 609 to 611 in ff2fa24
capture->cursor_visible = obs_data_get_bool(settings, "ShowCursor"); capture->restore_token = bstrdup(obs_data_get_string(settings, "RestoreToken")); new_device = obs_data_get_string(settings, "device_id"); obs-studio/plugins/linux-v4l2/v4l2-input.c
Lines 1154 to 1163 in ff2fa24
data->device_id = bstrdup(obs_data_get_string(settings, "device_id")); data->input = obs_data_get_int(settings, "input"); data->pixfmt = obs_data_get_int(settings, "pixelformat"); data->standard = obs_data_get_int(settings, "standard"); data->dv_timing = obs_data_get_int(settings, "dv_timing"); data->resolution = obs_data_get_int(settings, "resolution"); data->framerate = obs_data_get_int(settings, "framerate"); data->color_range = obs_data_get_int(settings, "color_range"); data->auto_reset = obs_data_get_bool(settings, "auto_reset"); data->timeout_frames = obs_data_get_int(settings, "timeout_frames"); obs-studio/plugins/mac-avcapture/plugin-properties.m
Lines 321 to 326 in ff2fa24
input_format = (int) obs_data_get_int(settings, "input_format"); inputFormats = [[NSMutableArray alloc] init]; if (!capture.isFastPath) { color_space = (int) obs_data_get_int(settings, "color_space"); video_range = (int) obs_data_get_int(settings, "video_range"); obs-studio/plugins/mac-videotoolbox/encoder.c
Lines 823 to 833 in ff2fa24
enc->keyint = (uint32_t)obs_data_get_int(settings, "keyint_sec"); enc->rate_control = obs_data_get_string(settings, "rate_control"); enc->bitrate = (uint32_t)obs_data_get_int(settings, "bitrate"); enc->quality = ((float)obs_data_get_int(settings, "quality")) / 100; enc->profile = obs_data_get_string(settings, "profile"); enc->limit_bitrate = obs_data_get_bool(settings, "limit_bitrate"); enc->rc_max_bitrate = (uint32_t)obs_data_get_int(settings, "max_bitrate"); enc->rc_max_bitrate_window = obs_data_get_double(settings, "max_bitrate_window"); enc->bframes = obs_data_get_bool(settings, "bframes"); - https://github.com/obsproject/obs-studio/blob/ff2fa24dc25519475687041ba6af829e9ba41335/plugins/obs-ffmpeg/obs-ffmpeg-av1.c#L69-73
keyint_sec = (int)obs_data_get_int(settings, "keyint_sec"); obs-studio/plugins/obs-ffmpeg/obs-ffmpeg-mpegts.c
Lines 976 to 977 in ff2fa24
config.video_bitrate = (int)obs_data_get_int(settings, "bitrate"); int keyint_sec = (int)obs_data_get_int(settings, "keyint_sec"); obs-studio/plugins/obs-ffmpeg/obs-nvenc.c
Lines 647 to 657 in ff2fa24
const char *rc = obs_data_get_string(settings, "rate_control"); int bitrate = (int)obs_data_get_int(settings, "bitrate"); int max_bitrate = (int)obs_data_get_int(settings, "max_bitrate"); int cqp = (int)obs_data_get_int(settings, "cqp"); int keyint_sec = (int)obs_data_get_int(settings, "keyint_sec"); const char *preset = obs_data_get_string(settings, "preset"); const char *preset2 = obs_data_get_string(settings, "preset2"); const char *tuning = obs_data_get_string(settings, "tune"); const char *multipass = obs_data_get_string(settings, "multipass"); const char *profile = obs_data_get_string(settings, "profile"); bool lookahead = obs_data_get_bool(settings, "lookahead"); obs-studio/plugins/obs-filters/crop-filter.c
Lines 76 to 82 in ff2fa24
filter->absolute = !obs_data_get_bool(settings, "relative"); filter->left = (int)obs_data_get_int(settings, "left"); filter->top = (int)obs_data_get_int(settings, "top"); filter->right = (int)obs_data_get_int(settings, "right"); filter->bottom = (int)obs_data_get_int(settings, "bottom"); filter->abs_cx = (int)obs_data_get_int(settings, "cx"); filter->abs_cy = (int)obs_data_get_int(settings, "cy"); obs-studio/plugins/obs-filters/eq-filter.c
Lines 47 to 49 in ff2fa24
eq->low_gain = db_to_mul((float)obs_data_get_double(settings, "low")); eq->mid_gain = db_to_mul((float)obs_data_get_double(settings, "mid")); eq->high_gain = db_to_mul((float)obs_data_get_double(settings, "high")); obs-studio/plugins/obs-filters/hdr-tonemap-filter.c
Lines 76 to 86 in ff2fa24
filter->transform = obs_data_get_int(settings, "transform"); filter->sdr_white_level_nits_i = 1.f / (float)obs_data_get_int(settings, "sdr_white_level_nits"); filter->hdr_input_maximum_nits = (float)obs_data_get_int(settings, "hdr_input_maximum_nits"); filter->hdr_output_maximum_nits = (float)obs_data_get_int(settings, "hdr_output_maximum_nits"); filter->sdr_input_maximum_nits = (float)obs_data_get_int(settings, "sdr_input_maximum_nits"); filter->sdr_output_maximum_nits = (float)obs_data_get_int(settings, "sdr_output_maximum_nits"); obs-studio/plugins/obs-filters/scroll-filter.c
Lines 79 to 89 in ff2fa24
filter->limit_cx = obs_data_get_bool(settings, "limit_cx"); filter->limit_cy = obs_data_get_bool(settings, "limit_cy"); filter->cx = (uint32_t)obs_data_get_int(settings, "cx"); filter->cy = (uint32_t)obs_data_get_int(settings, "cy"); filter->scroll_speed.x = (float)obs_data_get_double(settings, "speed_x"); filter->scroll_speed.y = (float)obs_data_get_double(settings, "speed_y"); filter->loop = obs_data_get_bool(settings, "loop"); double sharpness = obs_data_get_double(settings, "sharpness"); obs-studio/plugins/obs-libfdk/obs-libfdk.c
Lines 96 to 99 in ff2fa24
int bitrate = (int)obs_data_get_int(settings, "bitrate") * 1000; int afterburner = obs_data_get_bool(settings, "afterburner") ? 1 : 0; audio_t *audio = obs_encoder_audio(encoder); bool set_to_ADTS = obs_data_get_bool(settings, "set_to_ADTS"); obs-studio/plugins/obs-outputs/flv-mux.c
Line 139 in ff2fa24
double bitrate = obs_data_get_double(settings, "bitrate"); obs-studio/plugins/obs-outputs/flv-output.c
Line 509 in ff2fa24
path = obs_data_get_string(settings, "path"); obs-studio/plugins/obs-outputs/mp4-output.c
Lines 263 to 274 in ff2fa24
const char *path = obs_data_get_string(settings, "path"); dstr_copy(&out->path, path); out->max_time = obs_data_get_int(settings, "max_time_sec") * 1000000LL; out->max_size = obs_data_get_int(settings, "max_size_mb") * 1024 * 1024; out->split_file_enabled = obs_data_get_bool(settings, "split_file"); out->allow_overwrite = obs_data_get_bool(settings, "allow_overwrite"); out->cur_size = 0; /* Allow skipping the remux step for debugging purposes. */ const char *muxer_settings = obs_data_get_string(settings, "muxer_settings"); - https://github.com/obsproject/obs-studio/blob/ff2fa24dc25519475687041ba6af829e9ba41335/plugins/obs-qsv11/obs-qsv11.c#L262-344
- https://github.com/obsproject/obs-studio/blob/ff2fa24dc25519475687041ba6af829e9ba41335/plugins/obs-transitions/transition-stinger.c:#L70-L72
obs-studio/plugins/obs-x264/obs-x264.c
Lines 402 to 416 in ff2fa24
obs_data_get_string(settings, "rate_control"); int bitrate = (int)obs_data_get_int(settings, "bitrate"); int buffer_size = (int)obs_data_get_int(settings, "buffer_size"); int keyint_sec = (int)obs_data_get_int(settings, "keyint_sec"); int crf = (int)obs_data_get_int(settings, "crf"); int width = (int)obs_encoder_get_width(obsx264->encoder); int height = (int)obs_encoder_get_height(obsx264->encoder); int bf = (int)obs_data_get_int(settings, "bf"); bool use_bufsize = obs_data_get_bool(settings, "use_bufsize"); bool cbr_override = obs_data_get_bool(settings, "cbr"); enum rate_control rc; #ifdef ENABLE_VFR bool vfr = obs_data_get_bool(settings, "vfr"); - https://github.com/obsproject/obs-studio/blob/ff2fa24dc25519475687041ba6af829e9ba41335/plugins/text-freetype2/text-freetype2.c#L341-358
- https://github.com/obsproject/obs-studio/blob/ff2fa24dc25519475687041ba6af829e9ba41335/plugins/win-capture/duplicator-monitor-capture.c
- https://github.com/obsproject/obs-studio/blob/ff2fa24dc25519475687041ba6af829e9ba41335/plugins/win-capture/monitor-capture.c
- https://github.com/obsproject/obs-studio/blob/ff2fa24dc25519475687041ba6af829e9ba41335/plugins/win-capture/window-capture.c
- https://github.com/obsproject/obs-studio/blob/ff2fa24dc25519475687041ba6af829e9ba41335/plugins/win-dshow/win-dshow-encoder.cpp
Image slideshow uses static const char *
with the prefix S_
. (Probably, this is Lain's preference, isn't this?)
obs-studio/plugins/image-source/obs-slideshow-mk2.c
Lines 19 to 33 in ff2fa24
static const char *S_TR_SPEED = "transition_speed"; static const char *S_CUSTOM_SIZE = "use_custom_size"; static const char *S_SLIDE_TIME = "slide_time"; static const char *S_TRANSITION = "transition"; static const char *S_RANDOMIZE = "randomize"; static const char *S_LOOP = "loop"; static const char *S_HIDE = "hide"; static const char *S_FILES = "files"; static const char *S_BEHAVIOR = "playback_behavior"; static const char *S_BEHAVIOR_STOP_RESTART = "stop_restart"; static const char *S_BEHAVIOR_PAUSE_UNPAUSE = "pause_unpause"; static const char *S_BEHAVIOR_ALWAYS_PLAY = "always_play"; static const char *S_MODE = "slide_mode"; static const char *S_MODE_AUTO = "mode_auto"; static const char *S_MODE_MANUAL = "mode_manual";
15 plugins using macros with the prefix S_
obs-studio/plugins/obs-filters/compressor-filter.c
Lines 30 to 35 in ff2fa24
#define S_RATIO "ratio" #define S_THRESHOLD "threshold" #define S_ATTACK_TIME "attack_time" #define S_RELEASE_TIME "release_time" #define S_OUTPUT_GAIN "output_gain" #define S_SIDECHAIN_SOURCE "sidechain_source" obs-studio/plugins/obs-filters/expander-filter.c
Lines 30 to 37 in ff2fa24
#define S_RATIO "ratio" #define S_THRESHOLD "threshold" #define S_ATTACK_TIME "attack_time" #define S_RELEASE_TIME "release_time" #define S_OUTPUT_GAIN "output_gain" #define S_DETECTOR "detector" #define S_PRESETS "presets" #define S_KNEE "knee_width" #define S_GAIN_DB "db" #define S_DELAY_MS "delay_ms" obs-studio/plugins/obs-filters/limiter-filter.c
Lines 28 to 29 in ff2fa24
#define S_THRESHOLD "threshold" #define S_RELEASE_TIME "release_time" obs-studio/plugins/obs-filters/noise-gate-filter.c
Lines 14 to 18 in ff2fa24
#define S_OPEN_THRESHOLD "open_threshold" #define S_CLOSE_THRESHOLD "close_threshold" #define S_ATTACK_TIME "attack_time" #define S_HOLD_TIME "hold_time" #define S_RELEASE_TIME "release_time" obs-studio/plugins/obs-filters/noise-suppress-filter.c
Lines 43 to 50 in ff2fa24
#define S_SUPPRESS_LEVEL "suppress_level" #define S_NVAFX_INTENSITY "intensity" #define S_METHOD "method" #define S_METHOD_SPEEX "speex" #define S_METHOD_RNN "rnnoise" #define S_METHOD_NVAFX_DENOISER "denoiser" #define S_METHOD_NVAFX_DEREVERB "dereverb" #define S_METHOD_NVAFX_DEREVERB_DENOISER "dereverb_denoiser" obs-studio/plugins/obs-filters/nvidia-greenscreen-filter.c
Lines 25 to 30 in ff2fa24
#define S_MODE "mode" #define S_MODE_QUALITY 0 #define S_MODE_PERF 1 #define S_THRESHOLDFX "threshold" #define S_THRESHOLDFX_DEFAULT 1.0 #define S_PROCESSING "processing_interval" obs-studio/plugins/obs-filters/scale-filter.c
Lines 11 to 30 in ff2fa24
#define S_RESOLUTION "resolution" #define S_SAMPLING "sampling" #define S_UNDISTORT "undistort" #define T_RESOLUTION obs_module_text("Resolution") #define T_NONE obs_module_text("None") #define T_SAMPLING obs_module_text("ScaleFiltering") #define T_SAMPLING_POINT obs_module_text("ScaleFiltering.Point") #define T_SAMPLING_BILINEAR obs_module_text("ScaleFiltering.Bilinear") #define T_SAMPLING_BICUBIC obs_module_text("ScaleFiltering.Bicubic") #define T_SAMPLING_LANCZOS obs_module_text("ScaleFiltering.Lanczos") #define T_SAMPLING_AREA obs_module_text("ScaleFiltering.Area") #define T_UNDISTORT obs_module_text("UndistortCenter") #define T_BASE obs_module_text("Base.Canvas") #define S_SAMPLING_POINT "point" #define S_SAMPLING_BILINEAR "bilinear" #define S_SAMPLING_BICUBIC "bicubic" #define S_SAMPLING_LANCZOS "lanczos" #define S_SAMPLING_AREA "area" obs-studio/plugins/obs-text/gdiplus/obs-text.cpp
Lines 46 to 80 in ff2fa24
#define S_FONT "font" #define S_USE_FILE "read_from_file" #define S_FILE "file" #define S_TEXT "text" #define S_COLOR "color" #define S_GRADIENT "gradient" #define S_GRADIENT_COLOR "gradient_color" #define S_GRADIENT_DIR "gradient_dir" #define S_GRADIENT_OPACITY "gradient_opacity" #define S_ALIGN "align" #define S_VALIGN "valign" #define S_OPACITY "opacity" #define S_BKCOLOR "bk_color" #define S_BKOPACITY "bk_opacity" #define S_VERTICAL "vertical" #define S_OUTLINE "outline" #define S_OUTLINE_SIZE "outline_size" #define S_OUTLINE_COLOR "outline_color" #define S_OUTLINE_OPACITY "outline_opacity" #define S_CHATLOG_MODE "chatlog" #define S_CHATLOG_LINES "chatlog_lines" #define S_EXTENTS "extents" #define S_EXTENTS_WRAP "extents_wrap" #define S_EXTENTS_CX "extents_cx" #define S_EXTENTS_CY "extents_cy" #define S_TRANSFORM "transform" #define S_ANTIALIASING "antialiasing" #define S_ALIGN_LEFT "left" #define S_ALIGN_CENTER "center" #define S_ALIGN_RIGHT "right" #define S_VALIGN_TOP "top" #define S_VALIGN_CENTER S_ALIGN_CENTER #define S_VALIGN_BOTTOM "bottom" obs-studio/plugins/obs-transitions/transition-fade-to-color.c
Lines 3 to 7 in ff2fa24
#define S_COLOR "color" #define S_SWITCH_POINT "switch_point" #define S_COLOR_TEXT obs_module_text("Color") #define S_SWITCH_POINT_TEXT obs_module_text("SwitchPoint") obs-studio/plugins/obs-transitions/transition-luma-wipe.c
Lines 7 to 9 in ff2fa24
#define S_LUMA_IMG "luma_image" #define S_LUMA_INV "luma_invert" #define S_LUMA_SOFT "luma_softness" #define S_DIRECTION "direction" obs-studio/plugins/obs-transitions/transition-swipe.c
Lines 17 to 18 in ff2fa24
#define S_DIRECTION "direction" #define S_SWIPE_IN "swipe_in" obs-studio/plugins/vlc-video/vlc-video-source.c
Lines 15 to 25 in ff2fa24
#define S_PLAYLIST "playlist" #define S_LOOP "loop" #define S_SHUFFLE "shuffle" #define S_BEHAVIOR "playback_behavior" #define S_BEHAVIOR_STOP_RESTART "stop_restart" #define S_BEHAVIOR_PAUSE_UNPAUSE "pause_unpause" #define S_BEHAVIOR_ALWAYS_PLAY "always_play" #define S_NETWORK_CACHING "network_caching" #define S_TRACK "track" #define S_SUBTITLE_ENABLE "subtitle_enable" #define S_SUBTITLE_TRACK "subtitle"
9 plugins using macros with a prefix SETTING_
#define SETTING_DELAY_MS "delay_ms" obs-studio/plugins/obs-filters/chroma-key-filter.c
Lines 8 to 17 in ff2fa24
#define SETTING_SDR_ONLY_INFO "sdr_only_info" #define SETTING_OPACITY "opacity" #define SETTING_CONTRAST "contrast" #define SETTING_BRIGHTNESS "brightness" #define SETTING_GAMMA "gamma" #define SETTING_COLOR_TYPE "key_color_type" #define SETTING_KEY_COLOR "key_color" #define SETTING_SIMILARITY "similarity" #define SETTING_SMOOTHNESS "smoothness" #define SETTING_SPILL "spill" obs-studio/plugins/obs-filters/color-correction-filter.c
Lines 23 to 32 in ff2fa24
#define SETTING_SDR_ONLY_INFO "sdr_only_info" #define SETTING_GAMMA "gamma" #define SETTING_CONTRAST "contrast" #define SETTING_BRIGHTNESS "brightness" #define SETTING_SATURATION "saturation" #define SETTING_HUESHIFT "hue_shift" #define SETTING_OPACITY "opacity" #define SETTING_COLOR "color" #define SETTING_COLOR_MULTIPLY "color_multiply" #define SETTING_COLOR_ADD "color_add" obs-studio/plugins/obs-filters/color-grade-filter.c
Lines 9 to 12 in ff2fa24
#define SETTING_SDR_ONLY_INFO "sdr_only_info" #define SETTING_IMAGE_PATH "image_path" #define SETTING_CLUT_AMOUNT "clut_amount" #define SETTING_PASSTHROUGH_ALPHA "passthrough_alpha" - https://github.com/obsproject/obs-studio/blob/ff2fa24dc25519475687041ba6af829e9ba41335/plugins/obs-filters/color-key-filter.c#L9-12
- https://github.com/obsproject/obs-studio/blob/ff2fa24dc25519475687041ba6af829e9ba41335/plugins/obs-filters/color-key-filter.c
- https://github.com/obsproject/obs-studio/blob/ff2fa24dc25519475687041ba6af829e9ba41335/plugins/obs-filters/luma-key-filter.c
- https://github.com/obsproject/obs-studio/blob/ff2fa24dc25519475687041ba6af829e9ba41335/plugins/obs-filters/mask-filter.c
- https://github.com/obsproject/obs-studio/blob/ff2fa24dc25519475687041ba6af829e9ba41335/plugins/win-capture/game-capture.c
3 plugins using macros without prefix
obs-studio/plugins/decklink/const.h
Lines 1 to 17 in ff2fa24
#define DEVICE_HASH "device_hash" #define DEVICE_NAME "device_name" #define VIDEO_CONNECTION "video_connection" #define AUDIO_CONNECTION "audio_connection" #define MODE_ID "mode_id" #define MODE_NAME "mode_name" #define CHANNEL_FORMAT "channel_format" #define PIXEL_FORMAT "pixel_format" #define COLOR_SPACE "color_space" #define COLOR_RANGE "color_range" #define BUFFERING "buffering" #define DEACTIVATE_WNS "deactivate_when_not_showing" #define AUTO_START "auto_start" #define FORCE_SDR "force_sdr" #define KEYER "keyer" #define SWAP "swap" #define ALLOW_10_BIT "allow_10_bit" obs-studio/plugins/win-dshow/win-dshow.cpp
Lines 34 to 50 in ff2fa24
#define VIDEO_DEVICE_ID "video_device_id" #define RES_TYPE "res_type" #define RESOLUTION "resolution" #define FRAME_INTERVAL "frame_interval" #define VIDEO_FORMAT "video_format" #define LAST_VIDEO_DEV_ID "last_video_device_id" #define LAST_RESOLUTION "last_resolution" #define BUFFERING_VAL "buffering" #define FLIP_IMAGE "flip_vertically" #define AUDIO_OUTPUT_MODE "audio_output_mode" #define USE_CUSTOM_AUDIO "use_custom_audio_device" #define AUDIO_DEVICE_ID "audio_device_id" #define COLOR_SPACE "color_space" #define COLOR_RANGE "color_range" #define DEACTIVATE_WNS "deactivate_when_not_showing" #define AUTOROTATION "autorotation" #define HW_DECODE "hw_decode" obs-studio/plugins/win-wasapi/win-wasapi.cpp
Lines 27 to 30 in ff2fa24
#define OPT_DEVICE_ID "device_id" #define OPT_USE_DEVICE_TIMING "use_device_timing" #define OPT_WINDOW "window" #define OPT_PRIORITY "priority"
2 plugins using macros with a prefix OPT_
obs-studio/plugins/obs-outputs/rtmp-stream.c
Lines 26 to 34 in ff2fa24
#include <util/windows/win-version.h> #endif #ifndef SEC_TO_NSEC #define SEC_TO_NSEC 1000000000ULL #endif #ifndef MSEC_TO_USEC #define MSEC_TO_USEC 1000ULL obs-studio/plugins/win-wasapi/win-wasapi.cpp
Lines 27 to 30 in ff2fa24
#define OPT_DEVICE_ID "device_id" #define OPT_USE_DEVICE_TIMING "use_device_timing" #define OPT_WINDOW "window" #define OPT_PRIORITY "priority"
Only AJA plugin has a structure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changing the macro name makes the history dirty.
Undefining macros that are not ours is not a good idea either.
d7abd70
to
d2976cc
Compare
d2976cc
to
e28be95
Compare
The commit messages need to follow the guideline. https://github.com/obsproject/obs-studio/blob/master/CONTRIBUTING.rst#commit-guidelines |
Add shellapi.h to fix compilation error Update min/max to be used from limits header Ensure WIN32_LEAN_AND_MEAN is defined conditionally if not defined
Update w32-pthreads/context.h to include definitions for _M_ARM and _M_ARM64 in addition to existing ARM definitions.
Adjust obs-win-crash-handler.c to handle instruction pointers and stack traces, improving crash reporting on ARM64 systems.
To prevent warnings related to redefinition of the threshold macro, the previously defined threshold value is undefined when compiling for ARM64 architecture. This ensures that the code remains free of redundant macro redefinitions.
This change modifies the `ctz32` function to use `_CountTrailingZeros` when `_M_ARM64` is defined, as `_tzcnt_u32` is not available on WOA.
e28be95
to
ac0911d
Compare
@RytoEX I would like to know if AJA functionality is planned to be included in the Phase-1 release of the arm64 version of OBS. Currently, in AJA the Edit: Identified an alternative way to retrieve the CPU string from the register (as done in |
Poking @paulh-aja for AJA's current stats on ARM support. (sorry for double ping here, accidentally replied to the wrong comment!) |
My thinking on this would be that if there's an ARM64 equivalent to It may also be worth noting that the obs-qsv11 plugin also uses |
Please open a PR or at least raise an issue in the libajantv2 repo as RytoEX mentioned. We do not have Windows ARM support on our current release roadmap. However, if the only thing blocking it is replacing the use of |
Introduces Windows on ARM support to the OBS-studio application. This includes modifications that are guarded with ARM-specific macros to ensure compatibility without affecting the existing codebase.
Description
This pull request introduces several code refactoring changes to enhance WOA support and resolve conflicts in the OBS-Studio application. The key changes include:
shellapi.h
to fix compilation error, Updated min/max to be used fromlimits
header, EnsuredWIN32_LEAN_AND_MEAN
is defined conditionally if not defined._M_ARM
and_M_ARM64
.obs-win-crash-handler.c
to handle instruction pointers and stack traces, improving crash reporting on ARM64 systems .S_THRESHOLD
due to a conflicting existing macro with a numeric value.__tzcnt_u32()
with_CountTrailingZeros()
for ARM.Motivation and Context
The primary motivation for these changes is to expand compatibility with ARM architecture (windows) by addressing conflicts with existing macros and functions. By introducing ARM-specific macros and guarding ARM-specific code, we ensure that the application runs smoothly without affecting the existing codebase.
UI Changes:
Additional ARM definitions in deps/w32-pthreads/context.h:
Libobs changes:
Obs-filters changes:
S_THRESHOLD
if previously defined, then redefines it with a new value"threshold"
.Obs-outputs: Use _CountTrailingZeros() in ctz32
tzcnt_u32
with_CountTrailingZeros
to ensure compatibility with WOA machines.How Has This Been Tested?
The changes have been tested by building OBS Studio on an ARM machine (X Elite machine, Win11). All builds were successful, Basic functionality tests confirmed that the OBS Studio application with the modifications is functional.
Types of changes
Checklist: