GRAB enabled

This commit is contained in:
jojo61
2018-10-04 16:49:06 +02:00
parent fdedeb6944
commit 35af60f504
7 changed files with 300 additions and 294 deletions

View File

@@ -2887,14 +2887,13 @@ int cSoftHdDevice::PlayTsAudio(const uchar * data, int length)
uchar *cSoftHdDevice::GrabImage(int &size, bool jpeg, int quality, int width,
int height)
{
dsyslog("[softhddev]%s: %d, %d, %d, %dx%d\n", __FUNCTION__, size, jpeg,
quality, width, height);
dsyslog("[softhddev]%s: %d, %d, %d, %dx%d\n", __FUNCTION__, size, jpeg, quality, width, height);
if (SuspendMode != NOT_SUSPENDED) {
return NULL;
return NULL;
}
if (quality < 0) { // caller should care, but fix it
quality = 95;
quality = 95;
}
return::GrabImage(&size, jpeg, quality, width, height);
@@ -2937,8 +2936,7 @@ void cSoftHdDevice::ScaleVideo(const cRect & rect)
extern "C" uint8_t * CreateJpeg(uint8_t * image, int *size, int quality,
int width, int height)
{
return (uint8_t *) RgbToJpeg((uchar *) image, width, height, *size,
quality);
return (uint8_t *) RgbToJpeg((uchar *) image, width, height, *size, quality);
}
//////////////////////////////////////////////////////////////////////////////
@@ -3490,6 +3488,65 @@ bool cPluginSoftHdDevice::SetupParse(const char *name, const char *value)
bool cPluginSoftHdDevice::Service(const char *id, void *data)
{
//dsyslog("[softhddev]%s: id %s\n", __FUNCTION__, id);
if (strcmp(id, OSD_3DMODE_SERVICE) == 0) {
SoftHDDevice_Osd3DModeService_v1_0_t *r;
r = (SoftHDDevice_Osd3DModeService_v1_0_t *) data;
VideoSetOsd3DMode(r->Mode);
return true;
}
if (strcmp(id, ATMO_GRAB_SERVICE) == 0) {
int width;
int height;
if (data == NULL) {
return true;
}
if (SuspendMode != NOT_SUSPENDED) {
return false;
}
SoftHDDevice_AtmoGrabService_v1_0_t *r =
(SoftHDDevice_AtmoGrabService_v1_0_t *) data;
if (r->structSize != sizeof(SoftHDDevice_AtmoGrabService_v1_0_t)
|| r->analyseSize < 64 || r->analyseSize > 256
|| r->clippedOverscan < 0 || r->clippedOverscan > 200) {
return false;
}
width = r->analyseSize * -1; // Internal marker for Atmo grab service
height = r->clippedOverscan;
r->img = VideoGrabService(&r->imgSize, &width, &height);
if (r->img == NULL) {
return false;
}
r->imgType = GRAB_IMG_RGBA_FORMAT_B8G8R8A8;
r->width = width;
r->height = height;
return true;
}
if (strcmp(id, ATMO1_GRAB_SERVICE) == 0) {
SoftHDDevice_AtmoGrabService_v1_1_t *r;
if (!data) {
return true;
}
if (SuspendMode != NOT_SUSPENDED) {
return false;
}
r = (SoftHDDevice_AtmoGrabService_v1_1_t *) data;
r->img = VideoGrabService(&r->size, &r->width, &r->height);
if (!r->img) {
return false;
}
return true;
}
return false;
}