diff options
| author | Daniel Rugerio <[email protected]> | 2020-05-13 16:23:40 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2020-05-13 16:23:40 -0700 |
| commit | bf0b0fe11d8b301cdfcc6d13f12a778cdd1c14b5 (patch) | |
| tree | 55938bebdfe634226f0c1ee7822cbcdb4879f975 /audio/tests/KSPosTst/PreComp.h | |
| parent | b78312cfe7990524cb46a1453ad2e013586857a0 (diff) | |
Update to SysVAD, Wave test and public sample of KS Position Test (#496)147237
* Update to Wave test and public sample of KS Position test.
* Update to the SysVAD audio driver sample.
* Add the PnpLockDown property.
Diffstat (limited to 'audio/tests/KSPosTst/PreComp.h')
| -rw-r--r-- | audio/tests/KSPosTst/PreComp.h | 108 |
1 files changed, 108 insertions, 0 deletions
diff --git a/audio/tests/KSPosTst/PreComp.h b/audio/tests/KSPosTst/PreComp.h new file mode 100644 index 00000000..5fdfc9db --- /dev/null +++ b/audio/tests/KSPosTst/PreComp.h @@ -0,0 +1,108 @@ +// ------------------------------------------------------------------------------ +// +// Copyright (C) Microsoft Corporation. All rights reserved. +// +// File Name: +// +// PreComp.h +// +// Abstract: +// +// Precompiled common headers +// +// ------------------------------------------------------------------------------- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +// Number of milliseconds that the test will be delayed to wait for the stream to stabilize +#define DELAY_FOR_STABILIZE 100 + +// Number of milliseconds in a second +#define MILLISECONDS_PER_SECOND 1000 + +// Number of HNS units in one second +#define HNSTIME_UNITS_PER_SECOND 10000000 + +// Number of HNS units in one millisecond +#define HNSTIME_UNITS_PER_MILLISECOND 10000 + +typedef double (*TIMEPROC) (void); +double tpQPC(void); + +typedef struct _tag_tm +{ + TIMEPROC Proc; + LPCSTR strRep; +} TIMER_MECHANISM, * PTIMER_MECHANISM; + +// ---------------------------------------------------------- +// Timer functions +extern "C" __kernel_entry NTSYSCALLAPI NTSTATUS NTAPI NtSetTimerResolution( + _In_ ULONG DesiredTime, _In_ BOOLEAN SetResolution, _Out_ PULONG ActualTime); + +// 1 ms timer resolution +static ULONG timerResolution = (1 * 10000); +static ULONG actualTimerResolution; + +// ------------------------------------------------------------------------------ +// structs used to hold results of perf tests +#define DATA_POINTS 100 + +typedef struct +{ + double testTime; // Time the sample was taken, in milliseconds, relative to the start of the sample collection + double positionTime; // Time of the reported position, in milliseconds, relative to the start of the sample collection + double position; // Position, in seconds, relative to the start of the sample collection +} POSITION_SET, * PPOSITION_SET; + +typedef struct +{ + PPOSITION_SET argPosSets; + ULONG cPosSets; + ULONG ctLatencyMeas; + ULONG csBufferMeas; + double bytesPerSecond; // measured (in bytes/sec, NOT samples/sec) + double dOffset; // measured +} PERF_RESULTS, * PPERF_RESULTS; + +typedef struct +{ + WAVEFORMATEXTENSIBLE wfxFormat; + PERF_RESULTS perfResults; // +} FORMAT_ENTRY, * PFORMAT_ENTRY; |
