tweak code.
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -308,7 +308,7 @@ bool Duplicator::Duplicate(UINT timeout)
|
||||
return false;
|
||||
}
|
||||
|
||||
auto sharedTexture = device_->GetCompatibleSharedTexture(texture, frame % 2);
|
||||
auto sharedTexture = device_->GetCompatibleSharedTexture(texture, frame_ % 2);
|
||||
if (!sharedTexture)
|
||||
{
|
||||
return false;
|
||||
@@ -323,10 +323,13 @@ bool Duplicator::Duplicate(UINT timeout)
|
||||
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(mutex_);
|
||||
lastFrame_.frame = frame++;
|
||||
lastFrame_.texture = sharedTexture;
|
||||
lastFrame_.info = frameInfo;
|
||||
lastFrame_.metaData = metaData_;
|
||||
lastFrame_ = Frame
|
||||
{
|
||||
frame_++,
|
||||
sharedTexture,
|
||||
frameInfo,
|
||||
metaData_
|
||||
};
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -44,7 +44,7 @@ public:
|
||||
|
||||
struct Frame
|
||||
{
|
||||
UINT frame = 0;
|
||||
UINT frame;
|
||||
Microsoft::WRL::ComPtr<ID3D11Texture2D> texture;
|
||||
DXGI_OUTDUPL_FRAME_INFO info;
|
||||
Metadata metaData;
|
||||
@@ -82,7 +82,7 @@ private:
|
||||
std::shared_ptr<class IsolatedD3D11Device> device_;
|
||||
Microsoft::WRL::ComPtr<IDXGIOutputDuplication> dupl_;
|
||||
Frame lastFrame_;
|
||||
UINT frame = 0;
|
||||
UINT frame_ = 0;
|
||||
|
||||
volatile bool shouldRun_ = false;
|
||||
std::thread thread_;
|
||||
|
||||
Reference in New Issue
Block a user