From b3d658b833eb957a18228a1029f0dcd4a8570bdb Mon Sep 17 00:00:00 2001 From: Asuki Kono Date: Fri, 28 Jul 2023 23:15:59 +0900 Subject: [PATCH 1/7] Update azure_c_shared --- extern/azure_c_shared/src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/azure_c_shared/src b/extern/azure_c_shared/src index 5a70f2770..3b32444f1 160000 --- a/extern/azure_c_shared/src +++ b/extern/azure_c_shared/src @@ -1 +1 @@ -Subproject commit 5a70f27709a2d4869b7db6794887481db28260d0 +Subproject commit 3b32444f1b57d5ccc7f45a45a9bb60eca695f847 From 3b36a3864f87982083f38176b9da3cd225449024 Mon Sep 17 00:00:00 2001 From: Asuki Kono Date: Fri, 28 Jul 2023 23:24:32 +0900 Subject: [PATCH 2/7] Update libebml to latest version --- extern/libebml/src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/libebml/src b/extern/libebml/src index 87b4d4f78..5e22128f9 160000 --- a/extern/libebml/src +++ b/extern/libebml/src @@ -1 +1 @@ -Subproject commit 87b4d4f787d6b444f29a3a9e854b916d10080c96 +Subproject commit 5e22128f9cc745af9ad06ce4436b501b2354c1b6 From 5d792877a4294256ae7c5f7901aed65ce8dac02a Mon Sep 17 00:00:00 2001 From: Asuki Kono Date: Sat, 29 Jul 2023 14:31:00 +0900 Subject: [PATCH 3/7] Update libmatroska to latest --- extern/libmatroska/src | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extern/libmatroska/src b/extern/libmatroska/src index 2cf0198cf..44aefa8ff 160000 --- a/extern/libmatroska/src +++ b/extern/libmatroska/src @@ -1 +1 @@ -Subproject commit 2cf0198cf3df9ced38c27fac9d45bea4fe8fd74f +Subproject commit 44aefa8ff53562367100619cb79c949b2bb6b87e From b68e654f61c87342e9644bef7b570bbbd45c9436 Mon Sep 17 00:00:00 2001 From: Asuki Kono Date: Sat, 29 Jul 2023 17:49:29 +0900 Subject: [PATCH 4/7] Update library name for EBML and Matroska --- extern/libebml/CMakeLists.txt | 2 +- extern/libmatroska/CMakeLists.txt | 4 ++-- extern/libmatroska/{EbmlConfig.cmake => EBMLConfig.cmake} | 0 .../{EbmlConfigVersion.cmake => EBMLConfigVersion.cmake} | 2 +- src/record/internal/CMakeLists.txt | 8 ++++---- src/record/sdk/CMakeLists.txt | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) rename extern/libmatroska/{EbmlConfig.cmake => EBMLConfig.cmake} (100%) rename extern/libmatroska/{EbmlConfigVersion.cmake => EBMLConfigVersion.cmake} (89%) diff --git a/extern/libebml/CMakeLists.txt b/extern/libebml/CMakeLists.txt index 498c114ad..2c5567a23 100644 --- a/extern/libebml/CMakeLists.txt +++ b/extern/libebml/CMakeLists.txt @@ -12,4 +12,4 @@ else() message(STATUS "ebml is already a target. Skipping adding it twice") endif() -add_library(ebml::ebml ALIAS ebml) \ No newline at end of file +add_library(EBML::ebml ALIAS ebml) diff --git a/extern/libmatroska/CMakeLists.txt b/extern/libmatroska/CMakeLists.txt index 355455a50..e4a0cec94 100644 --- a/extern/libmatroska/CMakeLists.txt +++ b/extern/libmatroska/CMakeLists.txt @@ -10,11 +10,11 @@ if (NOT TARGET matroska) # This is a hack to trick libmatroska into thinking there is an installed # version of ebml. In reality, ebml is already a target since its source is # part of the build graph. - set(Ebml_DIR "${CMAKE_CURRENT_LIST_DIR}") + set(EBML_DIR "${CMAKE_CURRENT_LIST_DIR}") add_subdirectory(src EXCLUDE_FROM_ALL) else() message(STATUS "matroska is already a target. Skipping adding it twice") endif() -add_library(matroska::matroska ALIAS matroska) +add_library(Matroska::matroska ALIAS matroska) diff --git a/extern/libmatroska/EbmlConfig.cmake b/extern/libmatroska/EBMLConfig.cmake similarity index 100% rename from extern/libmatroska/EbmlConfig.cmake rename to extern/libmatroska/EBMLConfig.cmake diff --git a/extern/libmatroska/EbmlConfigVersion.cmake b/extern/libmatroska/EBMLConfigVersion.cmake similarity index 89% rename from extern/libmatroska/EbmlConfigVersion.cmake rename to extern/libmatroska/EBMLConfigVersion.cmake index 68cc82ee3..cadc8ecc7 100644 --- a/extern/libmatroska/EbmlConfigVersion.cmake +++ b/extern/libmatroska/EBMLConfigVersion.cmake @@ -2,6 +2,6 @@ # version of ebml. In reality, ebml is already a target since its source is # part of the build graph. -set(PACKAGE_VERSION 1.3.5) +set(PACKAGE_VERSION 1.4.4) set(PACKAGE_VERSION_EXACT YES) set(PACKAGE_VERSION_EXACT YES) diff --git a/src/record/internal/CMakeLists.txt b/src/record/internal/CMakeLists.txt index 97c6cf3a2..18af1cea6 100644 --- a/src/record/internal/CMakeLists.txt +++ b/src/record/internal/CMakeLists.txt @@ -22,15 +22,15 @@ target_include_directories(k4a_playback PUBLIC target_link_libraries(k4a_record PUBLIC k4a::k4a k4ainternal::logging - ebml::ebml - matroska::matroska + EBML::ebml + Matroska::matroska ) target_link_libraries(k4a_playback PUBLIC k4a::k4a k4ainternal::logging - ebml::ebml - matroska::matroska + EBML::ebml + Matroska::matroska libyuv::libyuv libjpeg-turbo::libjpeg-turbo ) diff --git a/src/record/sdk/CMakeLists.txt b/src/record/sdk/CMakeLists.txt index 2e2329552..d150e7081 100644 --- a/src/record/sdk/CMakeLists.txt +++ b/src/record/sdk/CMakeLists.txt @@ -40,8 +40,8 @@ target_link_libraries(k4arecord PRIVATE k4ainternal::record k4ainternal::playback k4ainternal::logging - ebml::ebml - matroska::matroska + EBML::ebml + Matroska::matroska ) target_link_libraries(k4arecord PUBLIC From 2bb63f0ad9e43ff835237aa8ad7c9d89ad73eec7 Mon Sep 17 00:00:00 2001 From: Asuki Kono Date: Sat, 29 Jul 2023 17:50:04 +0900 Subject: [PATCH 5/7] Use UINT8_MAX --- examples/viewer/opengl/k4adepthpixelcolorizer.h | 4 ++-- tools/k4aviewer/k4adepthpixelcolorizer.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/viewer/opengl/k4adepthpixelcolorizer.h b/examples/viewer/opengl/k4adepthpixelcolorizer.h index 65ea42574..d9751756a 100644 --- a/examples/viewer/opengl/k4adepthpixelcolorizer.h +++ b/examples/viewer/opengl/k4adepthpixelcolorizer.h @@ -36,7 +36,7 @@ class K4ADepthPixelColorizer const DepthPixel &min, const DepthPixel &max) { - constexpr uint8_t PixelMax = std::numeric_limits::max(); + constexpr uint8_t PixelMax = UINT8_MAX; // Default to opaque black. // @@ -90,7 +90,7 @@ class K4ADepthPixelColorizer // DepthPixel pixelValue = std::min(value, max); - constexpr uint8_t PixelMax = std::numeric_limits::max(); + constexpr uint8_t PixelMax = UINT8_MAX; const auto normalizedValue = static_cast((pixelValue - min) * (double(PixelMax) / (max - min))); // All color channels are set the same (image is greyscale) diff --git a/tools/k4aviewer/k4adepthpixelcolorizer.h b/tools/k4aviewer/k4adepthpixelcolorizer.h index 945899732..b5076dfa2 100644 --- a/tools/k4aviewer/k4adepthpixelcolorizer.h +++ b/tools/k4aviewer/k4adepthpixelcolorizer.h @@ -36,7 +36,7 @@ class K4ADepthPixelColorizer const DepthPixel &min, const DepthPixel &max) { - constexpr uint8_t PixelMax = std::numeric_limits::max(); + constexpr uint8_t PixelMax = UINT8_MAX; // Default to opaque black. // @@ -90,7 +90,7 @@ class K4ADepthPixelColorizer // DepthPixel pixelValue = std::min(value, max); - constexpr uint8_t PixelMax = std::numeric_limits::max(); + constexpr uint8_t PixelMax = UINT8_MAX; const auto normalizedValue = static_cast((pixelValue - min) * (double(PixelMax) / (max - min))); // All color channels are set the same (image is greyscale) From 5c0ad335da0066d2e1560947030420e5987abb33 Mon Sep 17 00:00:00 2001 From: Asuki Kono Date: Sat, 29 Jul 2023 17:50:29 +0900 Subject: [PATCH 6/7] Change to size_t for returning value of LargeFileIOCallback::read --- include/k4ainternal/matroska_common.h | 2 +- src/record/internal/iocallback.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/k4ainternal/matroska_common.h b/include/k4ainternal/matroska_common.h index 0bc26f6f9..31cafcd50 100644 --- a/include/k4ainternal/matroska_common.h +++ b/include/k4ainternal/matroska_common.h @@ -142,7 +142,7 @@ class LargeFileIOCallback : public libebml::IOCallback LargeFileIOCallback(const char *path, const open_mode mode); ~LargeFileIOCallback() override; - uint32 read(void *buffer, size_t size) override; + size_t read(void *buffer, size_t size) override; void setFilePointer(int64 offset, libebml::seek_mode mode = libebml::seek_beginning) override; size_t write(const void *buffer, size_t size) override; uint64 getFilePointer() override; diff --git a/src/record/internal/iocallback.cpp b/src/record/internal/iocallback.cpp index 80e96e0ab..83438e310 100644 --- a/src/record/internal/iocallback.cpp +++ b/src/record/internal/iocallback.cpp @@ -41,7 +41,7 @@ LargeFileIOCallback::~LargeFileIOCallback() close(); } -uint32 LargeFileIOCallback::read(void *buffer, size_t size) +size_t LargeFileIOCallback::read(void *buffer, size_t size) { assert(size <= UINT32_MAX); // can't properly return > uint32 assert(m_owner == std::this_thread::get_id()); From db0baa92e735da8a680ece450baf4b230fae6edf Mon Sep 17 00:00:00 2001 From: Asuki Kono Date: Sun, 30 Jul 2023 13:58:47 +0900 Subject: [PATCH 7/7] Update Dockerfile and setup-ubuntu script for ubuntu22.04 --- scripts/docker/Dockerfile | 6 ++++-- scripts/docker/setup-ubuntu.sh | 34 +++++++++++++--------------------- 2 files changed, 17 insertions(+), 23 deletions(-) diff --git a/scripts/docker/Dockerfile b/scripts/docker/Dockerfile index a0006c0ba..63173248e 100644 --- a/scripts/docker/Dockerfile +++ b/scripts/docker/Dockerfile @@ -1,10 +1,11 @@ -ARG UBUNTU_VERSION=18.04 +ARG UBUNTU_VERSION=22.04 # Use the official ubuntu:18.04 image as the parent image FROM ubuntu:${UBUNTU_VERSION} # Set the working directory to /app WORKDIR /app +ARG UBUNTU_VERSION ARG ARCH=amd64 ADD setup-ubuntu.sh /app @@ -13,8 +14,9 @@ ADD sources.list /app # Tell Ubuntu non-interactive install ARG DEBIAN_FRONTEND=noninteractive +RUN echo ubuntu version ${UBUNTU_VERSION} -RUN ./setup-ubuntu.sh ${ARCH} +RUN bash ./setup-ubuntu.sh ${ARCH} ${UBUNTU_VERSION} RUN apt-get install -y ca-certificates RUN update-ca-certificates \ No newline at end of file diff --git a/scripts/docker/setup-ubuntu.sh b/scripts/docker/setup-ubuntu.sh index 9bf440bfc..3045bf3b5 100644 --- a/scripts/docker/setup-ubuntu.sh +++ b/scripts/docker/setup-ubuntu.sh @@ -1,36 +1,28 @@ #!/bin/bash -# Usage: -# ./setup-ubuntu.sh [arm64 | amd64] +if [ "$1" = "" ] || [ "$2" = "" ]; then + echo "Please execute with target device and image. +$0 target_device image -# Warning! This will override your sources.list file!! - -arch=amd64 - -# Copy off old sources.list file -cp /etc/apt/sources.list /etc/apt/sources.list.old -echo "Backed up /etc/apt/sources.list to /etc/apt/sources.list.old" +Usage: +$0 [arm64 | amd64] [ubuntu-version like 22.04]" + exit 1 +fi -# Copy over the new file -cp sources.list /etc/apt/sources.list -echo "Overwrote /etc/apt/sources.list with sources.list" +arch=$1 +UBUNTU_VERSION=$2 apt-get update apt-get install wget -y # Add Public microsoft repo keys to the image -wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -dpkg -i packages-microsoft-prod.deb - -if [ "$1" = "arm64" ]; then - arch="arm64" -fi +wget -q https://packages.microsoft.com/config/ubuntu/${UBUNTU_VERSION}/packages-microsoft-prod.deb -P /tmp +dpkg -i /tmp/packages-microsoft-prod.deb echo "Setting up for building $arch binaries" -dpkg --add-architecture amd64 -dpkg --add-architecture arm64 +dpkg --add-architecture $arch apt-get update @@ -72,4 +64,4 @@ if [ "$arch" = "amd64" ]; then packages+=(libopencv-dev:$arch) fi -apt-get install -y --no-install-recommends ${packages[@]} \ No newline at end of file +apt-get install -y --no-install-recommends ${packages[@]}