Added simple direct implementation of the frame-grabber using dispmanx (copied from https://github.com/brooc/boblight-rpi/tree/master/src/clients/boblight-dispmanx)

This commit is contained in:
T. van der Zwan
2013-07-31 17:28:01 +02:00
parent 8748437901
commit a695ab91bb
20 changed files with 1467 additions and 14 deletions

View File

@@ -20,7 +20,8 @@ inline Hyperion* rasp_cast(void* hyperion_ptr)
void* boblight_init()
{
syslog(LOG_INFO, __PRETTY_FUNCTION__);
std::cout << __PRETTY_FUNCTION__ << std::endl;
// syslog(LOG_INFO, __PRETTY_FUNCTION__);
const char* homeDir = getenv("RASPILIGHT_HOME");
if (!homeDir)
@@ -83,6 +84,7 @@ int boblight_sendrgb(void* hyperion_ptr, int sync, int* outputused)
int boblight_connect(void* hyperion_ptr, const char* address, int port, int usectimeout)
{
std::cout << "SUCCESFULL NO CONNECTION WITH BOBLIGHT" << std::endl;
return 1;
}
@@ -93,6 +95,7 @@ const char* boblight_geterror(void* hyperion_ptr)
int boblight_setpriority(void* hyperion_ptr, int priority)
{
std::cout << __PRETTY_FUNCTION__ << std::endl;
return 1;
}

View File

@@ -65,20 +65,21 @@ void Hyperion::setInputSize(const unsigned width, const unsigned height)
void Hyperion::commit()
{
// Derive the color per led
const std::vector<RgbColor> ledColors = mLedsMap.getMedianLedColor();
std::vector<RgbColor> ledColors = mLedsMap.getMeanLedColor();
// const std::vector<RgbColor> ledColors = mLedsMap.getMedianLedColor();
// Write the Led colors to the led-string
mDevice->write(ledColors);
}
void Hyperion::operator() (const RgbImage& inputImage)
{
std::cout << "Cached image size: [" << mImage->width() << "x" << mImage->height() << "]. Input image size: [" << inputImage.width() << "x" << inputImage.height() << "]" << std::endl;
// Copy the input-image into the buffer
mImage->copy(inputImage);
// Derive the color per led
// std::vector<RgbColor> ledColors = mLedsMap.getMeanLedColor();
std::vector<RgbColor> ledColors = mLedsMap.getMedianLedColor();
std::vector<RgbColor> ledColors = mLedsMap.getMeanLedColor();
// std::vector<RgbColor> ledColors = mLedsMap.getMedianLedColor();
applyTransform(ledColors);
// Write the Led colors to the led-string