libobs: Pump Win32 messages on the graphics thread

Necessary for upcoming Windows Graphics Capture support.
This commit is contained in:
jpark37 2019-11-27 16:38:35 -08:00 committed by jp9000
parent f27f858ab3
commit 82cdc6e8c6

View file

@ -24,6 +24,11 @@
#include "media-io/format-conversion.h"
#include "media-io/video-frame.h"
#ifdef _WIN32
#define WIN32_MEAN_AND_LEAN
#include <windows.h>
#endif
static uint64_t tick_sources(uint64_t cur_time, uint64_t last_time)
{
struct obs_core_data *data = &obs->data;
@ -874,6 +879,14 @@ void *obs_graphics_thread(void *param)
last_time = tick_sources(obs->video.video_time, last_time);
profile_end(tick_sources_name);
#ifdef _WIN32
MSG msg;
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
#endif
profile_start(output_frame_name);
output_frame(raw_active, gpu_active);
profile_end(output_frame_name);