diff options
| -rw-r--r-- | src/video_core/command_classes/vic.cpp | 17 | ||||
| -rw-r--r-- | src/video_core/command_classes/vic.h | 1 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/video_core/command_classes/vic.cpp b/src/video_core/command_classes/vic.cpp index 0ee07f398..d77eb0c85 100644 --- a/src/video_core/command_classes/vic.cpp +++ b/src/video_core/command_classes/vic.cpp | |||
| @@ -68,13 +68,24 @@ void Vic::Execute() { | |||
| 68 | const auto pixel_format = static_cast<VideoPixelFormat>(config.pixel_format.Value()); | 68 | const auto pixel_format = static_cast<VideoPixelFormat>(config.pixel_format.Value()); |
| 69 | switch (pixel_format) { | 69 | switch (pixel_format) { |
| 70 | case VideoPixelFormat::BGRA8: | 70 | case VideoPixelFormat::BGRA8: |
| 71 | case VideoPixelFormat::RGBX8: | ||
| 71 | case VideoPixelFormat::RGBA8: { | 72 | case VideoPixelFormat::RGBA8: { |
| 72 | LOG_TRACE(Service_NVDRV, "Writing RGB Frame"); | 73 | LOG_TRACE(Service_NVDRV, "Writing RGB Frame"); |
| 73 | 74 | ||
| 74 | if (scaler_ctx == nullptr || frame->width != scaler_width || | 75 | if (scaler_ctx == nullptr || frame->width != scaler_width || |
| 75 | frame->height != scaler_height) { | 76 | frame->height != scaler_height) { |
| 76 | const AVPixelFormat target_format = | 77 | const AVPixelFormat target_format = [pixel_format]() { |
| 77 | (pixel_format == VideoPixelFormat::RGBA8) ? AV_PIX_FMT_RGBA : AV_PIX_FMT_BGRA; | 78 | switch (pixel_format) { |
| 79 | case VideoPixelFormat::BGRA8: | ||
| 80 | return AV_PIX_FMT_BGRA; | ||
| 81 | case VideoPixelFormat::RGBX8: | ||
| 82 | return AV_PIX_FMT_RGB0; | ||
| 83 | case VideoPixelFormat::RGBA8: | ||
| 84 | return AV_PIX_FMT_RGBA; | ||
| 85 | default: | ||
| 86 | return AV_PIX_FMT_RGBA; | ||
| 87 | } | ||
| 88 | }(); | ||
| 78 | 89 | ||
| 79 | sws_freeContext(scaler_ctx); | 90 | sws_freeContext(scaler_ctx); |
| 80 | scaler_ctx = nullptr; | 91 | scaler_ctx = nullptr; |
| @@ -190,7 +201,7 @@ void Vic::Execute() { | |||
| 190 | break; | 201 | break; |
| 191 | } | 202 | } |
| 192 | default: | 203 | default: |
| 193 | UNIMPLEMENTED_MSG("Unknown video pixel format {}", config.pixel_format.Value()); | 204 | UNIMPLEMENTED_MSG("Unknown video pixel format {:X}", config.pixel_format.Value()); |
| 194 | break; | 205 | break; |
| 195 | } | 206 | } |
| 196 | } | 207 | } |
diff --git a/src/video_core/command_classes/vic.h b/src/video_core/command_classes/vic.h index 74246e08c..ea10c2f0f 100644 --- a/src/video_core/command_classes/vic.h +++ b/src/video_core/command_classes/vic.h | |||
| @@ -38,6 +38,7 @@ private: | |||
| 38 | enum class VideoPixelFormat : u64_le { | 38 | enum class VideoPixelFormat : u64_le { |
| 39 | RGBA8 = 0x1f, | 39 | RGBA8 = 0x1f, |
| 40 | BGRA8 = 0x20, | 40 | BGRA8 = 0x20, |
| 41 | RGBX8 = 0x23, | ||
| 41 | Yuv420 = 0x44, | 42 | Yuv420 = 0x44, |
| 42 | }; | 43 | }; |
| 43 | 44 | ||