|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Vulkan-native encoder: DMA-BUF -> Vulkan compute (RGB->YUV) -> Vulkan Video encode. No EGL/GL dependency — all GPU work stays in a single Vulkan queue. More...
#include <algorithm>#include <array>#include <cstdint>#include <drm_fourcc.h>#include <sys/stat.h>#include <sys/sysmacros.h>#include <vector>#include <vulkan/vulkan.h>#include <libavcodec/avcodec.h>#include <libavutil/hwcontext.h>#include <libavutil/hwcontext_vulkan.h>#include "graphics.h"#include "src/config.h"#include "src/logging.h"#include "src/video_colorspace.h"#include "vulkan_encode.h"#include "shaders/rgb2yuv.spv.inc"Classes | |
| struct | vk::PushConstants |
| Vulkan shader constants used by the conversion pass. More... | |
| class | vk::vk_vram_t |
| Vulkan encode device that keeps converted frames in GPU memory. More... | |
Macros | |
| #define | VK_CHECK(expr) |
| Macro for VK CHECK. | |
| #define | VK_CHECK_BOOL(expr) |
| Macro for VK CHECK BOOL. | |
Functions | |
| std::unique_ptr< platf::avcodec_encode_device_t > | vk::make_avcodec_encode_device_ram (int width, int height) |
| Create a Vulkan encode device for RAM capture. | |
| std::unique_ptr< platf::avcodec_encode_device_t > | vk::make_avcodec_encode_device_vram (int width, int height, int offset_x, int offset_y) |
| Create a Vulkan encode device for VRAM capture. | |
| bool | vk::validate () |
| Check if FFmpeg Vulkan Video encoding is available. | |
| int | vk::vulkan_init_avcodec_hardware_input_buffer (platf::avcodec_encode_device_t *encode_device, AVBufferRef **hw_device_buf) |
| Initialize Vulkan hardware device for FFmpeg encoding. | |
Vulkan-native encoder: DMA-BUF -> Vulkan compute (RGB->YUV) -> Vulkan Video encode. No EGL/GL dependency — all GPU work stays in a single Vulkan queue.
| #define VK_CHECK | ( | expr | ) |
| #define VK_CHECK_BOOL | ( | expr | ) |
Macro for VK CHECK BOOL.
| std::unique_ptr< platf::avcodec_encode_device_t > vk::make_avcodec_encode_device_ram | ( | int | width, |
| int | height ) |
Create a Vulkan encode device for RAM capture.
| width | Frame or display width in pixels. |
| height | Frame or display height in pixels. |
| std::unique_ptr< platf::avcodec_encode_device_t > vk::make_avcodec_encode_device_vram | ( | int | width, |
| int | height, | ||
| int | offset_x, | ||
| int | offset_y ) |
Create a Vulkan encode device for VRAM capture.
| width | Frame or display width in pixels. |
| height | Frame or display height in pixels. |
| offset_x | Offset x. |
| offset_y | Offset y. |
| bool vk::validate | ( | ) |
Check if FFmpeg Vulkan Video encoding is available.
| int vk::vulkan_init_avcodec_hardware_input_buffer | ( | platf::avcodec_encode_device_t * | encode_device, |
| AVBufferRef ** | hw_device_buf ) |
Initialize Vulkan hardware device for FFmpeg encoding.
| encode_device | The encode device (vk_t). |
| hw_device_buf | Output hardware device buffer. |