Set various thread names
Helps identify which threads are which when debugging
This commit is contained in:
parent
144fb925ff
commit
f93b2fe794
@ -354,6 +354,8 @@ static void *audio_thread(void *param)
|
||||
uint64_t prev_time = os_gettime_ns() - buffer_time;
|
||||
uint64_t audio_time;
|
||||
|
||||
os_set_thread_name("audio-io: audio thread");
|
||||
|
||||
while (os_event_try(audio->stop_event) == EAGAIN) {
|
||||
os_sleep_ms(AUDIO_WAIT_TIME);
|
||||
|
||||
|
@ -160,6 +160,8 @@ static void *video_thread(void *param)
|
||||
{
|
||||
struct video_output *video = param;
|
||||
|
||||
os_set_thread_name("video-io: video thread");
|
||||
|
||||
while (os_sem_wait(video->update_semaphore) == 0) {
|
||||
if (video->stop)
|
||||
break;
|
||||
|
@ -537,6 +537,8 @@ void *obs_video_thread(void *param)
|
||||
uint64_t cur_time = os_gettime_ns();
|
||||
uint64_t interval = video_output_get_frame_time(obs->video.video);
|
||||
|
||||
os_set_thread_name("libobs: graphics thread");
|
||||
|
||||
while (!video_output_stopped(obs->video.video)) {
|
||||
last_time = tick_sources(cur_time, last_time);
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
#include <util/dstr.hpp>
|
||||
#include <util/platform.h>
|
||||
#include <util/windows/WinHandle.hpp>
|
||||
#include <util/threading.h>
|
||||
#include "libdshowcapture/dshowcapture.hpp"
|
||||
#include "ffmpeg-decode.h"
|
||||
#include "encode-dstr.hpp"
|
||||
@ -225,6 +226,8 @@ static DWORD CALLBACK DShowThread(LPVOID ptr)
|
||||
{
|
||||
DShowInput *dshowInput = (DShowInput*)ptr;
|
||||
|
||||
os_set_thread_name("win-dshow: DShowThread");
|
||||
|
||||
CoInitialize(nullptr);
|
||||
dshowInput->DShowLoop();
|
||||
CoUninitialize();
|
||||
|
@ -6,6 +6,7 @@
|
||||
#include <util/windows/ComPtr.hpp>
|
||||
#include <util/windows/WinHandle.hpp>
|
||||
#include <util/windows/CoTaskMemPtr.hpp>
|
||||
#include <util/threading.h>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -313,6 +314,8 @@ DWORD WINAPI WASAPISource::ReconnectThread(LPVOID param)
|
||||
{
|
||||
WASAPISource *source = (WASAPISource*)param;
|
||||
|
||||
os_set_thread_name("win-wasapi: reconnect thread");
|
||||
|
||||
while (!WaitForSignal(source->stopSignal, RECONNECT_INTERVAL)) {
|
||||
if (source->TryInitialize())
|
||||
break;
|
||||
@ -396,6 +399,8 @@ DWORD WINAPI WASAPISource::CaptureThread(LPVOID param)
|
||||
source->stopSignal
|
||||
};
|
||||
|
||||
os_set_thread_name("win-wasapi: capture thread");
|
||||
|
||||
while (WaitForCaptureSignal(2, sigs, dur)) {
|
||||
if (!source->ProcessCaptureData()) {
|
||||
reconnect = true;
|
||||
|
Loading…
x
Reference in New Issue
Block a user