Skip to content

Commit

Permalink
virtualcam-module: Revert changes since 27.1.3 (for now)
Browse files Browse the repository at this point in the history
This reverts commit 4b07677,
3f3f9ed,
0e7c17b, and
865eecb.
  • Loading branch information
jp9000 committed Mar 3, 2022
1 parent 3996368 commit b65ee7e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 58 deletions.
59 changes: 6 additions & 53 deletions plugins/win-dshow/virtualcam-module/virtualcam-filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}

Expand Down Expand Up @@ -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);
Expand Down
5 changes: 0 additions & 5 deletions plugins/win-dshow/virtualcam-module/virtualcam-filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -63,6 +60,4 @@ class VCamFilter : public DShow::OutputFilter {
~VCamFilter() override;

STDMETHODIMP Pause() override;
STDMETHODIMP Stop() override;
STDMETHODIMP Run(REFERENCE_TIME tStart) override;
};

0 comments on commit b65ee7e

Please sign in to comment.