diff --git a/README.md b/README.md index c184489..f3b3846 100644 --- a/README.md +++ b/README.md @@ -102,9 +102,12 @@ works well. # Changelog -## v3.0.3 +## v3.0.4 Updated libcamera code to fit with libcamera changes. +## v3.0.3 +Fixed NeoPixel code. + ## v3.0.2 Moved to using ndi 5. diff --git a/src/ndi_output.cpp b/src/ndi_output.cpp index c95c51d..cf07682 100644 --- a/src/ndi_output.cpp +++ b/src/ndi_output.cpp @@ -34,29 +34,32 @@ void NdiOutput::outputBuffer(void *mem, size_t size, int64_t timestamp_us, uint3 { this->NDI_video_frame.p_data = (uint8_t*)mem; NDIlib_send_send_video_v2(this->pNDI_send, &this->NDI_video_frame); - NDIlib_tally_t NDI_tally; - NDIlib_send_get_tally(this->pNDI_send, &NDI_tally, 0); - this->program = NDI_tally.on_program; - this->preview = NDI_tally.on_preview; + NDIlib_tally_t* NDI_tally; + NDIlib_send_get_tally(this->pNDI_send, NDI_tally, 0); char pixelStatus; std::ofstream neopixel; - if(this->isProgram()) + std::cout << "PGM: " << NDI_tally->on_program << " PVW: " << NDI_tally->on_preview << std::endl; + + if(NDI_tally->on_program) { - pixelStatus = 'L'; + neopixel.open(neopixelpath); + neopixel << "L"; + neopixel.close(); } - else if (this->isPreview()) + else if (NDI_tally->on_preview) { - pixelStatus = 'P'; + neopixel.open(neopixelpath); + neopixel << "P"; + neopixel.close(); } else { - pixelStatus = 'N'; + neopixel.open(neopixelpath); + neopixel << "N"; + neopixel.close(); } - neopixel.open(neopixelpath); - neopixel << pixelStatus; - neopixel.close(); }