feat(windows-nui): log consume-side (ImageStream/Skeleton GetNextFrame), shutdown, producer-exit
This commit is contained in:
1 parent
dbc75f12e1
commit
f98cba70aa
1 file changed
+18
-2
@@ -147,6 +147,7 @@ void VirtualKinectSensor::Shutdown() {
|
||||
if (!initialized_) {
|
||||
return;
|
||||
}
|
||||
ShimLog("NuiShutdown called");
|
||||
initialized_ = false;
|
||||
if (stop_event_ != nullptr) {
|
||||
SetEvent(stop_event_);
|
||||
@@ -228,6 +229,12 @@ HRESULT VirtualKinectSensor::SkeletonGetNextFrame(
|
||||
}
|
||||
|
||||
EnterCriticalSection(&lock_);
|
||||
static unsigned skel_calls = 0;
|
||||
if (skel_calls < 6 || (skel_calls % 150u) == 0u) {
|
||||
ShimLog("SkeletonGetNextFrame call#%u has_skeleton=%d", skel_calls,
|
||||
has_skeleton_ ? 1 : 0);
|
||||
}
|
||||
++skel_calls;
|
||||
if (!has_skeleton_) {
|
||||
LeaveCriticalSection(&lock_);
|
||||
return E_NUI_FRAME_NO_DATA;
|
||||
@@ -360,7 +367,15 @@ HRESULT VirtualKinectSensor::ImageStreamGetNextFrame(
|
||||
}
|
||||
|
||||
EnterCriticalSection(&lock_);
|
||||
if (!stream->has_frame) {
|
||||
static unsigned img_calls = 0;
|
||||
const bool has = stream->has_frame;
|
||||
const int stype = static_cast<int>(stream->type);
|
||||
if (img_calls < 6 || (img_calls % 150u) == 0u) {
|
||||
ShimLog("ImageStreamGetNextFrame call#%u type=%d has_frame=%d", img_calls,
|
||||
stype, has ? 1 : 0);
|
||||
}
|
||||
++img_calls;
|
||||
if (!has) {
|
||||
LeaveCriticalSection(&lock_);
|
||||
return E_NUI_FRAME_NO_DATA;
|
||||
}
|
||||
@@ -511,7 +526,7 @@ void VirtualKinectSensor::ProducerLoop() {
|
||||
|
||||
SourceFrame src;
|
||||
const bool got = source_.is_open() && source_.read_latest(src);
|
||||
if ((frame_number % 60u) == 0u) {
|
||||
if (frame_number < 10u || (frame_number % 60u) == 0u) {
|
||||
std::size_t depth_nonzero = 0;
|
||||
if (got) {
|
||||
for (uint16_t p : src.depth_pixels) {
|
||||
@@ -556,6 +571,7 @@ void VirtualKinectSensor::ProducerLoop() {
|
||||
|
||||
WaitForSingleObject(stop_event_, kFramePeriodMs);
|
||||
}
|
||||
ShimLog("producer loop EXIT at tick=%u (stop_event signalled)", frame_number);
|
||||
}
|
||||
|
||||
DWORD WINAPI VirtualKinectSensor::ProducerThunk(LPVOID param) {
|
||||
|
||||
Reference in new issue
Block a user