Skip to content

Commit

Permalink
Add support for ZasLuke Capture card (awawa-dev#335)
Browse files Browse the repository at this point in the history
This grabber is using non-standard low quality codec TJSAMP_420 for MJPEG.
  • Loading branch information
awawa-dev authored and chbartsch committed Nov 29, 2022
1 parent 22c2bda commit b2e5c87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions sources/grabber/MF/MFWorker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ void MFWorker::process_image_jpg_mt()
return;
}

if (_subsamp != TJSAMP_422 && _hdrToneMappingEnabled > 0)
if ((_subsamp != TJSAMP_422 && _subsamp != TJSAMP_420) && _hdrToneMappingEnabled > 0)
{
emit newFrameError(_workerIndex, QString("%1: %2").arg(UNSUPPORTED_DECODER).arg(_subsamp), _currentFrame);
return;
Expand Down Expand Up @@ -301,7 +301,7 @@ void MFWorker::process_image_jpg_mt()
}

FrameDecoder::processImage(_cropLeft, _cropRight, _cropTop, _cropBottom,
jpegBuffer, _width, _height, _width, PixelFormat::MJPEG, _lutBuffer, image);
jpegBuffer, _width, _height, _width, (_subsamp == TJSAMP_422) ? PixelFormat::MJPEG : PixelFormat::I420, _lutBuffer, image);

free(jpegBuffer);
}
Expand Down
4 changes: 2 additions & 2 deletions sources/grabber/v4l2/V4L2Worker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void V4L2Worker::process_image_jpg_mt()
return;
}

if (_subsamp != TJSAMP_422 && _hdrToneMappingEnabled > 0)
if ((_subsamp != TJSAMP_422 && _subsamp != TJSAMP_420) && _hdrToneMappingEnabled > 0)
{
emit newFrameError(_workerIndex, QString("%1: %2").arg(UNSUPPORTED_DECODER).arg(_subsamp), _currentFrame);
return;
Expand Down Expand Up @@ -283,7 +283,7 @@ void V4L2Worker::process_image_jpg_mt()
}

FrameDecoder::processImage(_cropLeft, _cropRight, _cropTop, _cropBottom,
jpegBuffer, _width, _height, _width, PixelFormat::MJPEG, _lutBuffer, image);
jpegBuffer, _width, _height, _width, (_subsamp == TJSAMP_422) ? PixelFormat::MJPEG : PixelFormat::I420, _lutBuffer, image);

free(jpegBuffer);
}
Expand Down

0 comments on commit b2e5c87

Please sign in to comment.