From e2983283cb966884e3a053c0ced8604df7d8db8b Mon Sep 17 00:00:00 2001 From: johan Date: Mon, 14 Oct 2013 18:25:54 +0200 Subject: [PATCH] enabled grabbing flags Former-commit-id: 9bb8d3a417bb6edc37ce4f1751e32d35b1c85cab --- libsrc/dispmanx-grabber/DispmanxFrameGrabber.cpp | 14 +------------- libsrc/dispmanx-grabber/DispmanxWrapper.cpp | 3 +-- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/libsrc/dispmanx-grabber/DispmanxFrameGrabber.cpp b/libsrc/dispmanx-grabber/DispmanxFrameGrabber.cpp index 204346fe..3bdc4bdf 100644 --- a/libsrc/dispmanx-grabber/DispmanxFrameGrabber.cpp +++ b/libsrc/dispmanx-grabber/DispmanxFrameGrabber.cpp @@ -1,18 +1,6 @@ #include "DispmanxFrameGrabber.h" -// Because the shapshot function is incompatible between versions (use of different enum as -// third argument) and no proper version number is available as preprocessor define we cast the -// function to the same function with the third argument as 'int'. -// This way we can call the function in both versions of the VideoCore library without -// switching. -static int my_vc_dispmanx_snapshot(DISPMANX_DISPLAY_HANDLE_T display, DISPMANX_RESOURCE_HANDLE_T snapshot_resource, int transform) -{ - typedef int (*SnapshotFunctionPtr)(DISPMANX_DISPLAY_HANDLE_T, DISPMANX_RESOURCE_HANDLE_T, int); - SnapshotFunctionPtr snapshot = (SnapshotFunctionPtr) &vc_dispmanx_snapshot; - return (*snapshot)(display, snapshot_resource, transform); -} - DispmanxFrameGrabber::DispmanxFrameGrabber(const unsigned width, const unsigned height) : _vc_display(0), _vc_resource(0), @@ -77,7 +65,7 @@ void DispmanxFrameGrabber::grabFrame(RgbImage& image) _vc_display = vc_dispmanx_display_open(0); // Create the snapshot (incl down-scaling) - my_vc_dispmanx_snapshot(_vc_display, _vc_resource, _vc_flags); + vc_dispmanx_snapshot(_vc_display, _vc_resource, (DISPMANX_TRANSFORM_T) _vc_flags); // Read the snapshot into the memory void* image_ptr = image.memptr(); diff --git a/libsrc/dispmanx-grabber/DispmanxWrapper.cpp b/libsrc/dispmanx-grabber/DispmanxWrapper.cpp index 96b5c6e0..ba4bd1f1 100644 --- a/libsrc/dispmanx-grabber/DispmanxWrapper.cpp +++ b/libsrc/dispmanx-grabber/DispmanxWrapper.cpp @@ -66,8 +66,7 @@ void DispmanxWrapper::setGrabbingMode(const GrabbingMode mode) switch (mode) { case GRABBINGMODE_VIDEO: - _frameGrabber->setFlags(0); - //_frameGrabber->setFlags(DISPMANX_SNAPSHOT_NO_RGB|DISPMANX_SNAPSHOT_FILL); + _frameGrabber->setFlags(DISPMANX_SNAPSHOT_NO_RGB|DISPMANX_SNAPSHOT_FILL); start(); case GRABBINGMODE_AUDIO: case GRABBINGMODE_PHOTO: