Split direct v210 read and copy timing
This commit is contained in:
+20
-1
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <cstring>
|
||||
#include <sstream>
|
||||
|
||||
@@ -151,8 +152,15 @@ bool SyntheticV210Feed::supportsDirectV210Read() const
|
||||
bool SyntheticV210Feed::readV210FrameInto(
|
||||
uint32_t frameCounter,
|
||||
void* destination,
|
||||
size_t destinationSize)
|
||||
size_t destinationSize,
|
||||
V210ReadTiming* timing)
|
||||
{
|
||||
if (timing != nullptr)
|
||||
{
|
||||
timing->sourceReadNs = 0;
|
||||
timing->payloadCopyNs = 0;
|
||||
}
|
||||
|
||||
if (destination == nullptr || mPayloads.empty())
|
||||
{
|
||||
return false;
|
||||
@@ -171,7 +179,18 @@ bool SyntheticV210Feed::readV210FrameInto(
|
||||
return false;
|
||||
}
|
||||
|
||||
const auto copyStart = std::chrono::steady_clock::now();
|
||||
std::memcpy(destination, payload.data(), payload.size());
|
||||
const auto copyEnd = std::chrono::steady_clock::now();
|
||||
|
||||
if (timing != nullptr)
|
||||
{
|
||||
timing->payloadCopyNs =
|
||||
static_cast<uint64_t>(
|
||||
std::chrono::duration_cast<std::chrono::nanoseconds>(
|
||||
copyEnd - copyStart).count());
|
||||
}
|
||||
|
||||
mGrainIndex = index;
|
||||
++mFrameVersion;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user