RGB24 and BGR24 cleanup (#1749)

* RGB24 and BGR24 cleanup

* Fix MF-Grabber

* Add BGR32 to V42L Grabber

* Add BGR32 to V42L Grabber

* Add BGR16 to V42L

* Revert "Add BGR16 to V42L"

This reverts commit 42975380f4.
This commit is contained in:
LordGrey
2024-06-01 20:26:20 +02:00
committed by GitHub
parent 76fff98f5c
commit 15c305b8f2
4 changed files with 62 additions and 12 deletions

View File

@@ -27,7 +27,7 @@
static PixelFormat GetPixelFormatForGuid(const GUID guid)
{
if (IsEqualGUID(guid, MFVideoFormat_RGB32)) return PixelFormat::RGB32;
if (IsEqualGUID(guid, MFVideoFormat_RGB24)) return PixelFormat::BGR24;
if (IsEqualGUID(guid, MFVideoFormat_RGB24)) return PixelFormat::RGB24;
if (IsEqualGUID(guid, MFVideoFormat_YUY2)) return PixelFormat::YUYV;
if (IsEqualGUID(guid, MFVideoFormat_UYVY)) return PixelFormat::UYVY;
#ifdef HAVE_TURBO_JPEG
@@ -145,9 +145,9 @@ public:
}
#ifdef HAVE_TURBO_JPEG
if (_pixelformat != PixelFormat::MJPEG && _pixelformat != PixelFormat::BGR24 && _pixelformat != PixelFormat::NO_CHANGE)
if (_pixelformat != PixelFormat::MJPEG && _pixelformat != PixelFormat::RGB24 && _pixelformat != PixelFormat::NO_CHANGE)
#else
if (_pixelformat != PixelFormat::BGR24 && _pixelformat != PixelFormat::NO_CHANGE)
if (_pixelformat != PixelFormat::RGB24 && _pixelformat != PixelFormat::NO_CHANGE)
#endif
pSample = TransformSample(_transform, pSample);
@@ -181,9 +181,9 @@ public:
_bEOS = TRUE; // Reached the end of the stream.
#ifdef HAVE_TURBO_JPEG
if (_pixelformat != PixelFormat::MJPEG && _pixelformat != PixelFormat::BGR24 && _pixelformat != PixelFormat::NO_CHANGE)
if (_pixelformat != PixelFormat::MJPEG && _pixelformat != PixelFormat::RGB24 && _pixelformat != PixelFormat::NO_CHANGE)
#else
if (_pixelformat != PixelFormat::BGR24 && _pixelformat != PixelFormat::NO_CHANGE)
if (_pixelformat != PixelFormat::RGB24 && _pixelformat != PixelFormat::NO_CHANGE)
#endif
SAFE_RELEASE(pSample);
@@ -196,9 +196,9 @@ public:
{
_pixelformat = format;
#ifdef HAVE_TURBO_JPEG
if (format == PixelFormat::MJPEG || format == PixelFormat::BGR24 || format == PixelFormat::NO_CHANGE)
if (format == PixelFormat::MJPEG || format == PixelFormat::RGB24 || format == PixelFormat::NO_CHANGE)
#else
if (format == PixelFormat::BGR24 || format == PixelFormat::NO_CHANGE)
if (format == PixelFormat::RGB24 || format == PixelFormat::NO_CHANGE)
#endif
return S_OK;
@@ -392,10 +392,10 @@ private:
private:
long _nRefCount;
CRITICAL_SECTION _critsec;
MFGrabber* _grabber;
MFGrabber* _grabber;
BOOL _bEOS;
HRESULT _hrStatus;
IMFTransform* _transform;
IMFTransform* _transform;
PixelFormat _pixelformat;
std::atomic<bool> _isBusy;
};