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
61 commits
Select commit Hold shift + click to select a range
f7686a9
Add K4A_RESULT_UNSUPPORTED to result enums.
AntonClaytonBursch Nov 6, 2020
70eaf43
Structs for device, color, depth. Enum for calibration. Functions to …
AntonClaytonBursch Nov 11, 2020
143cd46
Updates examples, src, tests and tools to use new config and color an…
AntonClaytonBursch Nov 11, 2020
7496015
Added fps mode structs and functions.
AntonClaytonBursch Nov 11, 2020
163d176
Updated code to reflect change to using fps mode.
AntonClaytonBursch Nov 11, 2020
bdb2ed3
Moded color, depth and fps enums from k4a/k4atypes.h to k4ainternal/m…
AntonClaytonBursch Nov 13, 2020
dc0db6b
Updated c++ wrapper to use new color and depth modes.
AntonClaytonBursch Nov 17, 2020
b7de2fb
Updated C++ wrapper with get device, depth, color and fps functions. …
AntonClaytonBursch Nov 17, 2020
f9dda0a
Update k4arecord/types.h and examples to use color, depth and fps mod…
AntonClaytonBursch Nov 19, 2020
051f8eb
added depth range to k4a_depth_mode_info, updated get color/depth/fps…
AntonClaytonBursch Nov 23, 2020
14ccb08
Update k4astaticimageproperties.h to use k4a.hpp instead of k4a.h
AntonClaytonBursch Nov 23, 2020
4bc4c00
Quick fix: forgot to add K4A_EXPORT to get mode and mode count functi…
AntonClaytonBursch Nov 23, 2020
e3d04a3
examples, tests, tools refactored to use new get mode functions
AntonClaytonBursch Nov 30, 2020
9ceb3e1
quick comments fix in calibration example and updates to color_ft tes…
AntonClaytonBursch Dec 3, 2020
b5b3806
Changed get modes loops for fps, color and depth.
AntonClaytonBursch Dec 9, 2020
33c964f
Viewer mode selection from radio to comboboxes
AntonClaytonBursch Dec 17, 2020
fcac45f
using mode info types instead of mode info type index
AntonClaytonBursch Dec 30, 2020
eed589a
refactor to use mode info instead of mode id
AntonClaytonBursch Dec 31, 2020
fc655bd
using depth/color/fps mode info instead of mode id
AntonClaytonBursch Jan 4, 2021
a85ed66
mode id changes and GUI cleanup
AntonClaytonBursch Jan 5, 2021
9c97825
revert back from using device mode info to device mode id for fps/col…
AntonClaytonBursch Jan 11, 2021
a488ed1
Use constants defined in usb_cmd_priv.h to set the vendor id and devi…
AntonClaytonBursch Jan 13, 2021
0289b22
Used const for color/depth/fps mode info initializers.
AntonClaytonBursch Jan 14, 2021
01893b2
Passing depth mode info down to point cloud viewer. Moved static k4a…
AntonClaytonBursch Jan 19, 2021
a1b772d
color, depth and fps mode infos saved in and parsed from recordings
AntonClaytonBursch Jan 20, 2021
158b641
Initialize the size and version of the mode structs
AntonClaytonBursch Jan 22, 2021
66bc1e5
Moved K4A_MSFT_VID, K4A_RGB_PID and K4A_DEPTH_PID to usbcommand.h. A…
AntonClaytonBursch Jan 22, 2021
2a70cd1
error handling for saving modes and device info in recording
AntonClaytonBursch Jan 22, 2021
5f99801
color, depth, fps mode info and device info saved in and parse from r…
AntonClaytonBursch Jan 22, 2021
af6d217
Fixing K4A build errors in src/record/internal/matroska_read.cpp abou…
JonathanESantos Jan 26, 2021
c541fde
SDK: docstring changes for Doxygen to run without errors.
JonathanESantos Jan 26, 2021
7a7854a
Merge pull request #1 from AntonClaytonBursch/user/jonsanto/Bug5456_F…
AntonClaytonBursch Jan 26, 2021
8f573d2
Merge pull request #2 from AntonClaytonBursch/user/jonsanto/Story5373…
AntonClaytonBursch Jan 26, 2021
e8fe464
K4A API: Adding to docstrings that functions may return status of UNS…
JonathanESantos Jan 26, 2021
d592958
linked k4a_math in viewer
AntonClaytonBursch Jan 26, 2021
5d51a26
Recording description from mode info saved in recording (or legacy de…
AntonClaytonBursch Jan 26, 2021
e3bfdb2
Merge pull request #3 from AntonClaytonBursch/user/jonsanto/Task5460_…
AntonClaytonBursch Jan 26, 2021
81b9de6
Use modes for k4arecorder
AntonClaytonBursch Jan 27, 2021
7a91853
Recorder mode option listed.
AntonClaytonBursch Jan 27, 2021
1bc8889
Merge branch 'api-update' of https://github.com/AntonClaytonBursch/Az…
AntonClaytonBursch Jan 27, 2021
162a016
k4aviewer: Removing audio support. To turn on audio support, in tools…
JonathanESantos Jan 27, 2021
1ccc23f
k4aviewer: Removing support for audio and clangformat wants to format…
JonathanESantos Jan 27, 2021
a828c1e
working on recorder command line validation
AntonClaytonBursch Jan 27, 2021
5be389d
Merge branch 'api-update' into user/jonsanto/Task5467_RemoveSupportFo…
JonathanESantos Jan 27, 2021
46e53da
k4arecorder: Minor editing.
JonathanESantos Jan 27, 2021
b493720
k4a: Adding functional tests for calling the added functions in k4a.h.
JonathanESantos Jan 28, 2021
b32f3ac
Removing commented-out code.
JonathanESantos Jan 28, 2021
6d28e16
k4a: Fixing a test in depth_ft.
JonathanESantos Jan 28, 2021
e8c0f22
Update main.cpp
JonathanESantos Jan 28, 2021
c7279c3
Update main.cpp
JonathanESantos Jan 28, 2021
da96ffc
Update main.cpp
JonathanESantos Jan 28, 2021
235ba8f
Update main.cpp
JonathanESantos Jan 28, 2021
8d2a3b1
Update main.cpp
JonathanESantos Jan 28, 2021
fa07ae8
Merge pull request #5 from AntonClaytonBursch/user/jonsanto/Task5466_…
AntonClaytonBursch Jan 28, 2021
df3b755
validate recorder cmd options
AntonClaytonBursch Jan 28, 2021
f82b42d
finished validating recording cmd options
AntonClaytonBursch Jan 28, 2021
1166777
Fixed get fps mode in recorder.
AntonClaytonBursch Jan 28, 2021
bab38b8
Merge branch 'api-update' into user/jonsanto/Task5467_RemoveSupportFo…
AntonClaytonBursch Jan 28, 2021
d9f616d
Merge pull request #4 from AntonClaytonBursch/user/jonsanto/Task5467_…
AntonClaytonBursch Jan 28, 2021
a5f6512
Fix broken Linux build.
JonathanESantos Jan 29, 2021
b4df263
k4a: ninja clangformat made these formatting changes.
JonathanESantos Jan 29, 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
Moved K4A_MSFT_VID, K4A_RGB_PID and K4A_DEPTH_PID to usbcommand.h. Ad…
…ding device info to recordings.
  • Loading branch information
AntonClaytonBursch committed Jan 22, 2021
commit 66bc1e5562f5f0165e59bab866e2453843fc4006
4 changes: 4 additions & 0 deletions include/k4ainternal/usbcommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ typedef enum

K4A_DECLARE_HANDLE(usbcmd_t);

#define K4A_MSFT_VID 0x045E
#define K4A_RGB_PID 0x097D
#define K4A_DEPTH_PID 0x097C

/** Delivers a sample to the registered callback function when a capture is ready for processing.
*
* \param result
Expand Down
3 changes: 3 additions & 0 deletions include/k4arecord/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ typedef struct _k4a_record_configuration_t
/** Frame rate used to record the color and depth camera. */
k4a_fps_mode_info_t fps_mode_info;

// TODO: comment
k4a_device_info_t device_info;

/** True if the recording contains Color camera frames. */
bool color_track_enabled;

Expand Down
29 changes: 26 additions & 3 deletions src/record/internal/matroska_read.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

#include <ctime>
Expand All @@ -11,6 +11,7 @@
#include <k4ainternal/matroska_read.h>
#include <k4ainternal/common.h>
#include <k4ainternal/logging.h>
#include <k4ainternal\usbcommand.h>

#include <turbojpeg.h>
#include <libyuv.h>
Expand Down Expand Up @@ -645,14 +646,16 @@ k4a_result_t parse_recording_config(k4a_playback_context_t *context)
KaxTag *color_mode_info_tag = get_tag(context, "K4A_COLOR_MODE_INFO");
KaxTag *depth_mode_info_tag = get_tag(context, "K4A_DEPTH_MODE_INFO");
KaxTag *fps_mode_info_tag = get_tag(context, "K4A_FPS_MODE_INFO");
KaxTag *device_info_tag = get_tag(context, "K4A_DEVICE_INFO");

if (color_mode_info_tag != NULL && depth_mode_info_tag != NULL && fps_mode_info_tag != NULL)
if (color_mode_info_tag != NULL && depth_mode_info_tag != NULL && fps_mode_info_tag != NULL && device_info_tag != NULL)
{
std::string color_mode_info_string = get_tag_string(color_mode_info_tag);
std::string depth_mode_info_string = get_tag_string(depth_mode_info_tag);
std::string fps_mode_info_string = get_tag_string(fps_mode_info_tag);
std::string device_info_string = get_tag_string(device_info_tag);

if (!color_mode_info_string.empty() && !depth_mode_info_string.empty() && !fps_mode_info_string.empty())
if (!color_mode_info_string.empty() && !depth_mode_info_string.empty() && !fps_mode_info_string.empty() && !device_info_string.empty())
{
cJSON *color_mode_info_json = cJSON_Parse(color_mode_info_string.c_str());
const cJSON *color_mode_info_json_mode_id = cJSON_GetObjectItem(color_mode_info_json, "mode_id");
Expand Down Expand Up @@ -710,15 +713,28 @@ k4a_result_t parse_recording_config(k4a_playback_context_t *context)
fps_mode_info.mode_id = (uint32_t)fps_mode_info_json_mode_id->valuedouble;
fps_mode_info.fps = (uint32_t)fps_mode_info_json_fps->valuedouble;

// device info
cJSON *device_info_json = cJSON_Parse(device_info_string.c_str());
const cJSON *device_info_json_capabilities = cJSON_GetObjectItem(device_info_json, "capabilities");
const cJSON *device_info_json_device_id = cJSON_GetObjectItem(device_info_json, "device_id");
const cJSON *device_info_json_vendor_id = cJSON_GetObjectItem(device_info_json, "vendor_id");

k4a_device_info_t device_info = { sizeof(k4a_device_info_t), K4A_ABI_VERSION, { 0 } };
device_info.capabilities = (uint32_t)device_info_json_capabilities->valuedouble;
device_info.device_id = (uint32_t)device_info_json_device_id->valuedouble;
device_info.vendor_id = (uint32_t)device_info_json_vendor_id->valuedouble;

// set record config modes
context->record_config.color_mode_info = color_mode_info;
context->record_config.depth_mode_info = depth_mode_info;
context->record_config.fps_mode_info = fps_mode_info;
context->record_config.device_info = device_info;

// delete json objects
cJSON_Delete(color_mode_info_json);
cJSON_Delete(depth_mode_info_json);
cJSON_Delete(fps_mode_info_json);
cJSON_Delete(device_info_json);
}
}
else
Expand Down Expand Up @@ -798,9 +814,16 @@ k4a_result_t parse_recording_config(k4a_playback_context_t *context)
fps_mode_info.mode_id = fps_mode_id;
fps_mode_info.fps = recording_fps_modes[fps_mode_id].fps;

k4a_device_info_t device_info = { sizeof(k4a_device_info_t),
K4A_ABI_VERSION,
K4A_MSFT_VID,
K4A_DEPTH_PID,
​​​​​​K4A_CAPABILITY_DEPTH | K4A_CAPABILITY_COLOR | K4A_CAPABILITY_IMU };

context->record_config.color_mode_info = color_mode_info;
context->record_config.depth_mode_info = depth_mode_info;
context->record_config.fps_mode_info = fps_mode_info;
context->record_config.device_info = device_info;
}

// Read depth_delay_off_color_usec and set offsets for each builtin track accordingly.
Expand Down
18 changes: 16 additions & 2 deletions src/record/sdk/record.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ k4a_result_t k4a_record_create(const char *path,
const char *color_mode_info_str = "";
const char *depth_mode_info_str = "";
const char *fps_mode_info_str = "";
const char *device_info_str = "";

// get mode info structs
k4a_color_mode_info_t color_mode_info = { sizeof(k4a_color_mode_info_t), K4A_ABI_VERSION, { 0 } };
Expand All @@ -357,6 +358,9 @@ k4a_result_t k4a_record_create(const char *path,
k4a_fps_mode_info_t fps_mode_info = { sizeof(k4a_fps_mode_info_t), K4A_ABI_VERSION, { 0 } };
k4a_device_get_fps_mode(device, device_config.fps_mode_id, &fps_mode_info);

k4a_device_info_t device_info = { sizeof(k4a_device_info_t), K4A_ABI_VERSION, { 0 } };
k4a_device_get_info(device, &device_info);

// print to json

// color
Expand Down Expand Up @@ -396,25 +400,35 @@ k4a_result_t k4a_record_create(const char *path,
cJSON_AddNumberToObject(fps_mode_info_json, "mode_id", fps_mode_info.mode_id);
cJSON_AddNumberToObject(fps_mode_info_json, "fps", fps_mode_info.fps);

std::cout << "fps: " << fps_mode_info.fps << std::endl;

fps_mode_info_str = cJSON_Print(fps_mode_info_json);

// device info
cJSON *device_info_json = cJSON_CreateObject();

cJSON_AddNumberToObject(device_info_json, "capabilities", device_info.capabilities);
cJSON_AddNumberToObject(device_info_json, "device_id", device_info.device_id);
cJSON_AddNumberToObject(device_info_json, "vendor_id", device_info.vendor_id);

device_info_str = cJSON_Print(device_info_json);

// TODO: remove after finished testing
// k4arecorder -l 10 -c 1080p -d NFOV_2X2BINNED -r 30 "D:\Neal Analytics\Microsoft\Kinect Recordings\output.mkv"
std::cout << color_mode_info_str << std::endl;
std::cout << depth_mode_info_str << std::endl;
std::cout << fps_mode_info_str << std::endl;
std::cout << device_info_str << std::endl;

// save json in tags
add_tag(context, "K4A_COLOR_MODE_INFO", color_mode_info_str);
add_tag(context, "K4A_DEPTH_MODE_INFO", depth_mode_info_str);
add_tag(context, "K4A_FPS_MODE_INFO", fps_mode_info_str);
add_tag(context, "K4A_DEVICE_INFO", device_info_str);

// delete json objects
cJSON_Delete(color_mode_info_json);
cJSON_Delete(depth_mode_info_json);
cJSON_Delete(fps_mode_info_json);
cJSON_Delete(device_info_json);
}


Expand Down
2 changes: 1 addition & 1 deletion src/sdk/k4a.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <k4ainternal/logging.h>
#include <k4ainternal/modes.h>
#include <azure_c_shared_utility/tickcounter.h>
#include <k4ainternal\usbcommand.h>

// System dependencies
#include <stdlib.h>
Expand All @@ -28,7 +29,6 @@
#ifdef __cplusplus
extern "C" {
#endif
#include "../usbcommand/usb_cmd_priv.h"

char K4A_ENV_VAR_LOG_TO_A_FILE[] = K4A_ENABLE_LOG_TO_A_FILE;

Expand Down
3 changes: 0 additions & 3 deletions src/usbcommand/usb_cmd_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,6 @@ extern "C" {
#define USB_MAX_TX_DATA 128
#define USB_CMD_PACKET_TYPE 0x06022009
#define USB_CMD_PACKET_TYPE_RESPONSE 0x0A6FE000
#define K4A_MSFT_VID 0x045E
#define K4A_RGB_PID 0x097D
#define K4A_DEPTH_PID 0x097C
#define USB_CMD_DEFAULT_CONFIG 1

#define USB_CMD_DEPTH_INTERFACE 0
Expand Down