mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
grabber api and feature unification (#462)
* move setvideomode to common place * implement more croping and 3d support * more api unification * more refactoring * osx fix * next step * add a mock for osx grabber. Now it is possible to test compile on none osx platforms. * more unifications ... * remove obsolete includes and grabbers are not dyn allocated. dispmanx needs rework an probaly not work atm * first version of dispmanx mock. it compiles, but outputs a black image * now dispmanx mock works! * activate mocks in travis linux build prepare dispmanx to rgb image out * dispmanx now with image rgb output fix deadlock with w/h -1 in grabber v4l cleanups * fix json * fix some runtime stuff * Update FramebufferWrapper.cpp fix missing code * unify grabframe * 3d and croping for amlogic * fix setimage not working * make use of templates save some codelines * save more code lines
This commit is contained in:
@@ -19,7 +19,9 @@ OsxFrameGrabber::OsxFrameGrabber(const unsigned display, const unsigned width, c
|
||||
{
|
||||
Error(_log, "Display with index %d is not available. Using main display", _screenIndex);
|
||||
_display = kCGDirectMainDisplay;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
_display = displays[_screenIndex];
|
||||
}
|
||||
|
||||
@@ -35,7 +37,7 @@ OsxFrameGrabber::~OsxFrameGrabber()
|
||||
{
|
||||
}
|
||||
|
||||
void OsxFrameGrabber::grabFrame(Image<ColorRgb> & image)
|
||||
int OsxFrameGrabber::grabFrame(Image<ColorRgb> & image)
|
||||
{
|
||||
CGImageRef dispImage;
|
||||
CFDataRef imgData;
|
||||
@@ -52,12 +54,12 @@ void OsxFrameGrabber::grabFrame(Image<ColorRgb> & image)
|
||||
if (dispImage == NULL)
|
||||
{
|
||||
Error(_log, "No display connected...");
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
imgData = CGDataProviderCopyData(CGImageGetDataProvider(dispImage));
|
||||
pImgData = (unsigned char*) CFDataGetBytePtr(imgData);
|
||||
dspWidth = CGImageGetWidth(dispImage);
|
||||
imgData = CGDataProviderCopyData(CGImageGetDataProvider(dispImage));
|
||||
pImgData = (unsigned char*) CFDataGetBytePtr(imgData);
|
||||
dspWidth = CGImageGetWidth(dispImage);
|
||||
dspHeight = CGImageGetHeight(dispImage);
|
||||
|
||||
_imageResampler.setHorizontalPixelDecimation(dspWidth/_width);
|
||||
@@ -71,4 +73,6 @@ void OsxFrameGrabber::grabFrame(Image<ColorRgb> & image)
|
||||
|
||||
CFRelease(imgData);
|
||||
CGImageRelease(dispImage);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user