Skip to content

Commit

Permalink
PR #10255 from Samer: fix GHA pr_check exit on error + fix line endings
Browse files Browse the repository at this point in the history
  • Loading branch information
maloel authored Feb 22, 2022
2 parents 5faf7c5 + 1b2ec83 commit ea2c159
Show file tree
Hide file tree
Showing 10 changed files with 818 additions and 767 deletions.
71 changes: 61 additions & 10 deletions .github/workflows/buildsCI.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,16 @@ jobs:
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
- name: Check_API
shell: bash
run: |
cd scripts
./api_check.sh
cd ..
- name: PreBuild
shell: bash
run: |
cd scripts && ./api_check.sh && cd ..
mkdir build
- name: Configure CMake
Expand Down Expand Up @@ -96,10 +102,16 @@ jobs:
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
- name: Check_API
shell: bash
run: |
cd scripts
./api_check.sh
cd ..
- name: PreBuild
shell: bash
run: |
cd scripts && ./api_check.sh && cd ..
mkdir build
- name: Configure CMake
Expand Down Expand Up @@ -136,10 +148,16 @@ jobs:
run: |
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
- name: Check_API
shell: bash
run: |
cd scripts
./api_check.sh
cd ..
- name: PreBuild
shell: bash
run: |
cd scripts && ./api_check.sh && cd ..
mkdir build
- name: Configure CMake
Expand All @@ -166,11 +184,18 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Check_API
shell: bash
run: |
cd scripts
./api_check.sh
cd ..
- name: Prebuild
shell: bash
run: |
cd scripts && ./api_check.sh && cd ..
mkdir build && cd build
mkdir build
cd build
export LRS_LOG_LEVEL="DEBUG";
sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test;
sudo apt-get update;
Expand Down Expand Up @@ -234,12 +259,20 @@ jobs:
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5;
sudo apt-get install libglfw3-dev libglfw3;
- name: Check_API
shell: bash
run: |
cd scripts
./api_check.sh
cd ..
- name: Build
shell: bash
run: |
cd scripts && ./api_check.sh && cd ..
mkdir build
cd ./scripts && ./pr_check.sh && cd ../build
cd ./scripts
./pr_check.sh
cd ../build
cmake .. -DBUILD_EXAMPLES=true -DBUILD_WITH_TM2=true -DBUILD_SHARED_LIBS=false -DCHECK_FOR_UPDATES=true -DBUILD_PYTHON_BINDINGS=true -DPYBIND11_PYTHON_VERSION=3.5
cmake --build . --config ${{env.LRS_BUILD_CONFIG}} -- -j4
Expand All @@ -253,11 +286,17 @@ jobs:
- uses: actions/checkout@v2


- name: Check_API
shell: bash
run: |
cd scripts
./api_check.sh
cd ..
- name: Prebuild
shell: bash
run: |
set -x
cd ./scripts && ./api_check.sh && cd ..
# Workaround for nvm failure: https://github.com/appleboy/ssh-action/issues/70
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
Expand Down Expand Up @@ -300,9 +339,16 @@ jobs:

steps:
- uses: actions/checkout@v2

- name: Check_API
shell: bash
run: |
cd scripts
./api_check.sh
cd ..
- name: Prebuild
run: |
cd scripts && ./api_check.sh && cd ..
mkdir build
# install coreutils for greadlink use
brew install coreutils
Expand All @@ -326,10 +372,15 @@ jobs:
steps:
- uses: actions/checkout@v2

- name: Check_API
shell: bash
run: |
cd scripts
./api_check.sh
cd ..
- name: Prebuild
shell: bash
run: |
cd scripts && ./api_check.sh && cd ..
mkdir build
wget https://dl.google.com/android/repository/android-ndk-r20b-linux-x86_64.zip;
unzip -q android-ndk-r20b-linux-x86_64.zip -d ./;
Expand Down
32 changes: 16 additions & 16 deletions src/basics.h
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2021 Intel Corporation. All Rights Reserved.

#pragma once


// Disable declspec(dllexport) warnings:
// Classes exported via LRS_EXTENSION_API are **not** part of official librealsense API (at least for now)
// Any extension relying on these APIs must be compiled and distributed together with realsense2.dll
#pragma warning(disable : 4275) /* disable: C4275: non dll-interface class used as base for dll-interface class */
#pragma warning(disable : 4251) /* disable: C4251: class needs to have dll-interface to be used by clients of class */
#ifdef WIN32
#define LRS_EXTENSION_API __declspec(dllexport)
#else
#define LRS_EXTENSION_API
#endif
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2021 Intel Corporation. All Rights Reserved.

#pragma once


// Disable declspec(dllexport) warnings:
// Classes exported via LRS_EXTENSION_API are **not** part of official librealsense API (at least for now)
// Any extension relying on these APIs must be compiled and distributed together with realsense2.dll
#pragma warning(disable : 4275) /* disable: C4275: non dll-interface class used as base for dll-interface class */
#pragma warning(disable : 4251) /* disable: C4251: class needs to have dll-interface to be used by clients of class */
#ifdef WIN32
#define LRS_EXTENSION_API __declspec(dllexport)
#else
#define LRS_EXTENSION_API
#endif
134 changes: 67 additions & 67 deletions src/callback-invocation.h
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2021 Intel Corporation. All Rights Reserved.

#pragma once

#include "small-heap.h"

#include <chrono>


namespace librealsense {


struct callback_invocation
{
std::chrono::high_resolution_clock::time_point started;
std::chrono::high_resolution_clock::time_point ended;
};

typedef small_heap< callback_invocation, 1 > callbacks_heap;

struct callback_invocation_holder
{
callback_invocation_holder()
: invocation( nullptr )
, owner( nullptr )
{
}
callback_invocation_holder( const callback_invocation_holder & ) = delete;
callback_invocation_holder & operator=( const callback_invocation_holder & ) = delete;

callback_invocation_holder( callback_invocation_holder && other )
: invocation( other.invocation )
, owner( other.owner )
{
other.invocation = nullptr;
}

callback_invocation_holder( callback_invocation * invocation, callbacks_heap * owner )
: invocation( invocation )
, owner( owner )
{
}

~callback_invocation_holder()
{
if( invocation )
owner->deallocate( invocation );
}

callback_invocation_holder & operator=( callback_invocation_holder && other )
{
invocation = other.invocation;
owner = other.owner;
other.invocation = nullptr;
return *this;
}

operator bool() { return invocation != nullptr; }

private:
callback_invocation * invocation;
callbacks_heap * owner;
};


} // namespace librealsense
// License: Apache 2.0. See LICENSE file in root directory.
// Copyright(c) 2021 Intel Corporation. All Rights Reserved.

#pragma once

#include "small-heap.h"

#include <chrono>


namespace librealsense {


struct callback_invocation
{
std::chrono::high_resolution_clock::time_point started;
std::chrono::high_resolution_clock::time_point ended;
};

typedef small_heap< callback_invocation, 1 > callbacks_heap;

struct callback_invocation_holder
{
callback_invocation_holder()
: invocation( nullptr )
, owner( nullptr )
{
}
callback_invocation_holder( const callback_invocation_holder & ) = delete;
callback_invocation_holder & operator=( const callback_invocation_holder & ) = delete;

callback_invocation_holder( callback_invocation_holder && other )
: invocation( other.invocation )
, owner( other.owner )
{
other.invocation = nullptr;
}

callback_invocation_holder( callback_invocation * invocation, callbacks_heap * owner )
: invocation( invocation )
, owner( owner )
{
}

~callback_invocation_holder()
{
if( invocation )
owner->deallocate( invocation );
}

callback_invocation_holder & operator=( callback_invocation_holder && other )
{
invocation = other.invocation;
owner = other.owner;
other.invocation = nullptr;
return *this;
}

operator bool() { return invocation != nullptr; }

private:
callback_invocation * invocation;
callbacks_heap * owner;
};


} // namespace librealsense
40 changes: 20 additions & 20 deletions src/ds5/ds5-device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1089,32 +1089,32 @@ namespace librealsense
auto exposure_range = depth_sensor.get_option(RS2_OPTION_EXPOSURE).get_range();
auto gain_range = depth_sensor.get_option(RS2_OPTION_GAIN).get_range();

option_range enable_range = { 0.f /*min*/, 1.f /*max*/, 1.f /*step*/, 0.f /*default*/ };
option_range enable_range = { 0.f /*min*/, 1.f /*max*/, 1.f /*step*/, 0.f /*default*/ };

//GAIN Limit
auto gain_limit_toggle_control = std::make_shared<limits_option>(RS2_OPTION_AUTO_GAIN_LIMIT_TOGGLE, enable_range, "Toggle Auto-Gain Limit", *_hw_monitor);
_gain_limit_value_control = std::make_shared<auto_gain_limit_option>(*_hw_monitor, &depth_sensor, gain_range, gain_limit_toggle_control);
depth_sensor.register_option(RS2_OPTION_AUTO_GAIN_LIMIT_TOGGLE, gain_limit_toggle_control);
//GAIN Limit
auto gain_limit_toggle_control = std::make_shared<limits_option>(RS2_OPTION_AUTO_GAIN_LIMIT_TOGGLE, enable_range, "Toggle Auto-Gain Limit", *_hw_monitor);
_gain_limit_value_control = std::make_shared<auto_gain_limit_option>(*_hw_monitor, &depth_sensor, gain_range, gain_limit_toggle_control);
depth_sensor.register_option(RS2_OPTION_AUTO_GAIN_LIMIT_TOGGLE, gain_limit_toggle_control);

depth_sensor.register_option(RS2_OPTION_AUTO_GAIN_LIMIT,
std::make_shared<auto_disabling_control>(
_gain_limit_value_control,
gain_limit_toggle_control
depth_sensor.register_option(RS2_OPTION_AUTO_GAIN_LIMIT,
std::make_shared<auto_disabling_control>(
_gain_limit_value_control,
gain_limit_toggle_control

));
));

// EXPOSURE Limit
auto ae_limit_toggle_control = std::make_shared<limits_option>(RS2_OPTION_AUTO_EXPOSURE_LIMIT_TOGGLE, enable_range, "Toggle Auto-Exposure Limit", *_hw_monitor);
_ae_limit_value_control = std::make_shared<auto_exposure_limit_option>(*_hw_monitor, &depth_sensor, exposure_range, ae_limit_toggle_control);
depth_sensor.register_option(RS2_OPTION_AUTO_EXPOSURE_LIMIT_TOGGLE, ae_limit_toggle_control);
// EXPOSURE Limit
auto ae_limit_toggle_control = std::make_shared<limits_option>(RS2_OPTION_AUTO_EXPOSURE_LIMIT_TOGGLE, enable_range, "Toggle Auto-Exposure Limit", *_hw_monitor);
_ae_limit_value_control = std::make_shared<auto_exposure_limit_option>(*_hw_monitor, &depth_sensor, exposure_range, ae_limit_toggle_control);
depth_sensor.register_option(RS2_OPTION_AUTO_EXPOSURE_LIMIT_TOGGLE, ae_limit_toggle_control);

depth_sensor.register_option(RS2_OPTION_AUTO_EXPOSURE_LIMIT,
std::make_shared<auto_disabling_control>(
_ae_limit_value_control,
ae_limit_toggle_control
depth_sensor.register_option(RS2_OPTION_AUTO_EXPOSURE_LIMIT,
std::make_shared<auto_disabling_control>(
_ae_limit_value_control,
ae_limit_toggle_control

));
}
));
}
}); //group_multiple_fw_calls

// attributes of md_capture_timing
Expand Down
Loading

0 comments on commit ea2c159

Please sign in to comment.