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

Support ubuntu 22.04 #1941

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions examples/viewer/opengl/k4adepthpixelcolorizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class K4ADepthPixelColorizer
const DepthPixel &min,
const DepthPixel &max)
{
constexpr uint8_t PixelMax = std::numeric_limits<uint8_t>::max();
constexpr uint8_t PixelMax = UINT8_MAX;

// Default to opaque black.
//
Expand Down Expand Up @@ -90,7 +90,7 @@ class K4ADepthPixelColorizer
//
DepthPixel pixelValue = std::min(value, max);

constexpr uint8_t PixelMax = std::numeric_limits<uint8_t>::max();
constexpr uint8_t PixelMax = UINT8_MAX;
const auto normalizedValue = static_cast<uint8_t>((pixelValue - min) * (double(PixelMax) / (max - min)));

// All color channels are set the same (image is greyscale)
Expand Down
2 changes: 1 addition & 1 deletion extern/azure_c_shared/src
Submodule src updated 251 files
2 changes: 1 addition & 1 deletion extern/libebml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ else()
message(STATUS "ebml is already a target. Skipping adding it twice")
endif()

add_library(ebml::ebml ALIAS ebml)
add_library(EBML::ebml ALIAS ebml)
2 changes: 1 addition & 1 deletion extern/libebml/src
Submodule src updated 74 files
+30 −0 .github/workflows/linux-gcc10.yaml
+27 −0 .github/workflows/linux.yaml
+31 −0 .github/workflows/macos.yaml
+36 −0 .github/workflows/uwp.yaml
+40 −0 .github/workflows/windows.yaml
+67 −47 CMakeLists.txt
+0 −1,776 ChangeLog
+5 −0 EBMLConfig.cmake.in
+0 −1 EbmlConfig.cmake
+250 −0 NEWS.md
+22 −5 README.md
+0 −170 ebml/Debug.h
+15 −21 ebml/EbmlBinary.h
+3 −84 ebml/EbmlConfig.h
+2 −2 ebml/EbmlContexts.h
+23 −23 ebml/EbmlCrc32.h
+15 −16 ebml/EbmlDate.h
+6 −7 ebml/EbmlDummy.h
+111 −83 ebml/EbmlElement.h
+142 −9 ebml/EbmlEndian.h
+10 −11 ebml/EbmlFloat.h
+2 −4 ebml/EbmlHead.h
+10 −11 ebml/EbmlId.h
+24 −24 ebml/EbmlMaster.h
+21 −22 ebml/EbmlSInteger.h
+5 −7 ebml/EbmlStream.h
+9 −12 ebml/EbmlString.h
+2 −16 ebml/EbmlSubHead.h
+21 −24 ebml/EbmlTypes.h
+21 −22 ebml/EbmlUInteger.h
+15 −18 ebml/EbmlUnicodeString.h
+5 −5 ebml/EbmlVersion.h
+6 −8 ebml/EbmlVoid.h
+9 −9 ebml/IOCallback.h
+21 −18 ebml/MemIOCallback.h
+15 −15 ebml/MemReadIOCallback.h
+26 −28 ebml/SafeReadIOCallback.h
+14 −20 ebml/StdIOCallback.h
+0 −133 ebml/c/libebml_t.h
+1 −1 libebml.pc.in
+0 −83 libebml.proj
+0 −240 src/Debug.cpp
+33 −16 src/EbmlBinary.cpp
+5 −5 src/EbmlContexts.cpp
+72 −76 src/EbmlCrc32.cpp
+16 −22 src/EbmlDate.cpp
+3 −3 src/EbmlDummy.cpp
+131 −133 src/EbmlElement.cpp
+38 −43 src/EbmlFloat.cpp
+3 −3 src/EbmlHead.cpp
+112 −154 src/EbmlMaster.cpp
+48 −47 src/EbmlSInteger.cpp
+4 −7 src/EbmlStream.cpp
+23 −28 src/EbmlString.cpp
+9 −9 src/EbmlSubHead.cpp
+39 −38 src/EbmlUInteger.cpp
+73 −129 src/EbmlUnicodeString.cpp
+3 −3 src/EbmlVersion.cpp
+12 −12 src/EbmlVoid.cpp
+19 −18 src/IOCallback.cpp
+16 −15 src/MemIOCallback.cpp
+14 −16 src/MemReadIOCallback.cpp
+36 −35 src/SafeReadIOCallback.cpp
+34 −55 src/StdIOCallback.cpp
+1,503 −0 src/lib/utf8-cpp/README.md
+1 −0 src/lib/utf8-cpp/git-info.txt
+34 −0 src/lib/utf8-cpp/source/utf8.h
+335 −0 src/lib/utf8-cpp/source/utf8/checked.h
+338 −0 src/lib/utf8-cpp/source/utf8/core.h
+103 −0 src/lib/utf8-cpp/source/utf8/cpp11.h
+103 −0 src/lib/utf8-cpp/source/utf8/cpp17.h
+274 −0 src/lib/utf8-cpp/source/utf8/unchecked.h
+13 −51 src/platform/win32/WinIOCallback.cpp
+7 −7 src/platform/win32/WinIOCallback.h
4 changes: 2 additions & 2 deletions extern/libmatroska/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion extern/libmatroska/src
Submodule src updated 59 files
+50 −0 .github/workflows/linux-gcc10.yaml
+44 −0 .github/workflows/linux.yaml
+48 −0 .github/workflows/macos.yaml
+52 −0 .github/workflows/uwp.yaml
+57 −0 .github/workflows/windows.yaml
+64 −28 CMakeLists.txt
+0 −2,099 ChangeLog
+0 −1 MatroskaConfig.cmake
+8 −0 MatroskaConfig.cmake.in
+261 −0 NEWS.md
+9 −3 README.md
+0 −67 libmatroska.proj
+6 −87 matroska/FileKax.h
+93 −101 matroska/KaxBlock.h
+13 −13 matroska/KaxBlockData.h
+0 −1 matroska/KaxChapters.h
+25 −25 matroska/KaxCluster.h
+5 −27 matroska/KaxConfig.h
+4 −5 matroska/KaxContexts.h
+10 −10 matroska/KaxCues.h
+16 −15 matroska/KaxCuesData.h
+19 −20 matroska/KaxDefines.h
+17 −18 matroska/KaxInfoData.h
+8 −9 matroska/KaxSeekHead.h
+7 −7 matroska/KaxSegment.h
+499 −122 matroska/KaxSemantic.h
+0 −1 matroska/KaxTag.h
+0 −1 matroska/KaxTrackVideo.h
+11 −11 matroska/KaxTracks.h
+56 −4 matroska/KaxTypes.h
+6 −6 matroska/KaxVersion.h
+0 −119 matroska/c/libmatroska.h
+0 −108 matroska/c/libmatroska_t.h
+6 −362 src/FileKax.cpp
+3 −4 src/KaxAttached.cpp
+3 −4 src/KaxAttachments.cpp
+338 −305 src/KaxBlock.cpp
+13 −22 src/KaxBlockData.cpp
+87 −113 src/KaxCluster.cpp
+5 −6 src/KaxContexts.cpp
+44 −51 src/KaxCues.cpp
+72 −76 src/KaxCuesData.cpp
+2 −13 src/KaxInfoData.cpp
+42 −54 src/KaxSeekHead.cpp
+9 −14 src/KaxSegment.cpp
+460 −371 src/KaxSemantic.cpp
+3 −5 src/KaxTracks.cpp
+3 −4 src/KaxVersion.cpp
+0 −13 test/ebml/ebml.proj
+14 −15 test/ebml/test0.cpp
+33 −33 test/ebml/test00.cpp
+0 −13 test/mux/mux.proj
+13 −19 test/mux/test6.cpp
+146 −224 test/mux/test8.cpp
+0 −6 test/tags/tags.proj
+0 −238 test/tags/test9.cpp
+0 −9 test/test.proj
+3 −4 test/utf8/test5.cpp
+0 −6 test/utf8/utf8.proj
2 changes: 1 addition & 1 deletion include/k4ainternal/matroska_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 4 additions & 2 deletions scripts/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
34 changes: 13 additions & 21 deletions scripts/docker/setup-ubuntu.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -72,4 +64,4 @@ if [ "$arch" = "amd64" ]; then
packages+=(libopencv-dev:$arch)
fi

apt-get install -y --no-install-recommends ${packages[@]}
apt-get install -y --no-install-recommends ${packages[@]}
8 changes: 4 additions & 4 deletions src/record/internal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
2 changes: 1 addition & 1 deletion src/record/internal/iocallback.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
4 changes: 2 additions & 2 deletions src/record/sdk/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tools/k4aviewer/k4adepthpixelcolorizer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class K4ADepthPixelColorizer
const DepthPixel &min,
const DepthPixel &max)
{
constexpr uint8_t PixelMax = std::numeric_limits<uint8_t>::max();
constexpr uint8_t PixelMax = UINT8_MAX;

// Default to opaque black.
//
Expand Down Expand Up @@ -90,7 +90,7 @@ class K4ADepthPixelColorizer
//
DepthPixel pixelValue = std::min(value, max);

constexpr uint8_t PixelMax = std::numeric_limits<uint8_t>::max();
constexpr uint8_t PixelMax = UINT8_MAX;
const auto normalizedValue = static_cast<uint8_t>((pixelValue - min) * (double(PixelMax) / (max - min)));

// All color channels are set the same (image is greyscale)
Expand Down
Loading