Skip to content
This repository was archived by the owner on Aug 22, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
9e583d9
Add K4A_RESULT_UNSUPPORTED to result enums.
AntonClaytonBursch Nov 6, 2020
0cc40a7
Structs for device, color, depth. Enum for calibration. Functions to …
AntonClaytonBursch Nov 11, 2020
67c5906
Updates examples, src, tests and tools to use new config and color an…
AntonClaytonBursch Nov 11, 2020
7065e41
Added fps mode structs and functions.
AntonClaytonBursch Nov 11, 2020
fe4ef43
Updated code to reflect change to using fps mode.
AntonClaytonBursch Nov 11, 2020
eed529f
Moded color, depth and fps enums from k4a/k4atypes.h to k4ainternal/m…
AntonClaytonBursch Nov 13, 2020
5f44c39
Updated c++ wrapper to use new color and depth modes.
AntonClaytonBursch Nov 17, 2020
a91d4af
Updated C++ wrapper with get device, depth, color and fps functions. …
AntonClaytonBursch Nov 17, 2020
859cb0c
Update k4arecord/types.h and examples to use color, depth and fps mod…
AntonClaytonBursch Nov 19, 2020
9ba6e0d
added depth range to k4a_depth_mode_info, updated get color/depth/fps…
AntonClaytonBursch Nov 23, 2020
466f0ef
Update k4astaticimageproperties.h to use k4a.hpp instead of k4a.h
AntonClaytonBursch Nov 23, 2020
31502da
Quick fix: forgot to add K4A_EXPORT to get mode and mode count functi…
AntonClaytonBursch Nov 23, 2020
45486f4
examples, tests, tools refactored to use new get mode functions
AntonClaytonBursch Nov 30, 2020
7d16edb
quick comments fix in calibration example and updates to color_ft tes…
AntonClaytonBursch Dec 3, 2020
49f3b46
Changed get modes loops for fps, color and depth.
AntonClaytonBursch Dec 9, 2020
86c2353
Viewer mode selection from radio to comboboxes
AntonClaytonBursch Dec 17, 2020
05526d6
using mode info types instead of mode info type index
AntonClaytonBursch Dec 30, 2020
cd72c23
refactor to use mode info instead of mode id
AntonClaytonBursch Dec 31, 2020
063e627
using depth/color/fps mode info instead of mode id
AntonClaytonBursch Jan 4, 2021
d5a9c6a
mode id changes and GUI cleanup
AntonClaytonBursch Jan 5, 2021
99941d6
revert back from using device mode info to device mode id for fps/col…
AntonClaytonBursch Jan 11, 2021
166f3ce
Use constants defined in usb_cmd_priv.h to set the vendor id and devi…
AntonClaytonBursch Jan 13, 2021
fc1abff
Used const for color/depth/fps mode info initializers.
AntonClaytonBursch Jan 14, 2021
db1fdc4
Passing depth mode info down to point cloud viewer. Moved static k4a…
AntonClaytonBursch Jan 19, 2021
08cb5da
color, depth and fps mode infos saved in and parsed from recordings
AntonClaytonBursch Jan 20, 2021
eeda58b
Initialize the size and version of the mode structs
AntonClaytonBursch Jan 22, 2021
fa2306c
Moved K4A_MSFT_VID, K4A_RGB_PID and K4A_DEPTH_PID to usbcommand.h. A…
AntonClaytonBursch Jan 22, 2021
f562a87
error handling for saving modes and device info in recording
AntonClaytonBursch Jan 22, 2021
cc2de88
color, depth, fps mode info and device info saved in and parse from r…
AntonClaytonBursch Jan 22, 2021
d1636a0
Fixing K4A build errors in src/record/internal/matroska_read.cpp abou…
JonathanESantos Jan 26, 2021
cee1d03
SDK: docstring changes for Doxygen to run without errors.
JonathanESantos Jan 26, 2021
37d7a75
linked k4a_math in viewer
AntonClaytonBursch Jan 26, 2021
7220725
Recording description from mode info saved in recording (or legacy de…
AntonClaytonBursch Jan 26, 2021
ed16e3e
K4A API: Adding to docstrings that functions may return status of UNS…
JonathanESantos Jan 26, 2021
f767c58
k4aviewer: Removing audio support. To turn on audio support, in tools…
JonathanESantos Jan 27, 2021
bdb07ba
k4aviewer: Removing support for audio and clangformat wants to format…
JonathanESantos Jan 27, 2021
ffffdb4
Use modes for k4arecorder
AntonClaytonBursch Jan 27, 2021
f001063
Recorder mode option listed.
AntonClaytonBursch Jan 27, 2021
b6c0277
working on recorder command line validation
AntonClaytonBursch Jan 27, 2021
43d8223
k4arecorder: Minor editing.
JonathanESantos Jan 27, 2021
f997474
k4a: Adding functional tests for calling the added functions in k4a.h.
JonathanESantos Jan 28, 2021
7aeff33
Removing commented-out code.
JonathanESantos Jan 28, 2021
52a04e2
k4a: Fixing a test in depth_ft.
JonathanESantos Jan 28, 2021
1c2e403
Update main.cpp
JonathanESantos Jan 28, 2021
8dd06ca
Update main.cpp
JonathanESantos Jan 28, 2021
f46ed1d
Update main.cpp
JonathanESantos Jan 28, 2021
69df58b
Update main.cpp
JonathanESantos Jan 28, 2021
b0c9517
Update main.cpp
JonathanESantos Jan 28, 2021
a4cd431
validate recorder cmd options
AntonClaytonBursch Jan 28, 2021
6cee948
finished validating recording cmd options
AntonClaytonBursch Jan 28, 2021
1f9f374
Fixed get fps mode in recorder.
AntonClaytonBursch Jan 28, 2021
c11c14b
Doxygen comments for C/C++ refactor
AntonClaytonBursch Jan 30, 2021
989ec96
Disable FPS dropdown in viewer while playing.
AntonClaytonBursch Jan 30, 2021
e5cf767
Fix broken Linux build.
JonathanESantos Jan 29, 2021
a65e5f7
k4a: ninja clangformat made these formatting changes.
JonathanESantos Jan 29, 2021
5bc2c8e
k4a.c: Undo a broken "fix" which prevents validating any fps mode set.
JonathanESantos Jan 29, 2021
8af41bf
Re-inserting the check if fps is less than the minimum allowed.
JonathanESantos Jan 29, 2021
f847d40
Commit ac680444 was overriden by a PR merge, so, this fixes that.
AntonClaytonBursch Jan 30, 2021
6ffb1c6
Refactored C# wrapper and examples.
AntonClaytonBursch Feb 4, 2021
9ea5532
meaningful mode usage in example
AntonClaytonBursch Feb 4, 2021
f73f60f
revert c++ changes (should be done in this branch)
AntonClaytonBursch Feb 4, 2021
12a4d48
Fixing C# to C communication.
AntonClaytonBursch Feb 5, 2021
a284750
new C# classes and native methods are commented properly
AntonClaytonBursch Feb 5, 2021
283c93b
Commented the C# examples to describe how to use the new modes.
AntonClaytonBursch Feb 5, 2021
8dfd037
changes to match up to c/c++ api revisions
AntonClaytonBursch Feb 8, 2021
a2ffabb
update c# sdk and examples for c/c++ api revisions
AntonClaytonBursch Feb 9, 2021
c2b9e28
Remove old enums
AntonClaytonBursch Feb 9, 2021
384bdcd
update C# tests
AntonClaytonBursch Feb 9, 2021
eb687e2
quick fix to a TODO
AntonClaytonBursch Feb 10, 2021
2ca5600
ninja clangformat changes only, needed to build without errors.
JonathanESantos Jan 30, 2021
940d377
SDK C API: Removing doxygen output files. These files should not be c…
JonathanESantos Feb 4, 2021
be6db18
SDK C API: Fixing docstrings for added C functions and structs.
JonathanESantos Feb 4, 2021
32a08d8
SDK C API: ninja clangformat changes only.
JonathanESantos Feb 4, 2021
35887f1
SDK C API: Fixing comments and reverting from int to enum in color_ft…
JonathanESantos Feb 4, 2021
3aa93ce
SDK C API: Moving header file from transformation.h to transformation…
JonathanESantos Feb 4, 2021
59a9ae6
SDK C API: Adding K4A_CAPABILITY_MICROPHONE as a device capability.
JonathanESantos Feb 4, 2021
ac71668
record/sdk/record.cpp: Removing unnecessary cast in line 53.
JonathanESantos Feb 4, 2021
ea02fb7
SDK C/C++ API: The following changes are made:
JonathanESantos Feb 5, 2021
b2e267e
C internal: Changing k4a_fps_t enum values from 0, 1, 2, 3 to 0, 5, 1…
JonathanESantos Feb 6, 2021
0080b2d
SDK C API: Refactoring k4a.c and k4ainternal/modes.h so that the mode…
JonathanESantos Feb 7, 2021
6a0b7e4
SDK internal implementation: Replacing magic numbers with their enums…
JonathanESantos Feb 7, 2021
e4e2c55
SDK C API: Fixing bug in the k4a_get_color_mode(), k4a_get_depth_mode…
JonathanESantos Feb 7, 2021
3cb409a
SDK C API: Changing type of min_range and max_range in k4a_depth_mode…
JonathanESantos Feb 7, 2021
e7c99a2
SDK internal: Replacing magic numbers with their enum equivalents.
JonathanESantos Feb 7, 2021
0e52280
matroska_read.cpp: Replacing valuedouble with valueint for values tha…
JonathanESantos Feb 7, 2021
c7ed54d
k4aviewer: Fixing an issue where introducing an invalid FPS enum disp…
JonathanESantos Feb 7, 2021
ed0c71d
k4arecorder: Fixing code that is using mode ID as parameter into k4a_…
JonathanESantos Feb 7, 2021
a97bad4
k4aviewer: Reverting static variable to a class member variable.
JonathanESantos Feb 7, 2021
88f3ad3
Functional Tests: Fixing functional tests that broke because of not s…
JonathanESantos Feb 7, 2021
b00335e
k4ainternal/modes.h: Renaming _DEPTH16 to DEPTH16 to avoid C conventi…
JonathanESantos Feb 8, 2021
df9f8bd
cleaning up the examples
AntonClaytonBursch Feb 11, 2021
2280a71
examples query for modes
AntonClaytonBursch Feb 11, 2021
b063021
added query for capabilities using get device info
AntonClaytonBursch Feb 12, 2021
95b442f
minor fixes to examples
AntonClaytonBursch Feb 12, 2021
4974857
clangformat changes, and deleting a file that should not be checked in.
JonathanESantos Feb 12, 2021
8b08269
more minor fixes to examples
AntonClaytonBursch Feb 12, 2021
bb9476a
quick clang format error in streaming example
AntonClaytonBursch Feb 12, 2021
2a4cdf2
Adding a conversion function to go from k4a_fps_t to fps.
JonathanESantos Feb 17, 2021
18d1580
Reverting converting from k4a_fps_t to uint32_t back to a function ca…
JonathanESantos Feb 17, 2021
bd04492
Fixing an issue with multidevice.cpp that could prevent an FPS value …
JonathanESantos Feb 17, 2021
be9aad4
Simplifying parsing the --fps parameter and converting to k4a_fps_t e…
JonathanESantos Feb 17, 2021
5984ed3
Making the capabilities field of the k4a_device_info_t a union so tha…
JonathanESantos Feb 18, 2021
9764fda
Putting const qualifier in k4atypes.hpp for new Device class function…
JonathanESantos Feb 18, 2021
f0614c9
Moving definition of usb vendor id and product ids into its own heade…
JonathanESantos Feb 18, 2021
58165fd
Moving k4a static depth modes, color modes, and fps modes into its ow…
JonathanESantos Feb 19, 2021
9a78d55
Removing stale comments in k4a.c.
JonathanESantos Feb 19, 2021
661e60c
code revisions
AntonClaytonBursch Feb 19, 2021
63491cd
moved get device mode ids into seperate functions in the examples
AntonClaytonBursch Feb 19, 2021
0250986
get mode id from mode info structs in get mode ids functions in examples
AntonClaytonBursch Feb 19, 2021
4d2a6f8
Fixing build errors in Linux that were introduced when k4a_device_inf…
JonathanESantos Feb 19, 2021
3638a92
Fixing a misnamed variable in fastpointcloud/main.cpp.
JonathanESantos Feb 19, 2021
4405407
change for code revision
AntonClaytonBursch Feb 20, 2021
5793f82
More code review changes.
AntonClaytonBursch Feb 20, 2021
7156c1a
Adding docstrings to k4a_device_capabilities_t enum.
JonathanESantos Feb 21, 2021
24cc959
Fixing depth to point cloud transformation bug where it is using uint…
JonathanESantos Apr 14, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
C internal: Changing k4a_fps_t enum values from 0, 1, 2, 3 to 0, 5, 1…
…5, 30 to reflect the actual fps values.
  • Loading branch information
JonathanESantos committed Apr 14, 2021
commit b2e267e38c6126a6bac229e0abc6df189d20eb29
46 changes: 23 additions & 23 deletions include/k4a/k4atypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,29 @@ typedef enum
K4A_LOG_LEVEL_OFF, /**< No logging is performed */
} k4a_log_level_t;

/** Device capabilities.
*
* \remarks
* Used by \p k4a_device_info_t to store whether a device has a color camera, a depth camera, and IMU.
*
* \note
* These are used in a bitmap, so the values should be unique powers of 2. These values should not be
* modified; if a new capability is available, a new enum field should be defined.
*
* \xmlonly
* <requirements>
* <requirement name="Header">k4atypes.h (include k4a/k4a.h)</requirement>
* </requirements>
* \endxmlonly
*/
typedef enum
{
K4A_CAPABILITY_DEPTH = 1,
K4A_CAPABILITY_COLOR = 2,
K4A_CAPABILITY_IMU = 4,
K4A_CAPABILITY_MICROPHONE = 8,
} device_capabilities;

/** Image format type.
*
* \remarks
Expand Down Expand Up @@ -859,29 +882,6 @@ typedef uint8_t *(k4a_memory_allocate_cb_t)(int size, void **context);
* @{
*/

/** Device capabilities.
*
* \remarks
* Used by \p k4a_device_info_t to store whether a device has a color camera, a depth camera, and IMU.
*
* \note
* These are used in a bitmap, so the values should be unique powers of 2. These values should not be
* modified; if a new capability is available, a new enum field should be defined.
*
* \xmlonly
* <requirements>
* <requirement name="Header">k4atypes.h (include k4a/k4a.h)</requirement>
* </requirements>
* \endxmlonly
*/
typedef enum
{
K4A_CAPABILITY_DEPTH = 1,
K4A_CAPABILITY_COLOR = 2,
K4A_CAPABILITY_IMU = 4,
K4A_CAPABILITY_MICROPHONE = 8,
} k4a_device_capabilities_t;

/** Stores the vendor id, the device id and device capabilities.
*
* \sa device_capabilities
Expand Down
88 changes: 9 additions & 79 deletions include/k4ainternal/modes.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,87 +78,12 @@ typedef enum
// Be sure to update k4a_fps_to_string in k4a.c if enum values are added.
typedef enum
{
K4A_FRAMES_PER_SECOND_0 = 0, /**< 0 FPS */
K4A_FRAMES_PER_SECOND_5, /**< 5 FPS */
K4A_FRAMES_PER_SECOND_15, /**< 15 FPS */
K4A_FRAMES_PER_SECOND_30, /**< 30 FPS */
K4A_FRAMES_PER_SECOND_COUNT, /**< Must be last entry. */
K4A_FRAMES_PER_SECOND_0 = 0, /**< 0 FPS */
K4A_FRAMES_PER_SECOND_5 = 5, /**< 5 FPS */
K4A_FRAMES_PER_SECOND_15 = 15, /**< 15 FPS */
K4A_FRAMES_PER_SECOND_30 = 30, /**< 30 FPS */
} k4a_fps_t;

/** Convert k4a_fps_t enum to the actual frame rate value.
*
* \remarks
* K4A_FRAMES_PER_SECOND_30 will be converted to 30.
*
* \xmlonly
* <requirements>
* <requirement name="Header">modes.h (include k4ainternal/modes.h)</requirement>
* </requirements>
* \endxmlonly
*/
inline static uint32_t k4a_convert_fps_to_uint(k4a_fps_t fps)
{
uint32_t fps_int = 0;

switch (fps)
{
case K4A_FRAMES_PER_SECOND_0:
fps_int = 0;
break;
case K4A_FRAMES_PER_SECOND_5:
fps_int = 5;
break;
case K4A_FRAMES_PER_SECOND_15:
fps_int = 15;
break;
case K4A_FRAMES_PER_SECOND_30:
fps_int = 30;
break;
default:
fps_int = 0;
break;
}

return fps_int;
}

/** Convert frame rate value to the corresponding k4a_fps_t enum.
*
* \remarks
* 30 will be converted to K4A_FRAMES_PER_SECOND_30.
*
* \xmlonly
* <requirements>
* <requirement name="Header">modes.h (include k4ainternal/modes.h)</requirement>
* </requirements>
* \endxmlonly
*/
inline static k4a_fps_t k4a_convert_uint_to_fps(uint32_t fps_in)
{
k4a_fps_t fps_t = K4A_FRAMES_PER_SECOND_0;

switch (fps_in)
{
case 0:
fps_t = K4A_FRAMES_PER_SECOND_0;
break;
case 5:
fps_t = K4A_FRAMES_PER_SECOND_5;
break;
case 15:
fps_t = K4A_FRAMES_PER_SECOND_15;
break;
case 30:
fps_t = K4A_FRAMES_PER_SECOND_30;
break;
default:
fps_t = K4A_FRAMES_PER_SECOND_0;
break;
}

return fps_t;
}

/** Return the image width and height for the corresponding k4a_color_resolution_t enum.
*
* \xmlonly
Expand Down Expand Up @@ -212,6 +137,7 @@ inline static bool k4a_convert_resolution_to_width_height(k4a_color_resolution_t
break;
default:
resolutionFound = false;
break;
}

if (resolutionFound)
Expand Down Expand Up @@ -308,6 +234,7 @@ inline static bool k4a_convert_resolution_to_fov(k4a_color_resolution_t resoluti
break;
default:
resolutionFound = false;
break;
}

if (resolutionFound)
Expand Down Expand Up @@ -400,6 +327,7 @@ inline static bool k4a_convert_depth_mode_to_width_height(k4a_depth_mode_t mode_
break;
default:
modeFound = false;
break;
}

if (modeFound)
Expand Down Expand Up @@ -490,6 +418,7 @@ inline static bool k4a_convert_depth_mode_to_fov(k4a_depth_mode_t mode_id, float
break;
default:
modeFound = false;
break;
}

if (modeFound)
Expand Down Expand Up @@ -582,6 +511,7 @@ inline static bool k4a_convert_depth_mode_to_min_max_range(k4a_depth_mode_t mode
break;
default:
modeFound = false;
break;
}

if (modeFound)
Expand Down
2 changes: 1 addition & 1 deletion include/k4ainternal/queue.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ extern "C" {

/** Default queue depth for 30 FPS.
*/
#define QUEUE_DEFAULT_SIZE QUEUE_CALC_DEPTH(k4a_convert_fps_to_uint(K4A_FRAMES_PER_SECOND_30), QUEUE_DEFAULT_DEPTH_USEC)
#define QUEUE_DEFAULT_SIZE QUEUE_CALC_DEPTH((uint32_t)K4A_FRAMES_PER_SECOND_30, QUEUE_DEFAULT_DEPTH_USEC)

/** Handle to the queue module.
*
Expand Down
2 changes: 1 addition & 1 deletion src/capturesync/capturesync.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ k4a_result_t capturesync_start(capturesync_t capturesync_handle, const k4a_devic
sync->waiting_for_clean_depth_ts = true;
sync->synchronized_images_only = config->synchronized_images_only;

sync->fps_period = HZ_TO_PERIOD_US(k4a_convert_fps_to_uint(config->fps_mode_id));
sync->fps_period = HZ_TO_PERIOD_US(config->fps_mode_id);
sync->fps_1_quarter_period = sync->fps_period / 4;
sync->depth_delay_off_color_usec = config->depth_delay_off_color_usec;
sync->sync_captures = true;
Expand Down
2 changes: 1 addition & 1 deletion src/color/color.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ k4a_result_t color_start(color_t color_handle, const k4a_device_configuration_t
return K4A_RESULT_FAILED;
}

fps = k4a_convert_fps_to_uint(static_cast<k4a_fps_t>(config->fps_mode_id));
fps = static_cast<uint32_t>(config->fps_mode_id);
if (fps == 0)
{
LOG_ERROR("camera_fps %d is invalid", config->fps_mode_id);
Expand Down
2 changes: 1 addition & 1 deletion src/depth_mcu/depth_mcu.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ k4a_result_t depthmcu_depth_set_fps(depthmcu_t depthmcu_handle, uint32_t fps_mod
depthmcu_context_t *depthmcu = depthmcu_t_get_context(depthmcu_handle);

// Translate FPS to values understood by sensor module
uint32_t fps = k4a_convert_fps_to_uint((k4a_fps_t)fps_mode_id);
uint32_t fps = (uint32_t)fps_mode_id;
if (fps == 0)
{
LOG_ERROR("Invalid FPS %d", fps_mode_id);
Expand Down
2 changes: 1 addition & 1 deletion src/dewrapper/dewrapper.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ static k4a_result_t depth_engine_start_helper(dewrapper_context_t *dewrapper,
assert(dewrapper->calibration_memory != NULL);

// Max comput time is the configured FPS
*depth_engine_max_compute_time_ms = HZ_TO_PERIOD_MS(k4a_convert_fps_to_uint(fps_mode_id));
*depth_engine_max_compute_time_ms = HZ_TO_PERIOD_MS((uint32_t)fps_mode_id);
result = K4A_RESULT_FROM_BOOL(*depth_engine_max_compute_time_ms != 0);

if (K4A_SUCCEEDED(result))
Expand Down
2 changes: 1 addition & 1 deletion src/record/internal/matroska_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ k4a_result_t parse_recording_config(k4a_playback_context_t *context)
context->sync_period_ns = frame_period_ns;
if (frame_period_ns > 0)
{
k4a_fps_t fps_t = k4a_convert_uint_to_fps(static_cast<uint32_t>(1_s / frame_period_ns));
k4a_fps_t fps_t = static_cast<k4a_fps_t>(static_cast<uint32_t>(1_s / frame_period_ns));
if (fps_t == K4A_FRAMES_PER_SECOND_0)
{
LOG_ERROR("Unsupported recording frame period: %llu ns (%llu fps)",
Expand Down
2 changes: 1 addition & 1 deletion src/record/sdk/record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ k4a_result_t k4a_record_create(const char *path,
{
context->device_config = device_config;
context->timecode_scale = MATROSKA_TIMESCALE_NS;
context->camera_fps = k4a_convert_fps_to_uint(static_cast<k4a_fps_t>(device_config.fps_mode_id));
context->camera_fps = static_cast<uint32_t>(device_config.fps_mode_id);
if (context->camera_fps == 0)
{
// Set camera FPS to 30 if no cameras are enabled so IMU can still be written.
Expand Down
4 changes: 2 additions & 2 deletions src/sdk/k4a.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ static k4a_result_t validate_configuration(k4a_context_t *device, const k4a_devi
if (config->wired_sync_mode == K4A_WIRED_SYNC_MODE_SUBORDINATE &&
config->subordinate_delay_off_master_usec != 0)
{
uint32_t fps_in_usec = HZ_TO_PERIOD_US(k4a_convert_fps_to_uint((k4a_fps_t)config->fps_mode_id));
uint32_t fps_in_usec = HZ_TO_PERIOD_US((uint32_t)config->fps_mode_id);
if (config->subordinate_delay_off_master_usec > fps_in_usec)
{
result = K4A_RESULT_FAILED;
Expand Down Expand Up @@ -716,7 +716,7 @@ static k4a_result_t validate_configuration(k4a_context_t *device, const k4a_devi

if (depth_enabled && color_enabled)
{
int64_t fps = HZ_TO_PERIOD_US(k4a_convert_fps_to_uint((k4a_fps_t)config->fps_mode_id));
int64_t fps = HZ_TO_PERIOD_US((uint32_t)config->fps_mode_id);
if (config->depth_delay_off_color_usec < -fps || config->depth_delay_off_color_usec > fps)
{
result = K4A_RESULT_FAILED;
Expand Down
2 changes: 1 addition & 1 deletion tests/ColorTests/FunctionalTest/color_ft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ int32_t color_control_test::map_manual_exposure(int32_t value, bool sixty_hertz)
// Limit exposure setting based on FPS setting.
int32_t color_control_test::limit_exposure_to_fps_setting(int32_t value, bool sixty_hertz, k4a_fps_t fps)
{
int fps_usec = HZ_TO_PERIOD_US(k4a_convert_fps_to_uint(fps));
int fps_usec = HZ_TO_PERIOD_US((uint32_t)fps);
int last_exposure;

if (value < fps_usec)
Expand Down
10 changes: 5 additions & 5 deletions tests/RecordTests/UnitTest/playback_ut.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ TEST_F(playback_ut, open_large_file)
k4a_capture_t capture = NULL;
k4a_stream_result_t stream_result = K4A_STREAM_RESULT_FAILED;
uint64_t timestamps[3] = { 0, 1000, 1000 };
uint64_t timestamp_delta = HZ_TO_PERIOD_US(k4a_convert_fps_to_uint((k4a_fps_t)config.fps_mode_info.mode_id));
uint64_t timestamp_delta = HZ_TO_PERIOD_US(config.fps_mode_info.mode_id);
size_t i = 0;
for (; i < 50; i++)
{
Expand Down Expand Up @@ -176,7 +176,7 @@ TEST_F(playback_ut, open_delay_offset_file)
k4a_capture_t capture = NULL;
k4a_stream_result_t stream_result = K4A_STREAM_RESULT_FAILED;
uint64_t timestamps[3] = { 0, 10000, 10000 };
uint64_t timestamp_delta = HZ_TO_PERIOD_US(k4a_convert_fps_to_uint((k4a_fps_t)config.fps_mode_info.mode_id));
uint64_t timestamp_delta = HZ_TO_PERIOD_US(config.fps_mode_info.mode_id);

// Read forward
for (size_t i = 0; i < test_frame_count; i++)
Expand Down Expand Up @@ -283,7 +283,7 @@ TEST_F(playback_ut, playback_seek_test)
k4a_capture_t capture = NULL;
k4a_stream_result_t stream_result = K4A_STREAM_RESULT_FAILED;
uint64_t timestamps[3] = { 0, 1000, 1000 };
uint64_t timestamp_delta = HZ_TO_PERIOD_US(k4a_convert_fps_to_uint((k4a_fps_t)config.fps_mode_info.mode_id));
uint64_t timestamp_delta = HZ_TO_PERIOD_US(config.fps_mode_info.mode_id);

k4a_imu_sample_t imu_sample = { 0 };
uint64_t imu_timestamp = 1150;
Expand Down Expand Up @@ -551,7 +551,7 @@ TEST_F(playback_ut, open_skipped_frames_file)
k4a_capture_t capture = NULL;
k4a_stream_result_t stream_result = K4A_STREAM_RESULT_FAILED;
uint64_t timestamps[3] = { 1000000, 1001000, 1001000 };
uint64_t timestamp_delta = HZ_TO_PERIOD_US(k4a_convert_fps_to_uint((k4a_fps_t)config.fps_mode_info.mode_id));
uint64_t timestamp_delta = HZ_TO_PERIOD_US(config.fps_mode_info.mode_id);

// Test initial state
stream_result = k4a_playback_get_previous_capture(handle, &capture);
Expand Down Expand Up @@ -843,7 +843,7 @@ TEST_F(playback_ut, open_start_offset_file)
k4a_stream_result_t stream_result = K4A_STREAM_RESULT_FAILED;
uint64_t timestamps[3] = { 1000000, 1000000, 1000000 };
uint64_t imu_timestamp = 1001150;
uint64_t timestamp_delta = HZ_TO_PERIOD_US(k4a_convert_fps_to_uint((k4a_fps_t)config.fps_mode_info.mode_id));
uint64_t timestamp_delta = HZ_TO_PERIOD_US(config.fps_mode_info.mode_id);
uint64_t last_timestamp = k4a_playback_get_recording_length_usec(handle) +
(uint64_t)config.start_timestamp_offset_usec;
ASSERT_EQ(last_timestamp, (uint64_t)config.start_timestamp_offset_usec + 3333150);
Expand Down
8 changes: 4 additions & 4 deletions tests/RecordTests/UnitTest/sample_recordings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ void SampleRecordings::SetUp()

uint64_t timestamps[3] = { 0, 1000, 1000 }; // Offset the Depth and IR tracks by 1ms to test
uint64_t imu_timestamp = 1150;
uint32_t timestamp_delta = HZ_TO_PERIOD_US(k4a_convert_fps_to_uint((k4a_fps_t)record_config_full.fps_mode_id));
uint32_t timestamp_delta = HZ_TO_PERIOD_US((uint32_t)record_config_full.fps_mode_id);
k4a_capture_t capture = NULL;
for (size_t i = 0; i < test_frame_count; i++)
{
Expand Down Expand Up @@ -107,7 +107,7 @@ void SampleRecordings::SetUp()
uint64_t timestamps[3] = { 0,
(uint64_t)record_config_delay.depth_delay_off_color_usec,
(uint64_t)record_config_delay.depth_delay_off_color_usec };
uint32_t timestamp_delta = HZ_TO_PERIOD_US(k4a_convert_fps_to_uint((k4a_fps_t)record_config_delay.fps_mode_id));
uint32_t timestamp_delta = HZ_TO_PERIOD_US((uint32_t)record_config_delay.fps_mode_id);
k4a_capture_t capture = NULL;
for (size_t i = 0; i < test_frame_count; i++)
{
Expand Down Expand Up @@ -168,7 +168,7 @@ void SampleRecordings::SetUp()
}

uint64_t timestamps[3] = { 1000000, 1001000, 1001000 }; // Start recording at 1s
uint32_t timestamp_delta = HZ_TO_PERIOD_US(k4a_convert_fps_to_uint((k4a_fps_t)record_config_full.fps_mode_id));
uint32_t timestamp_delta = HZ_TO_PERIOD_US((uint32_t)record_config_full.fps_mode_id);
for (size_t i = 0; i < test_frame_count; i++)
{
// Create a known pattern of dropped / missing frames that can be tested against
Expand Down Expand Up @@ -234,7 +234,7 @@ void SampleRecordings::SetUp()

uint64_t timestamps[3] = { 1000000, 1000000, 1000000 };
uint64_t imu_timestamp = 1001150;
uint32_t timestamp_delta = HZ_TO_PERIOD_US(k4a_convert_fps_to_uint((k4a_fps_t)record_config_delay.fps_mode_id));
uint32_t timestamp_delta = HZ_TO_PERIOD_US((uint32_t)record_config_delay.fps_mode_id);
k4a_capture_t capture = NULL;
for (size_t i = 0; i < test_frame_count; i++)
{
Expand Down
4 changes: 3 additions & 1 deletion tests/RecordTests/UnitTest/test_helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ static const char *const resolution_names[] = { "K4A_COLOR_RESOLUTION_OFF", "K
static const char *const depth_names[] = { "K4A_DEPTH_MODE_OFF", "K4A_DEPTH_MODE_NFOV_2X2BINNED",
"K4A_DEPTH_MODE_NFOV_UNBINNED", "K4A_DEPTH_MODE_WFOV_2X2BINNED",
"K4A_DEPTH_MODE_WFOV_UNBINNED", "K4A_DEPTH_MODE_PASSIVE_IR" };
static const char *const fps_names[] = { "K4A_FRAMES_PER_SECOND_5",
static const char *const fps_names[] = { "K4A_FRAMES_PER_SECOND_0",
"K4A_FRAMES_PER_SECOND_5",
"K4A_FRAMES_PER_SECOND_15",
"K4A_FRAMES_PER_SECOND_30" };

Expand All @@ -35,6 +36,7 @@ k4a_capture_t create_test_capture(uint64_t timestamp_us[3],
k4a_image_format_t color_format,
uint32_t color_mode_id,
uint32_t depth_mode_id);

bool validate_test_capture(k4a_capture_t capture,
uint64_t timestamp_us[3],
k4a_image_format_t color_format,
Expand Down
2 changes: 1 addition & 1 deletion tests/latency/latency_perf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -737,7 +737,7 @@ TEST_P(latency_perf, testTest)
disable_synchronization ? disable_synchronization : "0",
get_string_from_color_format(as.color_format),
get_string_from_color_resolution(as.color_resolution),
k4a_convert_fps_to_uint(as.fps),
(uint32_t)as.fps,
get_string_from_depth_mode(as.depth_mode),
g_capture_count,
g_manual_exposure,
Expand Down
Loading