From c65cf872d1a44e182c158ee9b4e618f617afd243 Mon Sep 17 00:00:00 2001 From: johan Date: Sun, 12 Jan 2014 19:54:10 +0100 Subject: [PATCH] renamed v4l2_to_png Former-commit-id: 87b89104673285a0a225fef53106f13c17bb22ac --- test/CMakeLists.txt | 2 +- test/{v4l2png => v4l2_to_png}/CMakeLists.txt | 8 ++++---- test/{v4l2png => v4l2_to_png}/V4L2Grabber.cpp | 4 ++++ test/{v4l2png => v4l2_to_png}/V4L2Grabber.h | 0 test/{v4l2png/v4l2png.cpp => v4l2_to_png/v4l2_to_png.cpp} | 0 5 files changed, 9 insertions(+), 5 deletions(-) rename test/{v4l2png => v4l2_to_png}/CMakeLists.txt (59%) rename test/{v4l2png => v4l2_to_png}/V4L2Grabber.cpp (99%) rename test/{v4l2png => v4l2_to_png}/V4L2Grabber.h (100%) rename test/{v4l2png/v4l2png.cpp => v4l2_to_png/v4l2_to_png.cpp} (100%) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bc2228c2..63751d1d 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -36,7 +36,7 @@ if (ENABLE_DISPMANX) endif (ENABLE_DISPMANX) if (ENABLE_V4L2) - add_subdirectory(v4l2png) + add_subdirectory(v4l2_to_png) endif (ENABLE_V4L2) add_executable(test_blackborderdetector diff --git a/test/v4l2png/CMakeLists.txt b/test/v4l2_to_png/CMakeLists.txt similarity index 59% rename from test/v4l2png/CMakeLists.txt rename to test/v4l2_to_png/CMakeLists.txt index dd0cba27..ab259048 100644 --- a/test/v4l2png/CMakeLists.txt +++ b/test/v4l2_to_png/CMakeLists.txt @@ -4,14 +4,14 @@ find_package(Qt4 REQUIRED QtCore QtGui) include_directories(${QT_INCLUDES}) -add_executable(v4l_to_png - v4l2png.cpp +add_executable(v4l2_to_png + v4l2_to_png.cpp V4L2Grabber.h V4L2Grabber.cpp) -target_link_libraries(v4l_to_png +target_link_libraries(v4l2_to_png getoptPlusPlus) -qt4_use_modules(v4l_to_png +qt4_use_modules(v4l2_to_png Core Gui) diff --git a/test/v4l2png/V4L2Grabber.cpp b/test/v4l2_to_png/V4L2Grabber.cpp similarity index 99% rename from test/v4l2png/V4L2Grabber.cpp rename to test/v4l2_to_png/V4L2Grabber.cpp index f9adbc3b..3c959621 100644 --- a/test/v4l2png/V4L2Grabber.cpp +++ b/test/v4l2_to_png/V4L2Grabber.cpp @@ -96,7 +96,10 @@ void V4L2Grabber::capture(int frameCount) } if (read_frame()) + { break; + } + /* EAGAIN - continue select loop. */ } } @@ -590,6 +593,7 @@ void V4L2Grabber::process_image(const uint8_t * data) int width = (_width + _pixelDecimation/2) / _pixelDecimation; int height = (_height + _pixelDecimation/2) / _pixelDecimation; + QImage image(width, height, QImage::Format_RGB888); for (int ySource = _pixelDecimation/2, yDest = 0; ySource < _height; ySource += _pixelDecimation, ++yDest) diff --git a/test/v4l2png/V4L2Grabber.h b/test/v4l2_to_png/V4L2Grabber.h similarity index 100% rename from test/v4l2png/V4L2Grabber.h rename to test/v4l2_to_png/V4L2Grabber.h diff --git a/test/v4l2png/v4l2png.cpp b/test/v4l2_to_png/v4l2_to_png.cpp similarity index 100% rename from test/v4l2png/v4l2png.cpp rename to test/v4l2_to_png/v4l2_to_png.cpp