clang-format: Increase column limit from 80 to 120
This commit is contained in:
parent
109f64c446
commit
a1fbf1015f
736 changed files with 22684 additions and 45435 deletions
|
|
@ -29,17 +29,16 @@ static void os_get_path_extension_test(void **state)
|
|||
{
|
||||
UNUSED_PARAMETER(state);
|
||||
|
||||
static struct testcase testcases[] = {
|
||||
{"/home/user/a.txt", ".txt"},
|
||||
{"C:\\Users\\user\\Documents\\video.mp4", ".mp4"},
|
||||
{"./\\", NULL},
|
||||
{".\\/", NULL},
|
||||
{"/.\\", NULL},
|
||||
{"/\\.", "."},
|
||||
{"\\/.", "."},
|
||||
{"\\./", NULL},
|
||||
{"", NULL},
|
||||
{NULL, NULL}};
|
||||
static struct testcase testcases[] = {{"/home/user/a.txt", ".txt"},
|
||||
{"C:\\Users\\user\\Documents\\video.mp4", ".mp4"},
|
||||
{"./\\", NULL},
|
||||
{".\\/", NULL},
|
||||
{"/.\\", NULL},
|
||||
{"/\\.", "."},
|
||||
{"\\/.", "."},
|
||||
{"\\./", NULL},
|
||||
{"", NULL},
|
||||
{NULL, NULL}};
|
||||
|
||||
run_testcases(testcases);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,8 +18,7 @@ static const int cy = 600;
|
|||
|
||||
template<typename T, typename D_T, D_T D> struct OBSUniqueHandle : std::unique_ptr<T, std::function<D_T>> {
|
||||
using base = std::unique_ptr<T, std::function<D_T>>;
|
||||
explicit OBSUniqueHandle(T *obj = nullptr) : base(obj, D)
|
||||
{}
|
||||
explicit OBSUniqueHandle(T *obj = nullptr) : base(obj, D) {}
|
||||
operator T *()
|
||||
{
|
||||
return base::get();
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@ static const double aud_rates[CYCLE_COUNT] = {
|
|||
};
|
||||
|
||||
#define MAKE_COL_CHAN(x, y) (((0xFF / 7) * x) << (y * 8))
|
||||
#define MAKE_GRAYSCALE(x) \
|
||||
(MAKE_COL_CHAN(x, 0) | MAKE_COL_CHAN(x, 1) | MAKE_COL_CHAN(x, 2))
|
||||
#define MAKE_GRAYSCALE(x) (MAKE_COL_CHAN(x, 0) | MAKE_COL_CHAN(x, 1) | MAKE_COL_CHAN(x, 2))
|
||||
|
||||
static const uint32_t vid_colors[CYCLE_COUNT] = {
|
||||
0xFF000000,
|
||||
|
|
@ -120,8 +119,7 @@ static void *video_thread(void *data)
|
|||
/* should cause approximately 750 milliseconds of audio
|
||||
* buffering */
|
||||
frame.timestamp = cur_time - start_time;
|
||||
audio.timestamp = cur_time - start_time -
|
||||
(audio_buffering_enabled ? 1000000000 : 0);
|
||||
audio.timestamp = cur_time - start_time - (audio_buffering_enabled ? 1000000000 : 0);
|
||||
|
||||
const double rate = aud_rates[cur_aud_pos];
|
||||
|
||||
|
|
@ -150,8 +148,7 @@ static void *video_thread(void *data)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void bast_buffer_audio(void *data, obs_hotkey_id id,
|
||||
obs_hotkey_t *hotkey, bool pressed)
|
||||
static void bast_buffer_audio(void *data, obs_hotkey_id id, obs_hotkey_t *hotkey, bool pressed)
|
||||
{
|
||||
struct buffering_async_sync_test *bast = data;
|
||||
|
||||
|
|
@ -177,8 +174,7 @@ static void *bast_create(obs_data_t *settings, obs_source_t *source)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
obs_hotkey_register_source(source, "AudioBufferingSyncTest.Buffer",
|
||||
"Buffer Audio", bast_buffer_audio, bast);
|
||||
obs_hotkey_register_source(source, "AudioBufferingSyncTest.Buffer", "Buffer Audio", bast_buffer_audio, bast);
|
||||
|
||||
bast->initialized = true;
|
||||
|
||||
|
|
|
|||
|
|
@ -23,8 +23,7 @@ static const double rate = 261.63 / 48000.0;
|
|||
|
||||
extern uint64_t starting_time;
|
||||
|
||||
static inline bool whitelist_time(uint64_t ts, uint64_t interval,
|
||||
uint64_t fps_num, uint64_t fps_den)
|
||||
static inline bool whitelist_time(uint64_t ts, uint64_t interval, uint64_t fps_num, uint64_t fps_den)
|
||||
{
|
||||
if (!starting_time)
|
||||
return false;
|
||||
|
|
@ -44,8 +43,7 @@ static void *sync_pair_aud_thread(void *pdata)
|
|||
float *samples = malloc(frames * sizeof(float));
|
||||
|
||||
uint64_t interval = video_output_get_frame_time(obs_get_video());
|
||||
const struct video_output_info *voi =
|
||||
video_output_get_info(obs_get_video());
|
||||
const struct video_output_info *voi = video_output_get_info(obs_get_video());
|
||||
uint64_t fps_num = voi->fps_num;
|
||||
uint64_t fps_den = voi->fps_den;
|
||||
|
||||
|
|
@ -54,9 +52,7 @@ static void *sync_pair_aud_thread(void *pdata)
|
|||
last_time = obs_get_video_frame_time();
|
||||
|
||||
for (uint64_t i = 0; i < frames; i++) {
|
||||
uint64_t ts =
|
||||
last_time +
|
||||
util_mul_div64(i, 1000000000ULL, sample_rate);
|
||||
uint64_t ts = last_time + util_mul_div64(i, 1000000000ULL, sample_rate);
|
||||
|
||||
if (whitelist_time(ts, interval, fps_num, fps_den)) {
|
||||
cos_val += rate * M_PI_X2;
|
||||
|
|
|
|||
|
|
@ -71,8 +71,7 @@ static void *sync_pair_vid_create(obs_data_t *settings, obs_source_t *source)
|
|||
return spv;
|
||||
}
|
||||
|
||||
static inline bool whitelist_time(uint64_t ts, uint64_t interval,
|
||||
uint64_t fps_num, uint64_t fps_den)
|
||||
static inline bool whitelist_time(uint64_t ts, uint64_t interval, uint64_t fps_num, uint64_t fps_den)
|
||||
{
|
||||
if (!starting_time)
|
||||
return false;
|
||||
|
|
@ -92,8 +91,7 @@ static void sync_pair_vid_render(void *data, gs_effect_t *effect)
|
|||
starting_time = ts;
|
||||
|
||||
uint64_t interval = video_output_get_frame_time(obs_get_video());
|
||||
const struct video_output_info *voi =
|
||||
video_output_get_info(obs_get_video());
|
||||
const struct video_output_info *voi = video_output_get_info(obs_get_video());
|
||||
uint64_t fps_num = voi->fps_num;
|
||||
uint64_t fps_den = voi->fps_den;
|
||||
|
||||
|
|
|
|||
|
|
@ -52,8 +52,7 @@ static void filter_render(void *data, gs_effect_t *effect)
|
|||
{
|
||||
struct test_filter *tf = data;
|
||||
|
||||
if (!obs_source_process_filter_begin(tf->source, GS_RGBA,
|
||||
OBS_ALLOW_DIRECT_RENDERING))
|
||||
if (!obs_source_process_filter_begin(tf->source, GS_RGBA, OBS_ALLOW_DIRECT_RENDERING))
|
||||
return;
|
||||
|
||||
obs_source_process_filter_end(tf->source, tf->whatever, 0, 0);
|
||||
|
|
|
|||
|
|
@ -47,8 +47,7 @@ public:
|
|||
|
||||
/* --------------------------------------------------- */
|
||||
|
||||
static LRESULT CALLBACK sceneProc(HWND hwnd, UINT message, WPARAM wParam,
|
||||
LPARAM lParam)
|
||||
static LRESULT CALLBACK sceneProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (message) {
|
||||
|
||||
|
|
@ -140,10 +139,8 @@ static HWND CreateTestWindow(HINSTANCE instance)
|
|||
if (!RegisterClass(&wc))
|
||||
return 0;
|
||||
|
||||
return CreateWindow(TEXT("bla"), TEXT("bla"),
|
||||
WS_OVERLAPPEDWINDOW | WS_VISIBLE, 1920 / 2 - cx / 2,
|
||||
1080 / 2 - cy / 2, cx, cy, NULL, NULL, instance,
|
||||
NULL);
|
||||
return CreateWindow(TEXT("bla"), TEXT("bla"), WS_OVERLAPPEDWINDOW | WS_VISIBLE, 1920 / 2 - cx / 2,
|
||||
1080 / 2 - cy / 2, cx, cy, NULL, NULL, instance, NULL);
|
||||
}
|
||||
|
||||
/* --------------------------------------------------- */
|
||||
|
|
@ -159,8 +156,7 @@ static void RenderWindow(void *data, uint32_t cx, uint32_t cy)
|
|||
|
||||
/* --------------------------------------------------- */
|
||||
|
||||
int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine,
|
||||
int numCmd)
|
||||
int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine, int numCmd)
|
||||
{
|
||||
HWND hwnd = NULL;
|
||||
base_set_log_handler(do_log, nullptr);
|
||||
|
|
@ -180,15 +176,13 @@ int WINAPI WinMain(HINSTANCE instance, HINSTANCE prevInstance, LPSTR cmdLine,
|
|||
|
||||
/* ------------------------------------------------------ */
|
||||
/* create source */
|
||||
SourceContext source = obs_source_create(
|
||||
"random", "some randon source", NULL, nullptr);
|
||||
SourceContext source = obs_source_create("random", "some randon source", NULL, nullptr);
|
||||
if (!source)
|
||||
throw "Couldn't create random test source";
|
||||
|
||||
/* ------------------------------------------------------ */
|
||||
/* create filter */
|
||||
SourceContext filter = obs_source_create(
|
||||
"test_filter", "a nice green filter", NULL, nullptr);
|
||||
SourceContext filter = obs_source_create("test_filter", "a nice green filter", NULL, nullptr);
|
||||
if (!filter)
|
||||
throw "Couldn't create test filter";
|
||||
obs_source_filter_add(source, filter);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue