Set various thread names
Helps identify which threads are which when debugging
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user