Compare commits
10 Commits
336ff7d19d
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 7eac999bd4 | |||
|
|
8aad19db2b | ||
|
|
ef5c8e7227 | ||
|
|
b9124a9370 | ||
|
|
4117651c8a | ||
|
|
9889a9e281 | ||
|
|
52a975bd79 | ||
|
|
b4bad8caad | ||
|
|
2dd4904668 | ||
|
|
3e1ac52a06 |
@@ -6,6 +6,8 @@ set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/Modules)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.12")
|
||||
set(CMAKE_OSX_ARCHITECTURES "x86_64;arm64")
|
||||
|
||||
add_subdirectory("lib/pybind11")
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ pip install ndi-python
|
||||
```
|
||||
The supported environment is as follows.
|
||||
- Windows x64 Python(3.7-3.10)
|
||||
- macOS x64 >=10.12 Python(3.7-3.10)
|
||||
- Linux x64 Python(3.7-3.10)
|
||||
- macOS x64(>=10.12),arm64(>=11.0) Python(3.7-3.10)
|
||||
- Linux x64,aarch64 Python(3.7-3.10)
|
||||
|
||||
## Setup Avahi
|
||||
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.
|
||||
```
|
||||
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
|
||||
|
||||
Submodule lib/pybind11 updated: 914c06fb25...a2e59f0e70
2
setup.py
2
setup.py
@@ -51,7 +51,7 @@ long_description = (this_directory / "README.md").read_text()
|
||||
# setup
|
||||
setup(
|
||||
name='ndi-python',
|
||||
version='5.1.1.3',
|
||||
version='5.1.1.5',
|
||||
description='Wrapper package for NDI SDK python bindings.',
|
||||
long_description=long_description,
|
||||
long_description_content_type='text/markdown',
|
||||
|
||||
16
src/main.cpp
16
src/main.cpp
@@ -164,7 +164,7 @@ PYBIND11_MODULE(NDIlib, m) {
|
||||
size_t row = self.no_channels;
|
||||
size_t size = sizeof(float);
|
||||
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});
|
||||
return py::array(buffer_info);
|
||||
},
|
||||
@@ -214,8 +214,8 @@ PYBIND11_MODULE(NDIlib, m) {
|
||||
size_t row = self.no_channels;
|
||||
size_t size = sizeof(uint8_t);
|
||||
auto buffer_info = py::buffer_info(
|
||||
self.p_data, size, py::format_descriptor<uint8_t>::format(),
|
||||
row, {row, col}, {col * size * 4, size});
|
||||
self.p_data, size, py::format_descriptor<uint8_t>::format(), 2,
|
||||
{row, col}, {col * size * 4, size});
|
||||
return py::array(buffer_info);
|
||||
},
|
||||
[](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 size = sizeof(int16_t);
|
||||
auto buffer_info = py::buffer_info(
|
||||
self.p_data, size, py::format_descriptor<int16_t>::format(),
|
||||
row, {row, col}, {col * size, size});
|
||||
self.p_data, size, py::format_descriptor<int16_t>::format(), 2,
|
||||
{row, col}, {col * size, size});
|
||||
return py::array(buffer_info);
|
||||
},
|
||||
[](NDIlib_audio_frame_interleaved_16s_t &self,
|
||||
@@ -1178,8 +1178,8 @@ PYBIND11_MODULE(NDIlib, m) {
|
||||
size_t row = self.no_channels;
|
||||
size_t size = sizeof(int32_t);
|
||||
auto buffer_info = py::buffer_info(
|
||||
self.p_data, size, py::format_descriptor<int32_t>::format(),
|
||||
row, {row, col}, {col * size, size});
|
||||
self.p_data, size, py::format_descriptor<int32_t>::format(), 2,
|
||||
{row, col}, {col * size, size});
|
||||
return py::array(buffer_info);
|
||||
},
|
||||
[](NDIlib_audio_frame_interleaved_32s_t &self,
|
||||
@@ -1212,7 +1212,7 @@ PYBIND11_MODULE(NDIlib, m) {
|
||||
size_t row = self.no_channels;
|
||||
size_t size = sizeof(float);
|
||||
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});
|
||||
return py::array(buffer_info);
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user