mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-05-06 15:00:43 +09:00
Fix compile error with old vulkan header: ifdef check vulkan video encoding
This commit is contained in:
3
TODO
3
TODO
@@ -413,3 +413,6 @@ Allow av1 in the flatpak. Do that by patching ffmpeg to support multiple nvenc c
|
|||||||
Increase qp on av1 non-nvidia, decrease qp on h264 nvidia. For vulkan.
|
Increase qp on av1 non-nvidia, decrease qp on h264 nvidia. For vulkan.
|
||||||
|
|
||||||
Check if the vulkan codec query works on nvidia x11.
|
Check if the vulkan codec query works on nvidia x11.
|
||||||
|
|
||||||
|
Fix webcam capture on nvidia x11. It doesn't work when capturing a webcam at the same time as capturing the monitor (nvfbc) because nvfbc requires glx context active (in older nvfbc version, works with egl in newer version)
|
||||||
|
while v4l2 requires egl. All other capture methods require egl so they cant be used together with nvfbc.
|
||||||
@@ -466,7 +466,6 @@ static bool gsr_capture_v4l2_map_buffer(gsr_capture_v4l2 *self, const struct v4l
|
|||||||
|
|
||||||
if(!self->dma_image[i]) {
|
if(!self->dma_image[i]) {
|
||||||
self->yuyv_conversion_fallback = true;
|
self->yuyv_conversion_fallback = true;
|
||||||
// This doesn't work for everybody on nvidia. On pop os 24.04 when egl_display is NULL (when capturing monitor on x11) then this fails with EGL_BAD_DISPLAY
|
|
||||||
self->dma_image[i] = self->params.egl->eglCreateImage(self->params.egl->egl_display, 0, EGL_LINUX_DMA_BUF_EXT, NULL, (intptr_t[]) {
|
self->dma_image[i] = self->params.egl->eglCreateImage(self->params.egl->egl_display, 0, EGL_LINUX_DMA_BUF_EXT, NULL, (intptr_t[]) {
|
||||||
EGL_WIDTH, fmt->fmt.pix.width,
|
EGL_WIDTH, fmt->fmt.pix.width,
|
||||||
EGL_HEIGHT, fmt->fmt.pix.height,
|
EGL_HEIGHT, fmt->fmt.pix.height,
|
||||||
|
|||||||
@@ -24,6 +24,7 @@ static const char *required_device_extensions[] = {
|
|||||||
static int num_required_device_extensions = 8;
|
static int num_required_device_extensions = 8;
|
||||||
|
|
||||||
static void set_h264_max_resolution(PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR vkGetPhysicalDeviceVideoCapabilitiesKHR, VkPhysicalDevice physical_device, gsr_supported_video_codecs *video_codecs) {
|
static void set_h264_max_resolution(PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR vkGetPhysicalDeviceVideoCapabilitiesKHR, VkPhysicalDevice physical_device, gsr_supported_video_codecs *video_codecs) {
|
||||||
|
#ifdef VK_KHR_video_encode_h264
|
||||||
const VkVideoEncodeH264ProfileInfoKHR h264_profile = {
|
const VkVideoEncodeH264ProfileInfoKHR h264_profile = {
|
||||||
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR,
|
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H264_PROFILE_INFO_KHR,
|
||||||
.pNext = NULL,
|
.pNext = NULL,
|
||||||
@@ -53,9 +54,15 @@ static void set_h264_max_resolution(PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR
|
|||||||
video_codecs->h264.max_resolution.x = video_caps.maxCodedExtent.width;
|
video_codecs->h264.max_resolution.x = video_caps.maxCodedExtent.width;
|
||||||
video_codecs->h264.max_resolution.y = video_caps.maxCodedExtent.height;
|
video_codecs->h264.max_resolution.y = video_caps.maxCodedExtent.height;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)vkGetPhysicalDeviceVideoCapabilitiesKHR;
|
||||||
|
(void)physical_device;
|
||||||
|
(void)video_codecs;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_hevc_max_resolution(PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR vkGetPhysicalDeviceVideoCapabilitiesKHR, VkPhysicalDevice physical_device, gsr_supported_video_codecs *video_codecs) {
|
static void set_hevc_max_resolution(PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR vkGetPhysicalDeviceVideoCapabilitiesKHR, VkPhysicalDevice physical_device, gsr_supported_video_codecs *video_codecs) {
|
||||||
|
#ifdef VK_KHR_video_encode_h265
|
||||||
const VkVideoEncodeH265ProfileInfoKHR hevc_profile = {
|
const VkVideoEncodeH265ProfileInfoKHR hevc_profile = {
|
||||||
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR,
|
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_H265_PROFILE_INFO_KHR,
|
||||||
.pNext = NULL,
|
.pNext = NULL,
|
||||||
@@ -91,9 +98,15 @@ static void set_hevc_max_resolution(PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR
|
|||||||
video_codecs->hevc_10bit.max_resolution.x = video_caps.maxCodedExtent.width;
|
video_codecs->hevc_10bit.max_resolution.x = video_caps.maxCodedExtent.width;
|
||||||
video_codecs->hevc_10bit.max_resolution.y = video_caps.maxCodedExtent.height;
|
video_codecs->hevc_10bit.max_resolution.y = video_caps.maxCodedExtent.height;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)vkGetPhysicalDeviceVideoCapabilitiesKHR;
|
||||||
|
(void)physical_device;
|
||||||
|
(void)video_codecs;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_av1_max_resolution(PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR vkGetPhysicalDeviceVideoCapabilitiesKHR, VkPhysicalDevice physical_device, gsr_supported_video_codecs *video_codecs) {
|
static void set_av1_max_resolution(PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR vkGetPhysicalDeviceVideoCapabilitiesKHR, VkPhysicalDevice physical_device, gsr_supported_video_codecs *video_codecs) {
|
||||||
|
#ifdef VK_KHR_video_encode_av1
|
||||||
const VkVideoEncodeAV1ProfileInfoKHR av1_profile = {
|
const VkVideoEncodeAV1ProfileInfoKHR av1_profile = {
|
||||||
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR,
|
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_PROFILE_INFO_KHR,
|
||||||
.pNext = NULL,
|
.pNext = NULL,
|
||||||
@@ -109,7 +122,7 @@ static void set_av1_max_resolution(PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR v
|
|||||||
.chromaBitDepth = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR
|
.chromaBitDepth = VK_VIDEO_COMPONENT_BIT_DEPTH_8_BIT_KHR
|
||||||
};
|
};
|
||||||
|
|
||||||
VkVideoEncodeH265CapabilitiesKHR encode_caps = {
|
VkVideoEncodeAV1CapabilitiesKHR encode_caps = {
|
||||||
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR,
|
.sType = VK_STRUCTURE_TYPE_VIDEO_ENCODE_AV1_CAPABILITIES_KHR,
|
||||||
.pNext = NULL
|
.pNext = NULL
|
||||||
};
|
};
|
||||||
@@ -129,6 +142,11 @@ static void set_av1_max_resolution(PFN_vkGetPhysicalDeviceVideoCapabilitiesKHR v
|
|||||||
video_codecs->av1_10bit.max_resolution.x = video_caps.maxCodedExtent.width;
|
video_codecs->av1_10bit.max_resolution.x = video_caps.maxCodedExtent.width;
|
||||||
video_codecs->av1_10bit.max_resolution.y = video_caps.maxCodedExtent.height;
|
video_codecs->av1_10bit.max_resolution.y = video_caps.maxCodedExtent.height;
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
(void)vkGetPhysicalDeviceVideoCapabilitiesKHR;
|
||||||
|
(void)physical_device;
|
||||||
|
(void)video_codecs;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool gsr_get_supported_video_codecs_vulkan(gsr_supported_video_codecs *video_codecs, const char *card_path, int *device_index_ret, bool cleanup) {
|
bool gsr_get_supported_video_codecs_vulkan(gsr_supported_video_codecs *video_codecs, const char *card_path, int *device_index_ret, bool cleanup) {
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ static unsigned int load_program(gsr_egl *egl, const char *vertex_shader, const
|
|||||||
if(!success) {
|
if(!success) {
|
||||||
if(program_id)
|
if(program_id)
|
||||||
egl->glDeleteProgram(program_id);
|
egl->glDeleteProgram(program_id);
|
||||||
|
program_id = 0;
|
||||||
}
|
}
|
||||||
if(fragment_shader_id)
|
if(fragment_shader_id)
|
||||||
egl->glDeleteShader(fragment_shader_id);
|
egl->glDeleteShader(fragment_shader_id);
|
||||||
|
|||||||
Reference in New Issue
Block a user