Compare commits

...

5 Commits

Author SHA1 Message Date
Vasishath Kaushal
7f31638d6d Run clang-format 2021-10-07 21:00:28 +05:30
Vasishath Kaushal
77c24d15c8 Handle default case, since it will never be reached 2021-10-07 20:28:25 +05:30
Vasishath Kaushal
318e2c30cf Use switch-case 2021-10-07 20:09:20 +05:30
Vasishath Kaushal
0f916bed27 Merge branch 'master' of https://github.com/vasishath/yuzu-1 2021-10-07 19:45:49 +05:30
Vasishath Kaushal
c9dda44550 Add support for XBGR32 Pixel format 2021-10-05 16:09:30 +05:30
2 changed files with 14 additions and 2 deletions

View File

@@ -68,13 +68,24 @@ void Vic::Execute() {
const auto pixel_format = static_cast<VideoPixelFormat>(config.pixel_format.Value());
switch (pixel_format) {
case VideoPixelFormat::BGRA8:
case VideoPixelFormat::XBGR32:
case VideoPixelFormat::RGBA8: {
LOG_TRACE(Service_NVDRV, "Writing RGB Frame");
if (scaler_ctx == nullptr || frame->width != scaler_width ||
frame->height != scaler_height) {
const AVPixelFormat target_format =
(pixel_format == VideoPixelFormat::RGBA8) ? AV_PIX_FMT_RGBA : AV_PIX_FMT_BGRA;
AVPixelFormat target_format;
switch (pixel_format) {
case VideoPixelFormat::BGRA8:
target_format = AV_PIX_FMT_BGRA;
break;
case VideoPixelFormat::XBGR32:
target_format = AV_PIX_FMT_0BGR32;
break;
default:
target_format = AV_PIX_FMT_RGBA;
break;
}
sws_freeContext(scaler_ctx);
scaler_ctx = nullptr;

View File

@@ -38,6 +38,7 @@ private:
enum class VideoPixelFormat : u64_le {
RGBA8 = 0x1f,
BGRA8 = 0x20,
XBGR32 = 0x23,
Yuv420 = 0x44,
};