mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-08-28 17:42:28 +08:00
plugins: Apply clang-format 22 formatting
This commit is contained in:
@@ -148,8 +148,7 @@ template<typename T> using cf_ptr = unique_ptr<typename remove_pointer<T>::type>
|
||||
#ifndef _MSC_VER
|
||||
__attribute__((__format__(__printf__, 3, 4)))
|
||||
#endif
|
||||
static void
|
||||
log_to_dstr(DStr &str, ca_encoder *ca, const char *fmt, ...)
|
||||
static void log_to_dstr(DStr &str, ca_encoder *ca, const char *fmt, ...)
|
||||
{
|
||||
dstr prev_str = *static_cast<dstr *>(str);
|
||||
|
||||
|
||||
@@ -400,8 +400,9 @@ static bool load_lib(void)
|
||||
/* attempt to load from path */
|
||||
|
||||
audio_toolbox = LoadLibraryExW(L"CoreAudioToolbox.dll", NULL, LOAD_LIBRARY_SAFE_CURRENT_DIRS);
|
||||
if (!!audio_toolbox)
|
||||
if (!!audio_toolbox) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
/* attempt to load from known install locations */
|
||||
@@ -446,8 +447,9 @@ static void unload_core_audio(void)
|
||||
#endif
|
||||
static bool load_core_audio(void)
|
||||
{
|
||||
if (!load_lib())
|
||||
if (!load_lib()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
#define LOAD_SYM_FROM_LIB(sym, lib, dll) \
|
||||
if (!(sym = (sym##_t)GetProcAddress(lib, #sym))) { \
|
||||
|
||||
@@ -164,7 +164,8 @@ struct dstr xcomp_window_name(xcb_connection_t *conn, Display *disp, xcb_window_
|
||||
}
|
||||
if (name->type == ATOM_COMPOUND_TEXT) { // LibX11 is the only decoder for these.
|
||||
XTextProperty xname = {
|
||||
(unsigned char *)data, name->type,
|
||||
(unsigned char *)data,
|
||||
name->type,
|
||||
8, // 8 by definition.
|
||||
1, // Only decode the first element of string arrays.
|
||||
};
|
||||
|
||||
@@ -1324,7 +1324,7 @@ static const UInt32 kMaxFrameRateRangesInDescription = 10;
|
||||
if (frame->format != VIDEO_FORMAT_NONE && frame->format != videoFormat) {
|
||||
[self AVCaptureLog:LOG_DEBUG
|
||||
withFormat:@"Switching fourcc: '%@' (0x%x) -> '%@' (0x%x)",
|
||||
[OBSAVCapture stringFromFourCharCode:frame->format], frame -> format,
|
||||
[OBSAVCapture stringFromFourCharCode:frame->format], frame->format,
|
||||
[OBSAVCapture stringFromFourCharCode:mediaSubType], mediaSubType];
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1257,9 +1257,14 @@ static NSArray *presets(void)
|
||||
return @[
|
||||
//AVCaptureSessionPresetiFrame1280x720,
|
||||
//AVCaptureSessionPresetiFrame960x540,
|
||||
AVCaptureSessionPreset3840x2160, AVCaptureSessionPreset1920x1080, AVCaptureSessionPreset1280x720,
|
||||
AVCaptureSessionPreset960x540, AVCaptureSessionPreset640x480, AVCaptureSessionPreset352x288,
|
||||
AVCaptureSessionPreset320x240, AVCaptureSessionPresetHigh,
|
||||
AVCaptureSessionPreset3840x2160,
|
||||
AVCaptureSessionPreset1920x1080,
|
||||
AVCaptureSessionPreset1280x720,
|
||||
AVCaptureSessionPreset960x540,
|
||||
AVCaptureSessionPreset640x480,
|
||||
AVCaptureSessionPreset352x288,
|
||||
AVCaptureSessionPreset320x240,
|
||||
AVCaptureSessionPresetHigh,
|
||||
//AVCaptureSessionPresetMedium,
|
||||
//AVCaptureSessionPresetLow,
|
||||
//AVCaptureSessionPresetPhoto,
|
||||
|
||||
@@ -19,8 +19,9 @@ struct device_list {
|
||||
|
||||
static inline void device_list_free(struct device_list *list)
|
||||
{
|
||||
for (size_t i = 0; i < list->items.num; i++)
|
||||
for (size_t i = 0; i < list->items.num; i++) {
|
||||
device_item_free(list->items.array + i);
|
||||
}
|
||||
|
||||
da_free(list->items);
|
||||
}
|
||||
|
||||
@@ -349,8 +349,8 @@ static CMIOHardwarePlugInInterface sInterface = {
|
||||
NULL,
|
||||
|
||||
// IUnknown Routines
|
||||
(HRESULT (*)(void *, CFUUIDBytes, void **)) HardwarePlugIn_QueryInterface, (ULONG(*)(void *)) HardwarePlugIn_AddRef,
|
||||
(ULONG(*)(void *)) HardwarePlugIn_Release,
|
||||
(HRESULT (*)(void *, CFUUIDBytes, void **)) HardwarePlugIn_QueryInterface,
|
||||
(ULONG (*)(void *)) HardwarePlugIn_AddRef, (ULONG (*)(void *)) HardwarePlugIn_Release,
|
||||
|
||||
// DAL Plug-In Routines
|
||||
HardwarePlugIn_Initialize, HardwarePlugIn_InitializeWithObjectID, HardwarePlugIn_Teardown,
|
||||
|
||||
@@ -113,28 +113,28 @@ typedef void SRT_LOG_HANDLER_FN(void *opaque, int level, const char *file, int l
|
||||
const char *message);
|
||||
|
||||
#ifdef __cplusplus
|
||||
namespace srt_logging {
|
||||
namespace srt_logging
|
||||
{
|
||||
|
||||
struct LogFA {
|
||||
private:
|
||||
int value;
|
||||
struct LogFA {
|
||||
private : int value;
|
||||
|
||||
public:
|
||||
operator int() const { return value; }
|
||||
public : operator int() const { return value; }
|
||||
|
||||
LogFA(int v) : value(v) {}
|
||||
};
|
||||
LogFA(int v) : value(v) {}
|
||||
};
|
||||
|
||||
const LogFA LOGFA_GENERAL = 0;
|
||||
const LogFA LOGFA_GENERAL = 0;
|
||||
|
||||
namespace LogLevel {
|
||||
enum type {
|
||||
fatal = LOG_CRIT,
|
||||
error = LOG_ERR,
|
||||
warning = 4, //issue w/ libobs so LOG_WARNING is removed
|
||||
note = LOG_NOTICE,
|
||||
debug = 7 //issue w/ libobs so LOG_DEBUG is removed
|
||||
};
|
||||
}
|
||||
namespace LogLevel
|
||||
{
|
||||
enum type {
|
||||
fatal = LOG_CRIT,
|
||||
error = LOG_ERR,
|
||||
warning = 4, //issue w/ libobs so LOG_WARNING is removed
|
||||
note = LOG_NOTICE,
|
||||
debug = 7 //issue w/ libobs so LOG_DEBUG is removed
|
||||
};
|
||||
}
|
||||
} // namespace srt_logging
|
||||
#endif
|
||||
|
||||
@@ -305,6 +305,7 @@ static inline void get_colour_information(obs_encoder_t *enc, uint16_t *pri, uin
|
||||
|
||||
/* Chapter stubs (from libavformat/movenc.c) */
|
||||
|
||||
/* clang-format off */
|
||||
static const uint8_t TEXT_STUB_HEADER[] = {
|
||||
// TextSampleEntry
|
||||
0x00, 0x00, 0x00, 0x01, // displayFlags
|
||||
@@ -327,7 +328,6 @@ static const uint8_t TEXT_STUB_HEADER[] = {
|
||||
0x00, // font name length
|
||||
};
|
||||
|
||||
/* clang-format off */
|
||||
static const char CHAPTER_PKT_FOOTER[12] = {
|
||||
0x00, 0x00, 0x00, 0x0C,
|
||||
'e', 'n', 'c', 'd',
|
||||
|
||||
@@ -152,7 +152,7 @@ static enum window_capture_method choose_method(enum window_capture_method metho
|
||||
if (astrstri(current_class, *class) != NULL) {
|
||||
return METHOD_WGC;
|
||||
}
|
||||
class ++;
|
||||
class++;
|
||||
}
|
||||
|
||||
class = wgc_whole_match_classes;
|
||||
@@ -160,7 +160,7 @@ static enum window_capture_method choose_method(enum window_capture_method metho
|
||||
if (astrcmpi(current_class, *class) == 0) {
|
||||
return METHOD_WGC;
|
||||
}
|
||||
class ++;
|
||||
class++;
|
||||
}
|
||||
|
||||
return METHOD_BITBLT;
|
||||
|
||||
Reference in New Issue
Block a user