RGB24 and BGR24 cleanup

This commit is contained in:
LordGrey
2024-05-31 18:56:49 +02:00
parent 897e4aac8a
commit a5b42e3024
4 changed files with 48 additions and 10 deletions

View File

@@ -27,7 +27,8 @@
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_BGR24)) return PixelFormat::BGR24;
if (IsEqualGUID(guid, MFVideoFormat_YUY2)) return PixelFormat::YUYV;
if (IsEqualGUID(guid, MFVideoFormat_UYVY)) return PixelFormat::UYVY;
#ifdef HAVE_TURBO_JPEG
@@ -145,9 +146,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::BGR24 && _pixelformat != PixelFormat::NO_CHANGE)
#else
if (_pixelformat != PixelFormat::BGR24 && _pixelformat != PixelFormat::NO_CHANGE)
if (_pixelformat != PixelFormat::RGB24 && _pixelformat != PixelFormat::BGR24 && _pixelformat != PixelFormat::NO_CHANGE)
#endif
pSample = TransformSample(_transform, pSample);
@@ -181,9 +182,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::BGR24 && _pixelformat != PixelFormat::NO_CHANGE)
#else
if (_pixelformat != PixelFormat::BGR24 && _pixelformat != PixelFormat::NO_CHANGE)
if (_pixelformat != PixelFormat::RGB24 && _pixelformat != PixelFormat::BGR24 && _pixelformat != PixelFormat::NO_CHANGE)
#endif
SAFE_RELEASE(pSample);
@@ -196,9 +197,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::BGR24 || format == PixelFormat::NO_CHANGE)
#else
if (format == PixelFormat::BGR24 || format == PixelFormat::NO_CHANGE)
if (format == PixelFormat::RGB24 || format == PixelFormat::BGR24 || format == PixelFormat::NO_CHANGE)
#endif
return S_OK;