tweak code.

This commit is contained in:
hecomi
2017-01-07 00:53:37 +09:00
parent 68d9e30816
commit b0877a49ed
4 changed files with 10 additions and 7 deletions
@@ -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_;