virtualcam-module: Revert changes since 27.1.3 (for now)

This reverts commit 4b0767741a,
3f3f9ed7e6,
0e7c17bd6e, and
865eecb739.
master
jp9000 2022-03-02 17:28:23 -08:00
parent 4b0767741a
commit 490c6214f0
2 changed files with 6 additions and 58 deletions

View File

@ -104,40 +104,20 @@ VCamFilter::VCamFilter()
/* ---------------------------------------- */
AddRef();
}
void VCamFilter::ActuallyStart()
{
if (th.joinable()) {
return;
}
ResetEvent(thread_stop);
th = std::thread([this] { Thread(); });
SetEvent(thread_start);
}
void VCamFilter::ActuallyStop()
{
if (!th.joinable()) {
return;
}
SetEvent(thread_stop);
th.join();
AddRef();
}
VCamFilter::~VCamFilter()
{
ActuallyStop();
SetEvent(thread_stop);
if (th.joinable())
th.join();
video_queue_close(vq);
if (placeholder.scaled_data) {
if (placeholder.scaled_data)
free(placeholder.scaled_data);
placeholder.scaled_data = nullptr;
}
}
const wchar_t *VCamFilter::FilterName() const
@ -154,29 +134,7 @@ STDMETHODIMP VCamFilter::Pause()
return hr;
}
ActuallyStart();
return S_OK;
}
STDMETHODIMP VCamFilter::Run(REFERENCE_TIME tStart)
{
HRESULT hr = OutputFilter::Run(tStart);
if (FAILED(hr)) {
return hr;
}
ActuallyStart();
return S_OK;
}
STDMETHODIMP VCamFilter::Stop()
{
HRESULT hr = OutputFilter::Stop();
if (FAILED(hr)) {
return hr;
}
ActuallyStop();
SetEvent(thread_start);
return S_OK;
}
@ -210,11 +168,6 @@ void VCamFilter::Thread()
/* ---------------------------------------- */
/* load placeholder image */
if (placeholder.scaled_data) {
free(placeholder.scaled_data);
placeholder.scaled_data = nullptr;
}
if (initialize_placeholder()) {
placeholder.source_data = get_placeholder_ptr();
get_placeholder_size(&placeholder.cx, &placeholder.cy);

View File

@ -52,9 +52,6 @@ class VCamFilter : public DShow::OutputFilter {
void UpdatePlaceholder(void);
const int GetOutputBufferSize(void);
void ActuallyStart();
void ActuallyStop();
protected:
const wchar_t *FilterName() const override;
@ -63,6 +60,4 @@ public:
~VCamFilter() override;
STDMETHODIMP Pause() override;
STDMETHODIMP Stop() override;
STDMETHODIMP Run(REFERENCE_TIME tStart) override;
};