Compare commits

..

10 Commits

Author SHA1 Message Date
7eac999bd4 Bump pybind11 submodule to v2.13.6 for CMake 4.x compatibility 2026-06-12 10:27:10 +12:00
Naoto Kondo
8aad19db2b fix audio buffer dimension 2022-06-14 16:24:02 +09:00
Naoto Kondo
ef5c8e7227 update readme 2022-06-14 15:39:01 +09:00
Naoto Kondo
b9124a9370 version 5.1.1.5 2022-05-21 20:32:43 +09:00
Naoto Kondo
4117651c8a cross compile for mac 2022-05-21 19:28:59 +09:00
Naoto Kondo
9889a9e281 suppress linker warning on mac 2022-05-21 19:24:39 +09:00
Naoto Kondo
52a975bd79 more limited situation 2022-05-18 20:29:44 +09:00
Naoto Kondo
b4bad8caad version 5.1.1.4 2022-05-18 19:56:56 +09:00
Naoto Kondo
2dd4904668 add pip target 2022-05-18 19:55:41 +09:00
Naoto Kondo
3e1ac52a06 add new build method 2022-05-18 19:50:42 +09:00
5 changed files with 15 additions and 13 deletions

View File

@@ -6,6 +6,8 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12")
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
add_subdirectory("lib/pybind11") add_subdirectory("lib/pybind11")

View File

@@ -9,8 +9,8 @@ pip install ndi-python
``` ```
The supported environment is as follows. The supported environment is as follows.
- Windows x64 Python(3.7-3.10) - Windows x64 Python(3.7-3.10)
- macOS x64 >=10.12 Python(3.7-3.10) - macOS x64(>=10.12),arm64(>=11.0) Python(3.7-3.10)
- Linux x64 Python(3.7-3.10) - Linux x64,aarch64 Python(3.7-3.10)
## Setup Avahi ## Setup Avahi
Linux requires Avahi to search for NDI sources. Linux requires Avahi to search for NDI sources.
@@ -66,7 +66,7 @@ env CMAKE_ARGS="-DNDI_SDK_DIR=/path/to/ndisdk" python setup.py build
``` ```
You can also specify the python version. You can also specify the python version.
``` ```
env CMAKE_ARGS="-DNDI_SDK_DIR=/path/to/ndisdk -DPYBIND11_PYTHON_VERSION=3.8" python3.8 setup.py build env CMAKE_ARGS="-DNDI_SDK_DIR=/path/to/ndisdk -DPYTHON_EXECUTABLE=/path/to/python3.8 -DPYBIND11_PYTHON_VERSION=3.8" /path/to/python3.8 setup.py build
``` ```
### Build for Python package ### Build for Python package

View File

@@ -51,7 +51,7 @@ long_description = (this_directory / "README.md").read_text()
# setup # setup
setup( setup(
name='ndi-python', name='ndi-python',
version='5.1.1.3', version='5.1.1.5',
description='Wrapper package for NDI SDK python bindings.', description='Wrapper package for NDI SDK python bindings.',
long_description=long_description, long_description=long_description,
long_description_content_type='text/markdown', long_description_content_type='text/markdown',

View File

@@ -164,7 +164,7 @@ PYBIND11_MODULE(NDIlib, m) {
size_t row = self.no_channels; size_t row = self.no_channels;
size_t size = sizeof(float); size_t size = sizeof(float);
auto buffer_info = py::buffer_info( auto buffer_info = py::buffer_info(
self.p_data, size, py::format_descriptor<float>::format(), row, self.p_data, size, py::format_descriptor<float>::format(), 2,
{row, col}, {col * size, size}); {row, col}, {col * size, size});
return py::array(buffer_info); return py::array(buffer_info);
}, },
@@ -214,8 +214,8 @@ PYBIND11_MODULE(NDIlib, m) {
size_t row = self.no_channels; size_t row = self.no_channels;
size_t size = sizeof(uint8_t); size_t size = sizeof(uint8_t);
auto buffer_info = py::buffer_info( auto buffer_info = py::buffer_info(
self.p_data, size, py::format_descriptor<uint8_t>::format(), self.p_data, size, py::format_descriptor<uint8_t>::format(), 2,
row, {row, col}, {col * size * 4, size}); {row, col}, {col * size * 4, size});
return py::array(buffer_info); return py::array(buffer_info);
}, },
[](NDIlib_audio_frame_v3_t &self, py::array_t<uint8_t> &array) { [](NDIlib_audio_frame_v3_t &self, py::array_t<uint8_t> &array) {
@@ -1142,8 +1142,8 @@ PYBIND11_MODULE(NDIlib, m) {
size_t row = self.no_channels; size_t row = self.no_channels;
size_t size = sizeof(int16_t); size_t size = sizeof(int16_t);
auto buffer_info = py::buffer_info( auto buffer_info = py::buffer_info(
self.p_data, size, py::format_descriptor<int16_t>::format(), self.p_data, size, py::format_descriptor<int16_t>::format(), 2,
row, {row, col}, {col * size, size}); {row, col}, {col * size, size});
return py::array(buffer_info); return py::array(buffer_info);
}, },
[](NDIlib_audio_frame_interleaved_16s_t &self, [](NDIlib_audio_frame_interleaved_16s_t &self,
@@ -1178,8 +1178,8 @@ PYBIND11_MODULE(NDIlib, m) {
size_t row = self.no_channels; size_t row = self.no_channels;
size_t size = sizeof(int32_t); size_t size = sizeof(int32_t);
auto buffer_info = py::buffer_info( auto buffer_info = py::buffer_info(
self.p_data, size, py::format_descriptor<int32_t>::format(), self.p_data, size, py::format_descriptor<int32_t>::format(), 2,
row, {row, col}, {col * size, size}); {row, col}, {col * size, size});
return py::array(buffer_info); return py::array(buffer_info);
}, },
[](NDIlib_audio_frame_interleaved_32s_t &self, [](NDIlib_audio_frame_interleaved_32s_t &self,
@@ -1212,7 +1212,7 @@ PYBIND11_MODULE(NDIlib, m) {
size_t row = self.no_channels; size_t row = self.no_channels;
size_t size = sizeof(float); size_t size = sizeof(float);
auto buffer_info = py::buffer_info( auto buffer_info = py::buffer_info(
self.p_data, size, py::format_descriptor<float>::format(), row, self.p_data, size, py::format_descriptor<float>::format(), 2,
{row, col}, {col * size, size}); {row, col}, {col * size, size});
return py::array(buffer_info); return py::array(buffer_info);
}, },