[channels,video] measure times in ns

measure all times normalized to [ns]
This commit is contained in:
akallabeth
2026-01-25 17:23:07 +01:00
parent 5013b28e8b
commit e05ab04f67

View File

@@ -845,8 +845,7 @@ static UINT video_VideoData(VideoClientContext* context, const TSMM_VIDEO_DATA*
{
VideoSurface* surface = presentation->surface;
H264_CONTEXT* h264 = presentation->h264;
UINT64 startTime = GetTickCount64();
UINT64 timeAfterH264 = 0;
const UINT64 startTime = winpr_GetTickCount64NS();
MAPPED_GEOMETRY* geom = presentation->geometry;
const RECTANGLE_16 rect = { 0, 0, WINPR_ASSERTING_INT_CAST(UINT16, surface->alignedWidth),
@@ -854,14 +853,14 @@ static UINT video_VideoData(VideoClientContext* context, const TSMM_VIDEO_DATA*
Stream_SealLength(presentation->currentSample);
Stream_SetPosition(presentation->currentSample, 0);
timeAfterH264 = GetTickCount64();
const UINT64 timeAfterH264 = winpr_GetTickCount64NS();
if (data->SampleNumber == 1)
{
presentation->lastPublishTime = startTime;
}
presentation->lastPublishTime += (data->hnsDuration / 10000);
if (presentation->lastPublishTime <= timeAfterH264 + 10)
presentation->lastPublishTime += 100ull * data->hnsDuration;
if (presentation->lastPublishTime <= (10000000ull + timeAfterH264))
{
int dropped = 0;