From f0c35071da1287179df0f621e8fc069f6a94f79f Mon Sep 17 00:00:00 2001 From: johan Date: Fri, 7 Feb 2014 21:11:50 +0100 Subject: [PATCH] Move V4L2 grabber code to separate library Former-commit-id: f3003eb0142af3d085ccf93fff1b297ebc2321fc --- .../DispmanxWrapper.h | 0 .../grabber}/V4L2Grabber.h | 0 libsrc/CMakeLists.txt | 5 +---- libsrc/grabber/CMakeLists.txt | 8 ++++++++ .../dispmanx}/CMakeLists.txt | 4 ++-- .../dispmanx}/DispmanxFrameGrabber.cpp | 0 .../dispmanx}/DispmanxFrameGrabber.h | 0 .../dispmanx}/DispmanxWrapper.cpp | 4 ++-- libsrc/grabber/v4l2/CMakeLists.txt | 19 +++++++++++++++++++ .../grabber/v4l2}/V4L2Grabber.cpp | 2 +- src/hyperion-v4l2/CMakeLists.txt | 3 +-- src/hyperion-v4l2/hyperion-v4l2.cpp | 4 +++- src/hyperiond/hyperiond.cpp | 2 +- test/dispmanx2png/dispmanx2png.cpp | 2 +- 14 files changed, 39 insertions(+), 14 deletions(-) rename include/{dispmanx-grabber => grabber}/DispmanxWrapper.h (100%) rename {src/hyperion-v4l2 => include/grabber}/V4L2Grabber.h (100%) create mode 100644 libsrc/grabber/CMakeLists.txt rename libsrc/{dispmanx-grabber => grabber/dispmanx}/CMakeLists.txt (81%) rename libsrc/{dispmanx-grabber => grabber/dispmanx}/DispmanxFrameGrabber.cpp (100%) rename libsrc/{dispmanx-grabber => grabber/dispmanx}/DispmanxFrameGrabber.h (100%) rename libsrc/{dispmanx-grabber => grabber/dispmanx}/DispmanxWrapper.cpp (96%) create mode 100644 libsrc/grabber/v4l2/CMakeLists.txt rename {src/hyperion-v4l2 => libsrc/grabber/v4l2}/V4L2Grabber.cpp (99%) diff --git a/include/dispmanx-grabber/DispmanxWrapper.h b/include/grabber/DispmanxWrapper.h similarity index 100% rename from include/dispmanx-grabber/DispmanxWrapper.h rename to include/grabber/DispmanxWrapper.h diff --git a/src/hyperion-v4l2/V4L2Grabber.h b/include/grabber/V4L2Grabber.h similarity index 100% rename from src/hyperion-v4l2/V4L2Grabber.h rename to include/grabber/V4L2Grabber.h diff --git a/libsrc/CMakeLists.txt b/libsrc/CMakeLists.txt index 8db13505..62911dd7 100644 --- a/libsrc/CMakeLists.txt +++ b/libsrc/CMakeLists.txt @@ -12,7 +12,4 @@ add_subdirectory(leddevice) add_subdirectory(utils) add_subdirectory(xbmcvideochecker) add_subdirectory(effectengine) - -if (ENABLE_DISPMANX) - add_subdirectory(dispmanx-grabber) -endif (ENABLE_DISPMANX) +add_subdirectory(grabber) diff --git a/libsrc/grabber/CMakeLists.txt b/libsrc/grabber/CMakeLists.txt new file mode 100644 index 00000000..322a5a98 --- /dev/null +++ b/libsrc/grabber/CMakeLists.txt @@ -0,0 +1,8 @@ + +if (ENABLE_DISPMANX) + add_subdirectory(dispmanx) +endif (ENABLE_DISPMANX) + +if (ENABLE_V4L2) + add_subdirectory(v4l2) +endif (ENABLE_V4L2) diff --git a/libsrc/dispmanx-grabber/CMakeLists.txt b/libsrc/grabber/dispmanx/CMakeLists.txt similarity index 81% rename from libsrc/dispmanx-grabber/CMakeLists.txt rename to libsrc/grabber/dispmanx/CMakeLists.txt index f8bf6ad8..20714dba 100644 --- a/libsrc/dispmanx-grabber/CMakeLists.txt +++ b/libsrc/grabber/dispmanx/CMakeLists.txt @@ -4,8 +4,8 @@ find_package(BCM REQUIRED) include_directories(${BCM_INCLUDE_DIRS}) # Define the current source locations -SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/dispmanx-grabber) -SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/dispmanx-grabber) +SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber) +SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/dispmanx) # Group the headers that go through the MOC compiler SET(DispmanxGrabberQT_HEADERS diff --git a/libsrc/dispmanx-grabber/DispmanxFrameGrabber.cpp b/libsrc/grabber/dispmanx/DispmanxFrameGrabber.cpp similarity index 100% rename from libsrc/dispmanx-grabber/DispmanxFrameGrabber.cpp rename to libsrc/grabber/dispmanx/DispmanxFrameGrabber.cpp diff --git a/libsrc/dispmanx-grabber/DispmanxFrameGrabber.h b/libsrc/grabber/dispmanx/DispmanxFrameGrabber.h similarity index 100% rename from libsrc/dispmanx-grabber/DispmanxFrameGrabber.h rename to libsrc/grabber/dispmanx/DispmanxFrameGrabber.h diff --git a/libsrc/dispmanx-grabber/DispmanxWrapper.cpp b/libsrc/grabber/dispmanx/DispmanxWrapper.cpp similarity index 96% rename from libsrc/dispmanx-grabber/DispmanxWrapper.cpp rename to libsrc/grabber/dispmanx/DispmanxWrapper.cpp index 5ffb2a48..c9d2b22c 100644 --- a/libsrc/dispmanx-grabber/DispmanxWrapper.cpp +++ b/libsrc/grabber/dispmanx/DispmanxWrapper.cpp @@ -7,8 +7,8 @@ #include #include -// Local-dispmanx includes -#include +// Dispmanx grabber includes +#include #include "DispmanxFrameGrabber.h" diff --git a/libsrc/grabber/v4l2/CMakeLists.txt b/libsrc/grabber/v4l2/CMakeLists.txt new file mode 100644 index 00000000..ec7830e0 --- /dev/null +++ b/libsrc/grabber/v4l2/CMakeLists.txt @@ -0,0 +1,19 @@ +# Define the current source locations +SET(CURRENT_HEADER_DIR ${CMAKE_SOURCE_DIR}/include/grabber) +SET(CURRENT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/libsrc/grabber/v4l2) + +SET(V4L2_HEADERS + ${CURRENT_HEADER_DIR}/V4L2Grabber.h +) + +SET(V4L2_SOURCES + ${CURRENT_SOURCE_DIR}/V4L2Grabber.cpp +) + +add_library(v4l2-grabber + ${V4L2_HEADERS} + ${V4L2_SOURCES} +) + +target_link_libraries(v4l2-grabber + hyperion-utils) diff --git a/src/hyperion-v4l2/V4L2Grabber.cpp b/libsrc/grabber/v4l2/V4L2Grabber.cpp similarity index 99% rename from src/hyperion-v4l2/V4L2Grabber.cpp rename to libsrc/grabber/v4l2/V4L2Grabber.cpp index 9c0e63ff..09a36140 100644 --- a/src/hyperion-v4l2/V4L2Grabber.cpp +++ b/libsrc/grabber/v4l2/V4L2Grabber.cpp @@ -14,7 +14,7 @@ #include #include -#include "V4L2Grabber.h" +#include "grabber/V4L2Grabber.h" #define CLEAR(x) memset(&(x), 0, sizeof(x)) diff --git a/src/hyperion-v4l2/CMakeLists.txt b/src/hyperion-v4l2/CMakeLists.txt index 635e470e..db49e438 100644 --- a/src/hyperion-v4l2/CMakeLists.txt +++ b/src/hyperion-v4l2/CMakeLists.txt @@ -15,7 +15,6 @@ include_directories( ) set(Hyperion_V4L2_HEADERS - V4L2Grabber.h ProtoConnection.h ImageHandler.h VideoStandardParameter.h @@ -23,7 +22,6 @@ set(Hyperion_V4L2_HEADERS set(Hyperion_V4L2_SOURCES hyperion-v4l2.cpp - V4L2Grabber.cpp ProtoConnection.cpp ImageHandler.cpp ) @@ -44,6 +42,7 @@ add_executable(hyperion-v4l2 ) target_link_libraries(hyperion-v4l2 + v4l2-grabber getoptPlusPlus blackborder hyperion-utils diff --git a/src/hyperion-v4l2/hyperion-v4l2.cpp b/src/hyperion-v4l2/hyperion-v4l2.cpp index 5bc22652..7f654c35 100644 --- a/src/hyperion-v4l2/hyperion-v4l2.cpp +++ b/src/hyperion-v4l2/hyperion-v4l2.cpp @@ -12,8 +12,10 @@ // blackborder includes #include +// grabber includes +#include "grabber/V4L2Grabber.h" + // hyperion-v4l2 includes -#include "V4L2Grabber.h" #include "ProtoConnection.h" #include "VideoStandardParameter.h" #include "ImageHandler.h" diff --git a/src/hyperiond/hyperiond.cpp b/src/hyperiond/hyperiond.cpp index db29c89e..08244158 100644 --- a/src/hyperiond/hyperiond.cpp +++ b/src/hyperiond/hyperiond.cpp @@ -19,7 +19,7 @@ #ifdef ENABLE_DISPMANX // Dispmanx grabber includes -#include +#include #endif // XBMC Video checker includes diff --git a/test/dispmanx2png/dispmanx2png.cpp b/test/dispmanx2png/dispmanx2png.cpp index 3439a0e9..1004b8ed 100644 --- a/test/dispmanx2png/dispmanx2png.cpp +++ b/test/dispmanx2png/dispmanx2png.cpp @@ -10,7 +10,7 @@ #include // Dispmanx grabber includes -#include +#include using namespace vlofgren;