mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-06-30 08:33:32 +00:00
Update source code formatting with clang-format 17.0.3
Added SCDisplayRef type alias to fix a quirk of this specific clang-format version with ObjC block syntax.
This commit is contained in:
parent
dd3255815c
commit
f4733ec6a2
2
UI/obf.c
2
UI/obf.c
|
@ -1,7 +1,7 @@
|
|||
#include "obf.h"
|
||||
#include <stdbool.h>
|
||||
|
||||
#define LOWER_HALFBYTE(x) ((x)&0xF)
|
||||
#define LOWER_HALFBYTE(x) ((x) & 0xF)
|
||||
#define UPPER_HALFBYTE(x) (((x) >> 4) & 0xF)
|
||||
|
||||
void deobfuscate_str(char *str, uint64_t val)
|
||||
|
|
|
@ -28,8 +28,8 @@ extern "C" {
|
|||
#define M_PI 3.1415926535897932384626433832795f
|
||||
#endif
|
||||
|
||||
#define RAD(val) ((val)*0.0174532925199432957692369076848f)
|
||||
#define DEG(val) ((val)*57.295779513082320876798154814105f)
|
||||
#define RAD(val) ((val) * 0.0174532925199432957692369076848f)
|
||||
#define DEG(val) ((val) * 57.295779513082320876798154814105f)
|
||||
#define LARGE_EPSILON 1e-2f
|
||||
#define EPSILON 1e-4f
|
||||
#define TINY_EPSILON 1e-5f
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <windows.h>
|
||||
#include "obfuscate.h"
|
||||
|
||||
#define LOWER_HALFBYTE(x) ((x)&0xF)
|
||||
#define LOWER_HALFBYTE(x) ((x) & 0xF)
|
||||
#define UPPER_HALFBYTE(x) (((x) >> 4) & 0xF)
|
||||
|
||||
static void deobfuscate_str(char *str, uint64_t val)
|
||||
|
|
|
@ -68,8 +68,7 @@ static bool init_audio_screen_stream(struct screen_capture *sc)
|
|||
sc->stream_properties = [[SCStreamConfiguration alloc] init];
|
||||
os_sem_wait(sc->shareable_content_available);
|
||||
|
||||
SCDisplay * (^get_target_display)(void) = ^SCDisplay *
|
||||
{
|
||||
SCDisplayRef (^get_target_display)(void) = ^SCDisplayRef {
|
||||
for (SCDisplay *display in sc->shareable_content.displays) {
|
||||
if (display.displayID == sc->display) {
|
||||
return display;
|
||||
|
|
|
@ -28,6 +28,8 @@ typedef enum {
|
|||
ScreenCaptureAudioApplicationStream = 1,
|
||||
} ScreenCaptureAudioStreamType;
|
||||
|
||||
typedef SCDisplay *SCDisplayRef;
|
||||
|
||||
@interface ScreenCaptureDelegate : NSObject <SCStreamOutput, SCStreamDelegate>
|
||||
|
||||
@property struct screen_capture *sc;
|
||||
|
|
|
@ -86,8 +86,7 @@ static bool init_screen_stream(struct screen_capture *sc)
|
|||
sc->stream_properties = [[SCStreamConfiguration alloc] init];
|
||||
os_sem_wait(sc->shareable_content_available);
|
||||
|
||||
SCDisplay * (^get_target_display)(void) = ^SCDisplay *
|
||||
{
|
||||
SCDisplayRef (^get_target_display)(void) = ^SCDisplayRef {
|
||||
for (SCDisplay *display in sc->shareable_content.displays) {
|
||||
if (display.displayID == sc->display) {
|
||||
return display;
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
#define RIST_MAX_PAYLOAD_SIZE (10000 - 28)
|
||||
|
||||
#define FF_LIBRIST_MAKE_VERSION(major, minor, patch) \
|
||||
((patch) + ((minor)*0x100) + ((major)*0x10000))
|
||||
((patch) + ((minor) * 0x100) + ((major) * 0x10000))
|
||||
#define FF_LIBRIST_VERSION \
|
||||
FF_LIBRIST_MAKE_VERSION(LIBRIST_API_VERSION_MAJOR, \
|
||||
LIBRIST_API_VERSION_MINOR, \
|
||||
|
|
|
@ -46,7 +46,7 @@ typedef struct URLContext {
|
|||
//#define LOG_DEBUG 7 // issue w/ libobs
|
||||
#define LOG_PRIMASK 0x07
|
||||
|
||||
#define LOG_PRI(p) ((p)&LOG_PRIMASK)
|
||||
#define LOG_PRI(p) ((p) & LOG_PRIMASK)
|
||||
#define LOG_MAKEPRI(fac, pri) (((fac) << 3) | (pri))
|
||||
|
||||
#define LOG_KERN (0 << 3)
|
||||
|
@ -74,7 +74,7 @@ typedef struct URLContext {
|
|||
|
||||
#define LOG_NFACILITIES 24
|
||||
#define LOG_FACMASK 0x03f8
|
||||
#define LOG_FAC(p) (((p)&LOG_FACMASK) >> 3)
|
||||
#define LOG_FAC(p) (((p) & LOG_FACMASK) >> 3)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
|
|
@ -179,9 +179,9 @@ static bool load_libvlc_module(void)
|
|||
RegCloseKey(key);
|
||||
#else
|
||||
|
||||
/* According to otoolo -L, this is what libvlc.dylib wants. */
|
||||
#ifdef __APPLE__
|
||||
#define LIBVLC_DIR "/Applications/VLC.app/Contents/MacOS/"
|
||||
/* According to otoolo -L, this is what libvlc.dylib wants. */
|
||||
#define LIBVLC_CORE_FILE LIBVLC_DIR "lib/libvlccore.dylib"
|
||||
#define LIBVLC_FILE LIBVLC_DIR "lib/libvlc.5.dylib"
|
||||
setenv("VLC_PLUGIN_PATH", LIBVLC_DIR "plugins", false);
|
||||
|
|
|
@ -2213,6 +2213,7 @@ static void VKAPI_CALL OBS_DestroySurfaceKHR(VkInstance inst, VkSurfaceKHR surf,
|
|||
destroy_surface(inst, surf, ac);
|
||||
}
|
||||
|
||||
/* clang-format off */
|
||||
#define GETPROCADDR(func) \
|
||||
if (!strcmp(pName, "vk" #func)) \
|
||||
return (PFN_vkVoidFunction)&OBS_##func;
|
||||
|
@ -2220,6 +2221,7 @@ static void VKAPI_CALL OBS_DestroySurfaceKHR(VkInstance inst, VkSurfaceKHR surf,
|
|||
#define GETPROCADDR_IF_SUPPORTED(func) \
|
||||
if (!strcmp(pName, "vk" #func)) \
|
||||
return funcs->func ? (PFN_vkVoidFunction)&OBS_##func : NULL;
|
||||
/* clang-format on */
|
||||
|
||||
static PFN_vkVoidFunction VKAPI_CALL OBS_GetDeviceProcAddr(VkDevice device,
|
||||
const char *pName)
|
||||
|
|
|
@ -1308,7 +1308,7 @@ static inline void AddCap(vector<Resolution> &resolutions, const VideoInfo &cap)
|
|||
}
|
||||
|
||||
#define MAKE_DSHOW_FPS(fps) (10000000LL / (fps))
|
||||
#define MAKE_DSHOW_FRACTIONAL_FPS(den, num) ((num)*10000000LL / (den))
|
||||
#define MAKE_DSHOW_FRACTIONAL_FPS(den, num) ((num) * 10000000LL / (den))
|
||||
|
||||
static long long GetOBSFPS()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue