Skip to content

Commit

Permalink
Merge branch 'feature/add_pylon_7_3_support'
Browse files Browse the repository at this point in the history
  • Loading branch information
thiesmoeller committed May 8, 2023
2 parents 6d9a20c + 29178fb commit 18a476e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 18 deletions.
21 changes: 12 additions & 9 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,15 @@ jobs:
- name: Installer list
run: |
tee pylon-installer.txt <<"EOF"
${PYLON_DOWNLOAD_URL_BASE}/pylon_7.3.0.27189_linux-x86_64_setup.tar.gz
${PYLON_DOWNLOAD_URL_BASE}/pylon_7.2.1.25747_x86_64_setup.tar.gz
${PYLON_DOWNLOAD_URL_BASE}/pylon_7.1.0.25066_x86_64_setup.tar.gz
${PYLON_DOWNLOAD_URL_BASE}/pylon_6.3.0.23157_x86_64_setup.tar.gz
${PYLON_DOWNLOAD_URL_BASE}/pylon_7.3.0.27189_linux-aarch64_setup.tar.gz
${PYLON_DOWNLOAD_URL_BASE}/pylon_7.2.1.25747_aarch64_setup.tar.gz
${PYLON_DOWNLOAD_URL_BASE}/pylon_7.1.0.25066_aarch64_setup.tar.gz
${PYLON_DOWNLOAD_URL_BASE_62}/pylon_6.2.0.21487_aarch64_setup.tar.gz
${PYLON_DOWNLOAD_URL_BASE}/Basler_pylon_7.3.0.27189.exe
${PYLON_DOWNLOAD_URL_BASE}/Basler_pylon_7.2.1.25747.exe
${PYLON_DOWNLOAD_URL_BASE}/Basler_pylon_7.1.0.25066.exe
${PYLON_DOWNLOAD_URL_BASE}/pylon-6.2.0.21487.dmg
Expand Down Expand Up @@ -62,10 +65,10 @@ jobs:
strategy:
matrix:
os: [windows-latest]
py_version: [7.2.1.25747, 7.1.0.25066 ]
py_version: [7.3.0.27189, 7.2.1.25747, 7.1.0.25066 ]
fail-fast: false
runs-on: ${{ matrix.os }}
name: Build pylon ${{ matrix.py_version }} on ${{ matrix.os }}-x86_64
name: Build pylon ${{ matrix.py_version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
Expand Down Expand Up @@ -115,7 +118,7 @@ jobs:
strategy:
matrix:
os: [ubuntu18.04, ubuntu20.04, ubuntu22.04]
py_version: [7.2.1.25747, 7.1.0.25066, 6.2.0.21487 ]
py_version: [7.3.0.27189_linux-aarch64, 7.2.1.25747_aarch64, 7.1.0.25066_aarch64, 6.2.0.21487_aarch64 ]
fail-fast: false
runs-on: ubuntu-latest
name: Build pylon ${{ matrix.py_version }} on ${{ matrix.os }}-aarch64
Expand All @@ -141,12 +144,12 @@ jobs:
uname -a
# install pylon
PYLON_TGZ=$(readlink -m /pylon-installer/pylon_${{ matrix.py_version }}_aarch64_setup.tar.gz)
PYLON_TGZ=$(readlink -m /pylon-installer/pylon_${{ matrix.py_version }}_setup.tar.gz)
mkdir pylon_tmp
pushd pylon_tmp
tar -xf $PYLON_TGZ
mkdir -p /opt/pylon
tar -C /opt/pylon -xzf pylon_${{ matrix.py_version }}_aarch64.tar.gz
tar -C /opt/pylon -xzf pylon?${{ matrix.py_version }}.tar.gz
popd

# install required environment
Expand Down Expand Up @@ -195,10 +198,10 @@ jobs:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
py_version: [7.2.1.25747, 7.1.0.25066, 6.3.0.23157 ]
py_version: [7.3.0.27189_linux-x86_64, 7.2.1.25747_x86_64, 7.1.0.25066_x86_64, 6.3.0.23157_x86_64 ]
fail-fast: false
runs-on: ${{ matrix.os }}
name: Build pylon ${{ matrix.py_version }} on ${{ matrix.os }}-x64
name: Build pylon ${{ matrix.py_version }} on ${{ matrix.os }}
steps:
- uses: actions/checkout@v3

Expand All @@ -209,12 +212,12 @@ jobs:

- name: install pylon
run: |
PYLON_TGZ=$(readlink -m pylon-installer/pylon_${{ matrix.py_version }}_x86_64_setup.tar.gz)
PYLON_TGZ=$(readlink -m pylon-installer/pylon_${{ matrix.py_version }}_setup.tar.gz)
mkdir pylon_tmp
pushd pylon_tmp
tar -xf $PYLON_TGZ
sudo mkdir -p /opt/pylon
sudo tar -C /opt/pylon -xzf pylon_${{ matrix.py_version }}_x86_64.tar.gz
sudo tar -C /opt/pylon -xzf pylon?${{ matrix.py_version }}.tar.gz
popd
- name: install required environment
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ As a first step install Basler pylon according to your platform. Downloads are a
The supported pylon versions on the different platforms are:
| | 7.2 | 7.1 | 6.2 |
|-----------------|:----:|:----:|:----:|
| Windows x86_64 | x | x | |
| Linux x86_64 | x | x | |
| Linux aarch64 | x | x | x |
| macOS x86_64 | - | |
| | 7.3 | 7.2 | 7.1 | 6.2 |
|-----------------|:----:|:----:|:----:|:----:|
| Windows x86_64 | x | x | x | |
| Linux x86_64 | x | x | x | |
| Linux aarch64 | x | x | x | x |
| macOS x86_64 | - | - | - |
> macOS build not available for now due to current meson/cmake interaction issues
Expand Down
5 changes: 4 additions & 1 deletion ext/pylon/gstpylon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ static const std::vector<GstStPixelFormats> gst_structure_formats = {

void gst_pylon_initialize() { Pylon::PylonInitialize(); }

void gst_pylon_terminate() { Pylon::PylonTerminate(); }

static std::string gst_pylon_get_camera_fullname(
Pylon::CBaslerUniversalInstantCamera &camera) {
return std::string(camera.GetDeviceInfo().GetFullName());
Expand Down Expand Up @@ -890,7 +892,8 @@ gboolean gst_pylon_set_configuration(GstPylon *self, const GstCaps *conf,
#ifdef NVMM_ENABLED
GstCapsFeatures *features = gst_caps_get_features(conf, 0);
if (gst_caps_features_contains(features, "memory:NVMM")) {
self->buffer_factory = std::make_unique<GstPylonDsNvmmBufferFactory>(self->nvsurface_layout, self->gpu_id);
self->buffer_factory = std::make_unique<GstPylonDsNvmmBufferFactory>(
self->nvsurface_layout, self->gpu_id);

self->buffer_factory->SetConfig(conf);
self->mem_type = MEM_NVMM;
Expand Down
2 changes: 2 additions & 0 deletions ext/pylon/gstpylon.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ gboolean gst_pylon_set_user_config(GstPylon *self, const gchar *user_set,
GError **err);
void gst_pylon_free(GstPylon *self);

void gst_pylon_terminate();

gboolean gst_pylon_start(GstPylon *self, GError **err);
gboolean gst_pylon_stop(GstPylon *self, GError **err);
void gst_pylon_interrupt_capture(GstPylon *self);
Expand Down
2 changes: 2 additions & 0 deletions ext/pylon/gstpylonsrc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,8 @@ static void gst_pylon_src_finalize(GObject *object) {
self->stream = NULL;
}

gst_pylon_terminate();

G_OBJECT_CLASS(gst_pylon_src_parent_class)->finalize(object);
}

Expand Down
5 changes: 3 additions & 2 deletions gst-libs/gst/pylon/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ if target_machine.system() == 'linux' and pylon_path == 'PYLON_ROOT_NOT_SET'
endif

# detect pylon 7.x
pylon_dep = dependency('pylon', method : 'cmake', modules : ['pylon::PylonBase', 'pylon::GCBase', 'pylon::GenApi', 'pylon::PylonUtility'],
version : '>=7.1', cmake_module_path: pylon_path / 'share/pylon/cmake/' , required: false)
pylon_dep = dependency('pylon', method : 'cmake', modules : ['pylon::pylon'],
version : '>=7.1', cmake_args : [ '-DCMAKE_PREFIX_PATH=' + pylon_path / 'share/pylon/cmake/', '-DPYLON_ROOT=' + pylon_path ] , required: false)

if pylon_dep.found()
# patch rpath on linux
if target_machine.system() == 'linux'
Expand Down

0 comments on commit 18a476e

Please sign in to comment.