From 311cd6fb79c24f58553b0b5558bcb1cf18a32e70 Mon Sep 17 00:00:00 2001 From: fryshorts Date: Wed, 10 May 2017 21:55:02 +0200 Subject: [PATCH 1/3] decklink: Fix compiler warning about ignored const Fix a warning from gcc about one of the const keywords being ignored. This happens because the returned type is not a reference contrary to the methods above. --- plugins/decklink/decklink-device.cpp | 2 +- plugins/decklink/decklink-device.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/decklink/decklink-device.cpp b/plugins/decklink/decklink-device.cpp index c6bdf1e06..3203247d4 100644 --- a/plugins/decklink/decklink-device.cpp +++ b/plugins/decklink/decklink-device.cpp @@ -128,7 +128,7 @@ const std::string& DeckLinkDevice::GetName(void) const return name; } -const int32_t DeckLinkDevice::GetMaxChannel(void) const +int32_t DeckLinkDevice::GetMaxChannel(void) const { return maxChannel; } diff --git a/plugins/decklink/decklink-device.hpp b/plugins/decklink/decklink-device.hpp index c18ff8580..9825ad8df 100644 --- a/plugins/decklink/decklink-device.hpp +++ b/plugins/decklink/decklink-device.hpp @@ -31,7 +31,7 @@ public: const std::string& GetHash(void) const; const std::vector& GetModes(void) const; const std::string& GetName(void) const; - const int32_t GetMaxChannel(void) const; + int32_t GetMaxChannel(void) const; bool GetInput(IDeckLinkInput **input); From c8ce08d4b66e86d6a28df299b3384c6b47685325 Mon Sep 17 00:00:00 2001 From: fryshorts Date: Sun, 7 May 2017 21:41:38 +0200 Subject: [PATCH 2/3] decklink: Add option to disable the plugin Add an option to the cmake build system to disable the plugin. This is needed on arm, as the plugin uses x86-intrinsics. --- plugins/decklink/linux/CMakeLists.txt | 5 +++++ plugins/decklink/mac/CMakeLists.txt | 5 +++++ plugins/decklink/win/CMakeLists.txt | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/plugins/decklink/linux/CMakeLists.txt b/plugins/decklink/linux/CMakeLists.txt index d1a945222..1ed5ae46d 100644 --- a/plugins/decklink/linux/CMakeLists.txt +++ b/plugins/decklink/linux/CMakeLists.txt @@ -1,5 +1,10 @@ project(linux-decklink) +if(DISABLE_DECKLINK) + message(STATUS "decklink plugin disabled") + return() +endif() + set(linux-decklink-sdk_HEADERS decklink-sdk/DeckLinkAPI.h decklink-sdk/DeckLinkAPIConfiguration.h diff --git a/plugins/decklink/mac/CMakeLists.txt b/plugins/decklink/mac/CMakeLists.txt index a47923a2a..d016470cd 100644 --- a/plugins/decklink/mac/CMakeLists.txt +++ b/plugins/decklink/mac/CMakeLists.txt @@ -1,5 +1,10 @@ project(mac-decklink) +if(DISABLE_DECKLINK) + message(STATUS "decklink plugin disabled") + return() +endif() + find_library(COREFOUNDATION CoreFoundation) include_directories(${COREFOUNDATION}) diff --git a/plugins/decklink/win/CMakeLists.txt b/plugins/decklink/win/CMakeLists.txt index 515d13bf3..af9464510 100644 --- a/plugins/decklink/win/CMakeLists.txt +++ b/plugins/decklink/win/CMakeLists.txt @@ -1,5 +1,10 @@ project(win-decklink) +if(DISABLE_DECKLINK) + message(STATUS "decklink plugin disabled") + return() +endif() + include(IDLFileHelper) set(win-decklink-sdk_IDLS From 00cb0540a57d9eda0a48841e2431b944c7434d08 Mon Sep 17 00:00:00 2001 From: fryshorts Date: Wed, 10 May 2017 22:47:58 +0200 Subject: [PATCH 3/3] decklink: Remove unused variables to fix warning Remove two unused variables that are causing a compiler warning on gcc. The size was probably added in the past to calculate the the packet size, but in the end was not actually needed. --- plugins/decklink/audio-repack.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/plugins/decklink/audio-repack.c b/plugins/decklink/audio-repack.c index 739f29f78..f4bedfec1 100644 --- a/plugins/decklink/audio-repack.c +++ b/plugins/decklink/audio-repack.c @@ -25,7 +25,7 @@ int check_buffer(struct audio_repack *repack, squash data array | FL | FR |LFE | FC | BL | BR |emp |emp | - | | x | | + | | x | | | FL | FR | FC |LFE | BL | BR | */ int repack_8to6ch_swap23(struct audio_repack *repack, @@ -34,8 +34,6 @@ int repack_8to6ch_swap23(struct audio_repack *repack, if (check_buffer(repack, frame_count) < 0) return -1; - const uint32_t size = frame_count * repack->base_src_size; - const __m128i *src = (__m128i *)bsrc; const __m128i *esrc = src + frame_count; uint32_t *dst = (uint32_t *)repack->packet_buffer; @@ -62,8 +60,6 @@ int repack_8ch_swap23(struct audio_repack *repack, if (check_buffer(repack, frame_count) < 0) return -1; - const uint32_t size = frame_count * repack->base_src_size; - const __m128i *src = (__m128i *)bsrc; const __m128i *esrc = src + frame_count; __m128i *dst = (__m128i *)repack->packet_buffer;