Skip to content
This repository has been archived by the owner on Aug 22, 2024. It is now read-only.

Added k4a_image_get/set_system_timestamp_nsec #350

Merged
merged 11 commits into from
May 31, 2019
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@
[submodule "extern/libusb/src"]
path = extern/libusb/src
url = https://github.com/libusb/libusb
[submodule "extern/libuvc/src"]
path = extern/libuvc/src
url = https://github.com/wes-b/libuvc.git
wes-b marked this conversation as resolved.
Show resolved Hide resolved
branch = Azure-Kinect-Sensor-SDK
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
## Change Log

### v1.2.0

* Added new API's k4a_image_get_device_timestamp_usec(), k4a_image_get_system_timestamp_usec(),
k4a_image_set_device_timestamp_usec(), k4a_image_set_system_timestamp_usec(), and k4a_image_set_exposure_usec().
wes-b marked this conversation as resolved.
Show resolved Hide resolved
* Deprecated API's k4a_image_get_timestamp_usec(), k4a_image_set_timestamp_usec(), and k4a_image_set_exposure_time_usec().

### v1.1.0

* Clean up repo documentation for going public.
Expand Down
4 changes: 2 additions & 2 deletions examples/playback_external_sync/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ static uint64_t first_capture_timestamp(k4a_capture_t capture)
{
if (images[i] != NULL)
{
uint64_t timestamp = k4a_image_get_timestamp_usec(images[i]);
uint64_t timestamp = k4a_image_get_device_timestamp_usec(images[i]);
if (timestamp < min_timestamp)
{
min_timestamp = timestamp;
Expand All @@ -51,7 +51,7 @@ static void print_capture_info(recording_t *file)
{
if (images[i] != NULL)
{
uint64_t timestamp = k4a_image_get_timestamp_usec(images[i]) +
uint64_t timestamp = k4a_image_get_device_timestamp_usec(images[i]) +
(uint64_t)file->record_config.start_timestamp_offset_usec;
printf(" %7ju usec", timestamp);
k4a_image_release(images[i]);
Expand Down
2 changes: 1 addition & 1 deletion extern/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ add_subdirectory(libjpeg-turbo)
add_subdirectory(libmatroska)
add_subdirectory(libsoundio)
add_subdirectory(libyuv)
add_subdirectory(spdlog)
add_subdirectory(libuvc)
add_subdirectory(spdlog)
if (NOT ${CMAKE_SYSTEM_NAME} STREQUAL "WindowsStore")
add_subdirectory(libusb)
endif()
36 changes: 10 additions & 26 deletions extern/libuvc/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
if (NOT TARGET project_libuvc)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux")
if (NOT TARGET uvc_static)
set(CMAKE_BUILD_TARGET Static)
add_subdirectory(src EXCLUDE_FROM_ALL)
else()
message(STATUS "uvc_static is already a target. Skipping adding it twice")
endif()

include(ExternalProject)
ExternalProject_Add(project_libuvc
GIT_REPOSITORY https://github.com/ktossell/libuvc.git
GIT_TAG "v0.0.6"
PREFIX "${CMAKE_CURRENT_BINARY_DIR}"
BUILD_BYPRODUCTS ${CMAKE_CURRENT_BINARY_DIR}/lib/${CMAKE_LIBRARY_ARCHITECTURE}/libuvc.a
CMAKE_ARGS -DCMAKE_BUILD_TARGET=Static -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_BINARY_DIR} -DCMAKE_LIBRARY_ARCHITECTURE=${CMAKE_LIBRARY_ARCHITECTURE} -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE
PATCH_COMMAND patch -s -N -p3 < ${CMAKE_CURRENT_SOURCE_DIR}/libuvc_metadata.patch || True
)

ExternalProject_Get_Property(project_libuvc install_dir)

file(MAKE_DIRECTORY ${install_dir}/include)
add_library(libuvc::libuvc ALIAS uvc_static)
target_include_directories(uvc_static PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/src/include>")
target_include_directories(uvc_static PUBLIC "$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/src/include>")

add_library(libuvc::libuvc STATIC IMPORTED GLOBAL)
add_dependencies(libuvc::libuvc
project_libuvc
LibUSB::LibUSB)
set_target_properties(libuvc::libuvc PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES ${install_dir}/include
IMPORTED_LOCATION ${install_dir}/lib/${CMAKE_LIBRARY_ARCHITECTURE}/libuvc.a)
endif()

else()
message(STATUS "libuvc is already a target. Skipping adding it twice")
endif()
endif()
Loading