diff --git a/cmake/compile_definitions/common.cmake b/cmake/compile_definitions/common.cmake index 01faa7105..94fbb1426 100644 --- a/cmake/compile_definitions/common.cmake +++ b/cmake/compile_definitions/common.cmake @@ -7,6 +7,8 @@ list(APPEND SUNSHINE_COMPILE_OPTIONS -Wall -Wno-sign-compare) # Wno-maybe-uninitialized/Wno-uninitialized - disable warnings for maybe uninitialized variables # Wno-sign-compare - disable warnings for signed/unsigned comparisons # Wno-restrict - disable warnings for memory overlap +# Wmissing-field-initializers - enable warnings for missing field initializers +# Wno-missing-designated-field-initializers - disable warning for missing designated initializers if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") # GCC specific compile options @@ -31,6 +33,12 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "^(Apple)?Clang$") # Clang doesn't actually complain about this this, so disabling for now # list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-uninitialized) + # Warn for missing positional field initializers but not designated initializers + if(CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19) + list(APPEND SUNSHINE_COMPILE_OPTIONS -Wmissing-field-initializers) + list(APPEND SUNSHINE_COMPILE_OPTIONS -Wno-missing-designated-field-initializers) + endif() + # Some libc++ versions on Apple and FreeBSD guard std::jthread behind this flag. if(APPLE OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") list(APPEND SUNSHINE_COMPILE_OPTIONS -fexperimental-library) diff --git a/cmake/targets/common.cmake b/cmake/targets/common.cmake index 2aa9f0946..19e1a9a7e 100644 --- a/cmake/targets/common.cmake +++ b/cmake/targets/common.cmake @@ -124,6 +124,7 @@ string(APPEND VIGEM_COMPILE_FLAGS "-Wno-misleading-indentation ") string(APPEND VIGEM_COMPILE_FLAGS "-Wno-class-memaccess ") string(APPEND VIGEM_COMPILE_FLAGS "-Wno-unused-function ") string(APPEND VIGEM_COMPILE_FLAGS "-Wno-unused-variable ") +string(APPEND VIGEM_COMPILE_FLAGS "-Wno-missing-field-initializers ") set_source_files_properties("${CMAKE_SOURCE_DIR}/third-party/ViGEmClient/src/ViGEmClient.cpp" DIRECTORY "${CMAKE_SOURCE_DIR}" "${TEST_DIR}" PROPERTIES diff --git a/src/config.cpp b/src/config.cpp index 2911deae0..e0e864735 100644 --- a/src/config.cpp +++ b/src/config.cpp @@ -861,6 +861,7 @@ namespace config { true, // virtualhid_randomize_mac true, // keyboard enabled + false, // key_rightalt_to_key_win true, // mouse enabled true, // controller enabled true, // always send scancodes @@ -888,6 +889,7 @@ namespace config { false, // notify_pre_releases true, // system_tray {}, // prep commands + {}, // csrf_allowed_origins }; /** diff --git a/src/input.cpp b/src/input.cpp index 9264ed9d8..a12514d4e 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -278,7 +278,7 @@ namespace input { touch_port_event {std::move(touch_port_event)}, feedback_queue {std::move(feedback_queue)}, mouse_left_button_timeout {}, - touch_port {{0, 0, 0, 0}, 0, 0, 1.0f, 1.0f, 0, 0}, + touch_port {{0, 0, 0, 0, 0, 0}, 0, 0, 0.0f, 0.0f, 1.0f, 1.0f, 0, 0}, accumulated_vscroll_delta {}, accumulated_hscroll_delta {} { } @@ -860,7 +860,9 @@ namespace input { touch_port.offset_x, touch_port.offset_y, touch_port_dim_x, - touch_port_dim_y + touch_port_dim_y, + touch_port.logical_width, + touch_port.logical_height, }; platf::abs_mouse(platf_input, abs_port, tpcoords->first, tpcoords->second); @@ -1343,7 +1345,9 @@ namespace input { touch_port.offset_x, touch_port.offset_y, static_cast(monitor_logical_w), - static_cast(monitor_logical_h) + static_cast(monitor_logical_h), + static_cast(monitor_logical_w), + static_cast(monitor_logical_h), }; } diff --git a/src/nvenc/nvenc_base.cpp b/src/nvenc/nvenc_base.cpp index f6f5b6fe3..d20ca836c 100644 --- a/src/nvenc/nvenc_base.cpp +++ b/src/nvenc/nvenc_base.cpp @@ -193,7 +193,7 @@ namespace NVENC_NAMESPACE { } int nvenc_base::get_encoder_cap(const GUID &encode_guid, NV_ENC_CAPS cap) const { - NV_ENC_CAPS_PARAM param = {NV_ENC_CAPS_PARAM_VER}; + NV_ENC_CAPS_PARAM param = {.version = NV_ENC_CAPS_PARAM_VER}; param.capsToQuery = cap; int value = 0; if (nvenc->nvEncGetEncodeCaps(encoder, encode_guid, ¶m, &value) == NV_ENC_SUCCESS) { @@ -492,7 +492,7 @@ namespace NVENC_NAMESPACE { return false; } if (async_event_handle) { - NV_ENC_EVENT_PARAMS event_params = {NV_ENC_EVENT_PARAMS_VER}; + NV_ENC_EVENT_PARAMS event_params = {.version = NV_ENC_EVENT_PARAMS_VER}; event_params.completionEvent = async_event_handle; if (nvenc_failed(nvenc->nvEncRegisterAsyncEvent(encoder, &event_params))) { BOOST_LOG(error) << "NvEnc: NvEncRegisterAsyncEvent() failed: " << last_nvenc_error_string; @@ -500,7 +500,7 @@ namespace NVENC_NAMESPACE { } } - NV_ENC_CREATE_BITSTREAM_BUFFER create_bitstream_buffer = {NV_ENC_CREATE_BITSTREAM_BUFFER_VER}; + NV_ENC_CREATE_BITSTREAM_BUFFER create_bitstream_buffer = {.version = NV_ENC_CREATE_BITSTREAM_BUFFER_VER}; if (nvenc_failed(nvenc->nvEncCreateBitstreamBuffer(encoder, &create_bitstream_buffer))) { BOOST_LOG(error) << "NvEnc: NvEncCreateBitstreamBuffer() failed: " << last_nvenc_error_string; return false; @@ -589,7 +589,7 @@ namespace NVENC_NAMESPACE { encoder_params.buffer_format = buffer_format; encoder_params.rfi = true; - NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS session_params = {NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS_VER}; + NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS session_params = {.version = NV_ENC_OPEN_ENCODE_SESSION_EX_PARAMS_VER}; session_params.device = device; session_params.deviceType = device_type; session_params.apiVersion = NVENCAPI_VERSION; @@ -609,7 +609,7 @@ namespace NVENC_NAMESPACE { return false; } - NV_ENC_INITIALIZE_PARAMS init_params = {NV_ENC_INITIALIZE_PARAMS_VER}; + NV_ENC_INITIALIZE_PARAMS init_params = {.version = NV_ENC_INITIALIZE_PARAMS_VER}; switch (client_config.videoFormat) { case 0: init_params.encodeGUID = NV_ENC_CODEC_H264_GUID; @@ -685,7 +685,7 @@ namespace NVENC_NAMESPACE { output_bitstream = nullptr; } if (encoder && async_event_handle) { - NV_ENC_EVENT_PARAMS event_params = {NV_ENC_EVENT_PARAMS_VER}; + NV_ENC_EVENT_PARAMS event_params = {.version = NV_ENC_EVENT_PARAMS_VER}; event_params.completionEvent = async_event_handle; if (nvenc_failed(nvenc->nvEncUnregisterAsyncEvent(encoder, &event_params))) { BOOST_LOG(error) << "NvEnc: NvEncUnregisterAsyncEvent() failed: " << last_nvenc_error_string; @@ -721,7 +721,7 @@ namespace NVENC_NAMESPACE { return {}; } - NV_ENC_MAP_INPUT_RESOURCE mapped_input_buffer = {NV_ENC_MAP_INPUT_RESOURCE_VER}; + NV_ENC_MAP_INPUT_RESOURCE mapped_input_buffer = {.version = NV_ENC_MAP_INPUT_RESOURCE_VER}; mapped_input_buffer.registeredResource = registered_input_buffer; if (nvenc_failed(nvenc->nvEncMapInputResource(encoder, &mapped_input_buffer))) { @@ -734,7 +734,7 @@ namespace NVENC_NAMESPACE { } }); - NV_ENC_PIC_PARAMS pic_params = {NV_ENC_PIC_PARAMS_VER}; + NV_ENC_PIC_PARAMS pic_params = {.version = NV_ENC_PIC_PARAMS_VER}; pic_params.inputWidth = encoder_params.width; pic_params.inputHeight = encoder_params.height; pic_params.encodePicFlags = force_idr ? NV_ENC_PIC_FLAG_FORCEIDR : 0; @@ -750,7 +750,7 @@ namespace NVENC_NAMESPACE { return {}; } - NV_ENC_LOCK_BITSTREAM lock_bitstream = {NV_ENC_LOCK_BITSTREAM_VER}; + NV_ENC_LOCK_BITSTREAM lock_bitstream = {.version = NV_ENC_LOCK_BITSTREAM_VER}; lock_bitstream.outputBitstream = output_bitstream; lock_bitstream.doNotWait = async_event_handle ? 1 : 0; diff --git a/src/nvenc/nvenc_d3d11_native.cpp b/src/nvenc/nvenc_d3d11_native.cpp index 7af661b60..32fe16053 100644 --- a/src/nvenc/nvenc_d3d11_native.cpp +++ b/src/nvenc/nvenc_d3d11_native.cpp @@ -51,7 +51,7 @@ namespace NVENC_NAMESPACE { } if (!registered_input_buffer) { - NV_ENC_REGISTER_RESOURCE register_resource = {NV_ENC_REGISTER_RESOURCE_VER}; + NV_ENC_REGISTER_RESOURCE register_resource = {.version = NV_ENC_REGISTER_RESOURCE_VER}; register_resource.resourceType = NV_ENC_INPUT_RESOURCE_TYPE_DIRECTX; register_resource.width = encoder_params.width; register_resource.height = encoder_params.height; diff --git a/src/nvenc/nvenc_d3d11_on_cuda.cpp b/src/nvenc/nvenc_d3d11_on_cuda.cpp index b5189589e..6738957da 100644 --- a/src/nvenc/nvenc_d3d11_on_cuda.cpp +++ b/src/nvenc/nvenc_d3d11_on_cuda.cpp @@ -144,7 +144,7 @@ namespace NVENC_NAMESPACE { } if (!registered_input_buffer) { - NV_ENC_REGISTER_RESOURCE register_resource = {NV_ENC_REGISTER_RESOURCE_VER}; + NV_ENC_REGISTER_RESOURCE register_resource = {.version = NV_ENC_REGISTER_RESOURCE_VER}; register_resource.resourceType = NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR; register_resource.width = encoder_params.width; register_resource.height = encoder_params.height; diff --git a/src/platform/common.h b/src/platform/common.h index 6534f325d..325f913b3 100644 --- a/src/platform/common.h +++ b/src/platform/common.h @@ -256,7 +256,6 @@ namespace platf { } player_leds; ///< Player-indicator LED payload. struct { - uint16_t controllerNumber; ///< Controller number supplied to the adaptive-trigger backend. uint8_t event_flags; ///< Flags describing which adaptive-trigger data is present. uint8_t type_left; ///< Left adaptive-trigger effect type. uint8_t type_right; ///< Right adaptive-trigger effect type. diff --git a/src/platform/linux/cuda.cpp b/src/platform/linux/cuda.cpp index 43cb5e6a7..7da5669d9 100644 --- a/src/platform/linux/cuda.cpp +++ b/src/platform/linux/cuda.cpp @@ -694,7 +694,7 @@ namespace cuda { namespace nvfbc { static PNVFBCCREATEINSTANCE createInstance {}; - static NVFBC_API_FUNCTION_LIST func {NVFBC_VERSION}; + static NVFBC_API_FUNCTION_LIST func {.dwVersion = NVFBC_VERSION}; static constexpr inline NVFBC_BOOL nv_bool(bool b) { return b ? NVFBC_TRUE : NVFBC_FALSE; @@ -818,7 +818,7 @@ namespace cuda { * @return Created backend object, or null when creation fails. */ static std::optional make() { - NVFBC_CREATE_HANDLE_PARAMS params {NVFBC_CREATE_HANDLE_PARAMS_VER}; + NVFBC_CREATE_HANDLE_PARAMS params {.dwVersion = NVFBC_CREATE_HANDLE_PARAMS_VER}; // Set privateData to allow NvFBC on consumer NVIDIA GPUs. // Based on https://github.com/keylase/nvidia-patch/blob/3193b4b1cea91527bf09ea9b8db5aade6a3f3c0a/win/nvfbcwrp/nvfbcwrp_main.cpp#L23-L25 . @@ -854,7 +854,7 @@ namespace cuda { * @return Status status. */ std::optional status() { - NVFBC_GET_STATUS_PARAMS params {NVFBC_GET_STATUS_PARAMS_VER}; + NVFBC_GET_STATUS_PARAMS params {.dwVersion = NVFBC_GET_STATUS_PARAMS_VER}; auto status = func.nvFBCGetStatus(handle, ¶ms); if (status) { @@ -990,7 +990,7 @@ namespace cuda { delay = ::video::capture_frame_interval(config); - capture_params = NVFBC_CREATE_CAPTURE_SESSION_PARAMS {NVFBC_CREATE_CAPTURE_SESSION_PARAMS_VER}; + capture_params = NVFBC_CREATE_CAPTURE_SESSION_PARAMS {.dwVersion = NVFBC_CREATE_CAPTURE_SESSION_PARAMS_VER}; capture_params.eCaptureType = NVFBC_CAPTURE_SHARED_CUDA; capture_params.bDisableAutoModesetRecovery = nv_bool(true); diff --git a/src/platform/linux/graphics.cpp b/src/platform/linux/graphics.cpp index 1ef27c716..4a65c69b3 100644 --- a/src/platform/linux/graphics.cpp +++ b/src/platform/linux/graphics.cpp @@ -848,11 +848,13 @@ namespace egl { */ std::optional create_nv12_target(int width, int height, AVPixelFormat format) { nv12_t nv12 { - EGL_NO_DISPLAY, - EGL_NO_IMAGE, - EGL_NO_IMAGE, - gl::tex_t::make(2), - gl::frame_buf_t::make(2), + nv12_img_t { + .display = EGL_NO_DISPLAY, + .r8 = EGL_NO_IMAGE, + .bg88 = EGL_NO_IMAGE, + .tex = gl::tex_t::make(2), + .buf = gl::frame_buf_t::make(2), + }, }; GLint y_format; @@ -889,12 +891,14 @@ namespace egl { */ std::optional create_yuv444_target(int width, int height, AVPixelFormat format) { yuv444_t yuv444 { - EGL_NO_DISPLAY, - EGL_NO_IMAGE, - EGL_NO_IMAGE, - EGL_NO_IMAGE, - gl::tex_t::make(3), - gl::frame_buf_t::make(3), + yuv444_img_t { + .display = EGL_NO_DISPLAY, + .r8 = EGL_NO_IMAGE, + .g8 = EGL_NO_IMAGE, + .b8 = EGL_NO_IMAGE, + .tex = gl::tex_t::make(3), + .buf = gl::frame_buf_t::make(3), + }, }; GLint y_format; diff --git a/src/platform/linux/kmsgrab.cpp b/src/platform/linux/kmsgrab.cpp index 81f9e7cb5..d106f4099 100644 --- a/src/platform/linux/kmsgrab.cpp +++ b/src/platform/linux/kmsgrab.cpp @@ -792,8 +792,8 @@ namespace platf { for (auto &connector : connectors) { result.emplace(connector.crtc_id, monitor_t { - connector.type, - connector.index, + .type = connector.type, + .index = connector.index, }); } @@ -2090,10 +2090,10 @@ namespace platf { auto it = crtc_to_monitor.find(plane->crtc_id); if (it != std::end(crtc_to_monitor)) { it->second.viewport = platf::touch_port_t { - (int) crtc->x, - (int) crtc->y, - (int) crtc->width, - (int) crtc->height, + .offset_x = (int) crtc->x, + .offset_y = (int) crtc->y, + .width = (int) crtc->width, + .height = (int) crtc->height, }; it->second.monitor_index = count; } diff --git a/src/platform/linux/portalgrab.cpp b/src/platform/linux/portalgrab.cpp index 83f5afdc8..5b8802aef 100644 --- a/src/platform/linux/portalgrab.cpp +++ b/src/platform/linux/portalgrab.cpp @@ -354,9 +354,7 @@ namespace portal { GDBusProxy *proxy = use_screencast ? screencast_proxy : remote_desktop_proxy; const char *session_type = use_screencast ? "ScreenCast" : "RemoteDesktop"; - dbus_response_t response = { - nullptr, - }; + dbus_response_t response {}; g_autofree gchar *request_token = nullptr; create_request_path(conn, nullptr, &request_token); @@ -417,9 +415,7 @@ namespace portal { } int select_remote_desktop_devices(GMainLoop *loop, const gchar *session_path) { - dbus_response_t response = { - nullptr, - }; + dbus_response_t response {}; g_autofree gchar *request_token = nullptr; create_request_path(conn, nullptr, &request_token); @@ -467,9 +463,7 @@ namespace portal { } int select_screencast_sources(GMainLoop *loop, const gchar *session_path, bool persist) { - dbus_response_t response = { - nullptr, - }; + dbus_response_t response {}; g_autofree gchar *request_token = nullptr; create_request_path(conn, nullptr, &request_token); @@ -523,9 +517,7 @@ namespace portal { GDBusProxy *proxy = use_screencast ? screencast_proxy : remote_desktop_proxy; const char *session_type = use_screencast ? "ScreenCast" : "RemoteDesktop"; - dbus_response_t response = { - nullptr, - }; + dbus_response_t response {}; g_autofree gchar *request_token = nullptr; create_request_path(conn, nullptr, &request_token); @@ -608,7 +600,14 @@ namespace portal { out_pipewire_object_serial = SPA_ID_INVALID; } - auto stream = pipewire_streaminfo_t {out_pipewire_node, out_pipewire_object_serial, out_width, out_height, out_pos_x, out_pos_y}; + auto stream = pipewire_streaminfo_t { + .pipewire_node = out_pipewire_node, + .pipewire_object_serial = out_pipewire_object_serial, + .width = out_width, + .height = out_height, + .pos_x = out_pos_x, + .pos_y = out_pos_y, + }; // Try to match the stream to a monitor_name by position/resolution and update stream info for (const auto &monitor : wl_monitors) { diff --git a/src/platform/linux/vaapi.cpp b/src/platform/linux/vaapi.cpp index 43e86650f..c98f0b82b 100644 --- a/src/platform/linux/vaapi.cpp +++ b/src/platform/linux/vaapi.cpp @@ -309,7 +309,7 @@ namespace va { } // When the compression_level AVOption is set, vaapi_encode.c assigns the value to VAEncMiscParameterBufferQualityLevel - VAConfigAttrib quality_attr = {VAConfigAttribEncQualityRange}; + VAConfigAttrib quality_attr = {.type = VAConfigAttribEncQualityRange}; auto status = vaGetConfigAttributes(va_display, va_profile, va_entrypoint, &quality_attr, 1); if (status != VA_STATUS_SUCCESS || quality_attr.value == VA_ATTRIB_NOT_SUPPORTED) { quality_attr.value = 0; @@ -333,14 +333,14 @@ namespace va { BOOST_LOG(info) << "[VAAPI] Quality level set to "sv << ctx->compression_level << " (fastest level: "sv << quality_attr.value << ")"sv; } - VAConfigAttrib rc_attr = {VAConfigAttribRateControl}; + VAConfigAttrib rc_attr = {.type = VAConfigAttribRateControl}; status = vaGetConfigAttributes(va_display, va_profile, va_entrypoint, &rc_attr, 1); if (status != VA_STATUS_SUCCESS) { // Stick to the default rate control (CQP) rc_attr.value = 0; } - VAConfigAttrib slice_attr = {VAConfigAttribEncMaxSlices}; + VAConfigAttrib slice_attr = {.type = VAConfigAttribEncMaxSlices}; status = vaGetConfigAttributes(va_display, va_profile, va_entrypoint, &slice_attr, 1); if (status != VA_STATUS_SUCCESS) { // Assume only a single slice is supported diff --git a/src/platform/linux/vulkan_encode.cpp b/src/platform/linux/vulkan_encode.cpp index b8ef5310e..1e6a78994 100644 --- a/src/platform/linux/vulkan_encode.cpp +++ b/src/platform/linux/vulkan_encode.cpp @@ -50,11 +50,11 @@ namespace vk { auto target_major = major(node_stat.st_rdev); auto target_minor = minor(node_stat.st_rdev); - VkApplicationInfo app = {VK_STRUCTURE_TYPE_APPLICATION_INFO}; + VkApplicationInfo app = {.sType = VK_STRUCTURE_TYPE_APPLICATION_INFO}; app.apiVersion = VK_API_VERSION_1_1; static const std::array instance_exts = {VK_EXT_PHYSICAL_DEVICE_DRM_EXTENSION_NAME}; - VkInstanceCreateInfo ci = {VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO}; + VkInstanceCreateInfo ci = {.sType = VK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO}; ci.pApplicationInfo = &app; ci.enabledExtensionCount = instance_exts.size(); ci.ppEnabledExtensionNames = instance_exts.data(); @@ -75,8 +75,8 @@ namespace vk { std::string result; for (uint32_t i = 0; i < count; i++) { - VkPhysicalDeviceDrmPropertiesEXT drm = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT}; - VkPhysicalDeviceProperties2 props2 = {VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2}; + VkPhysicalDeviceDrmPropertiesEXT drm = {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRM_PROPERTIES_EXT}; + VkPhysicalDeviceProperties2 props2 = {.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2}; props2.pNext = &drm; vkGetPhysicalDeviceProperties2(devs[i], &props2); if (drm.hasRender && drm.renderMajor == (int64_t) target_major && drm.renderMinor == (int64_t) target_minor) { @@ -238,7 +238,7 @@ namespace vk { // (when VK_KHR_internally_synchronized_queues is available). The Vulkan spec requires // vkGetDeviceQueue2 to retrieve such queues; plain vkGetDeviceQueue would return an // incompatible queue handle, breaking synchronization with the encoder. - VkDeviceQueueInfo2 queue_info = {VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2}; + VkDeviceQueueInfo2 queue_info = {.sType = VK_STRUCTURE_TYPE_DEVICE_QUEUE_INFO_2}; queue_info.flags = vk_dev.ctx->queue_flags; queue_info.queueFamilyIndex = vk_dev.compute_qf; queue_info.queueIndex = 0; @@ -391,7 +391,7 @@ namespace vk { private: bool create_compute_pipeline() { // Shader module - VkShaderModuleCreateInfo shader_ci = {VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO}; + VkShaderModuleCreateInfo shader_ci = {.sType = VK_STRUCTURE_TYPE_SHADER_MODULE_CREATE_INFO}; shader_ci.codeSize = rgb2yuv_comp_spv_size; shader_ci.pCode = rgb2yuv_comp_spv_data.data(); VK_CHECK_BOOL(vkCreateShaderModule(vk_dev.dev, &shader_ci, nullptr, &compute.shader_module)); @@ -403,7 +403,7 @@ namespace vk { bindings[2] = {2, VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 1, VK_SHADER_STAGE_COMPUTE_BIT, nullptr}; bindings[3] = {3, VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 1, VK_SHADER_STAGE_COMPUTE_BIT, nullptr}; - VkDescriptorSetLayoutCreateInfo ds_layout_ci = {VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO}; + VkDescriptorSetLayoutCreateInfo ds_layout_ci = {.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO}; ds_layout_ci.bindingCount = bindings.size(); ds_layout_ci.pBindings = bindings.data(); VK_CHECK_BOOL(vkCreateDescriptorSetLayout(vk_dev.dev, &ds_layout_ci, nullptr, &compute.ds_layout)); @@ -411,7 +411,7 @@ namespace vk { // Push constant range VkPushConstantRange pc_range = {VK_SHADER_STAGE_COMPUTE_BIT, 0, sizeof(PushConstants)}; - VkPipelineLayoutCreateInfo pl_ci = {VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO}; + VkPipelineLayoutCreateInfo pl_ci = {.sType = VK_STRUCTURE_TYPE_PIPELINE_LAYOUT_CREATE_INFO}; pl_ci.setLayoutCount = 1; pl_ci.pSetLayouts = &compute.ds_layout; pl_ci.pushConstantRangeCount = 1; @@ -419,8 +419,8 @@ namespace vk { VK_CHECK_BOOL(vkCreatePipelineLayout(vk_dev.dev, &pl_ci, nullptr, &compute.pipeline_layout)); // Compute pipeline - VkComputePipelineCreateInfo comp_ci = {VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO}; - comp_ci.stage = {VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO}; + VkComputePipelineCreateInfo comp_ci = {.sType = VK_STRUCTURE_TYPE_COMPUTE_PIPELINE_CREATE_INFO}; + comp_ci.stage = {.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO}; comp_ci.stage.stage = VK_SHADER_STAGE_COMPUTE_BIT; comp_ci.stage.module = compute.shader_module; comp_ci.stage.pName = "main"; @@ -432,20 +432,20 @@ namespace vk { {VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER, 2}, {VK_DESCRIPTOR_TYPE_STORAGE_IMAGE, 2}, }}; - VkDescriptorPoolCreateInfo pool_ci = {VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO}; + VkDescriptorPoolCreateInfo pool_ci = {.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO}; pool_ci.maxSets = 1; pool_ci.poolSizeCount = pool_sizes.size(); pool_ci.pPoolSizes = pool_sizes.data(); VK_CHECK_BOOL(vkCreateDescriptorPool(vk_dev.dev, &pool_ci, nullptr, &compute.desc_pool)); - VkDescriptorSetAllocateInfo alloc_info = {VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO}; + VkDescriptorSetAllocateInfo alloc_info = {.sType = VK_STRUCTURE_TYPE_DESCRIPTOR_SET_ALLOCATE_INFO}; alloc_info.descriptorPool = compute.desc_pool; alloc_info.descriptorSetCount = 1; alloc_info.pSetLayouts = &compute.ds_layout; VK_CHECK_BOOL(vkAllocateDescriptorSets(vk_dev.dev, &alloc_info, &compute.desc_set)); // Sampler for source image - VkSamplerCreateInfo sampler_ci = {VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO}; + VkSamplerCreateInfo sampler_ci = {.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO}; sampler_ci.magFilter = VK_FILTER_LINEAR; sampler_ci.minFilter = VK_FILTER_LINEAR; sampler_ci.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; @@ -460,12 +460,12 @@ namespace vk { } bool create_command_resources() { - VkCommandPoolCreateInfo pool_ci = {VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO}; + VkCommandPoolCreateInfo pool_ci = {.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO}; pool_ci.queueFamilyIndex = vk_dev.compute_qf; pool_ci.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT; VK_CHECK_BOOL(vkCreateCommandPool(vk_dev.dev, &pool_ci, nullptr, &cmd.pool)); - VkCommandBufferAllocateInfo alloc_ci = {VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO}; + VkCommandBufferAllocateInfo alloc_ci = {.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_ALLOCATE_INFO}; alloc_ci.commandPool = cmd.pool; alloc_ci.level = VK_COMMAND_BUFFER_LEVEL_PRIMARY; alloc_ci.commandBufferCount = CMD_RING_SIZE; @@ -529,8 +529,8 @@ namespace vk { * @return Expected plane count, or 0 if unknown. */ int query_modifier_plane_count(VkFormat format, uint64_t modifier) { - VkDrmFormatModifierPropertiesListEXT mod_list = {VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT}; - VkFormatProperties2 fmt_props2 = {VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2}; + VkDrmFormatModifierPropertiesListEXT mod_list = {.sType = VK_STRUCTURE_TYPE_DRM_FORMAT_MODIFIER_PROPERTIES_LIST_EXT}; + VkFormatProperties2 fmt_props2 = {.sType = VK_STRUCTURE_TYPE_FORMAT_PROPERTIES_2}; fmt_props2.pNext = &mod_list; vkGetPhysicalDeviceFormatProperties2(vk_dev.phys_dev, format, &fmt_props2); std::vector mod_props(mod_list.drmFormatModifierCount); @@ -553,18 +553,18 @@ namespace vk { } // Query memory requirements for this DMA-BUF - VkMemoryFdPropertiesKHR fd_props = {VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR}; + VkMemoryFdPropertiesKHR fd_props = {.sType = VK_STRUCTURE_TYPE_MEMORY_FD_PROPERTIES_KHR}; if (vk_dev.getMemoryFdProperties) { vk_dev.getMemoryFdProperties(vk_dev.dev, VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT, fd, &fd_props); } // Create VkImage for the DMA-BUF - VkExternalMemoryImageCreateInfo ext_ci = {VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO}; + VkExternalMemoryImageCreateInfo ext_ci = {.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO}; ext_ci.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT; std::array drm_layouts = {}; VkImageDrmFormatModifierExplicitCreateInfoEXT drm_ci = { - VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT + .sType = VK_STRUCTURE_TYPE_IMAGE_DRM_FORMAT_MODIFIER_EXPLICIT_CREATE_INFO_EXT, }; VkImageTiling tiling; @@ -594,7 +594,7 @@ namespace vk { tiling = VK_IMAGE_TILING_LINEAR; } - VkImageCreateInfo img_ci = {VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO}; + VkImageCreateInfo img_ci = {.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO}; img_ci.pNext = &ext_ci; img_ci.imageType = VK_IMAGE_TYPE_2D; img_ci.format = vk_format; @@ -619,11 +619,11 @@ namespace vk { VkMemoryRequirements mem_req; vkGetImageMemoryRequirements(vk_dev.dev, src.image, &mem_req); - VkImportMemoryFdInfoKHR import_fd = {VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR}; + VkImportMemoryFdInfoKHR import_fd = {.sType = VK_STRUCTURE_TYPE_IMPORT_MEMORY_FD_INFO_KHR}; import_fd.handleType = VK_EXTERNAL_MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT; import_fd.fd = fd; // Vulkan takes ownership - VkMemoryAllocateInfo alloc_info = {VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO}; + VkMemoryAllocateInfo alloc_info = {.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO}; alloc_info.pNext = &import_fd; alloc_info.allocationSize = mem_req.size; alloc_info.memoryTypeIndex = find_memory_type( @@ -643,7 +643,7 @@ namespace vk { vkBindImageMemory(vk_dev.dev, src.image, src_mem, 0); // Create image view - VkImageViewCreateInfo view_ci = {VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; + VkImageViewCreateInfo view_ci = {.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; view_ci.image = src.image; view_ci.viewType = VK_IMAGE_VIEW_TYPE_2D; view_ci.format = vk_format; @@ -658,7 +658,7 @@ namespace vk { bool create_cursor_image(int w, int h, const uint8_t *pixels) { destroy_cursor_image(); - VkImageCreateInfo img_ci = {VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO}; + VkImageCreateInfo img_ci = {.sType = VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO}; img_ci.imageType = VK_IMAGE_TYPE_2D; img_ci.format = VK_FORMAT_B8G8R8A8_UNORM; img_ci.extent = {(uint32_t) w, (uint32_t) h, 1}; @@ -672,7 +672,7 @@ namespace vk { VkMemoryRequirements mem_req; vkGetImageMemoryRequirements(vk_dev.dev, cursor.image, &mem_req); - VkMemoryAllocateInfo alloc = {VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO}; + VkMemoryAllocateInfo alloc = {.sType = VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO}; alloc.allocationSize = mem_req.size; alloc.memoryTypeIndex = find_memory_type(mem_req.memoryTypeBits, VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT); VK_CHECK_BOOL(vkAllocateMemory(vk_dev.dev, &alloc, nullptr, &cursor.mem)); @@ -690,7 +690,7 @@ namespace vk { vkUnmapMemory(vk_dev.dev, cursor.mem); } - VkImageViewCreateInfo view_ci = {VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; + VkImageViewCreateInfo view_ci = {.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; view_ci.image = cursor.image; view_ci.viewType = VK_IMAGE_VIEW_TYPE_2D; view_ci.format = VK_FORMAT_B8G8R8A8_UNORM; @@ -734,7 +734,7 @@ namespace vk { if (num_imgs == 1) { // Single multiplane image — create plane views - VkImageViewCreateInfo view_ci = {VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; + VkImageViewCreateInfo view_ci = {.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; view_ci.image = vk_frame->img[0]; view_ci.viewType = VK_IMAGE_VIEW_TYPE_2D; @@ -749,7 +749,7 @@ namespace vk { VK_CHECK_BOOL(vkCreateImageView(vk_dev.dev, &view_ci, nullptr, &target.uv_view)); } else { // Separate images per plane - VkImageViewCreateInfo view_ci = {VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; + VkImageViewCreateInfo view_ci = {.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO}; view_ci.viewType = VK_IMAGE_VIEW_TYPE_2D; view_ci.subresourceRange = {VK_IMAGE_ASPECT_COLOR_BIT, 0, 1, 0, 1}; @@ -792,12 +792,12 @@ namespace vk { auto cmd_buf = cmd.ring[cmd.ring_idx]; cmd.ring_idx = (cmd.ring_idx + 1) % CMD_RING_SIZE; - VkCommandBufferBeginInfo begin_ci = {VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO}; + VkCommandBufferBeginInfo begin_ci = {.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO}; begin_ci.flags = VK_COMMAND_BUFFER_USAGE_ONE_TIME_SUBMIT_BIT; VK_CHECK(vkBeginCommandBuffer(cmd_buf, &begin_ci)); // Transition source image to SHADER_READ_ONLY - VkImageMemoryBarrier src_barrier = {VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER}; + VkImageMemoryBarrier src_barrier = {.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER}; src_barrier.srcAccessMask = 0; src_barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT; src_barrier.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED; @@ -811,7 +811,7 @@ namespace vk { // Transition cursor image if needed if (cursor.needs_transition) { - VkImageMemoryBarrier cursor_barrier = {VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER}; + VkImageMemoryBarrier cursor_barrier = {.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER}; cursor_barrier.srcAccessMask = VK_ACCESS_HOST_WRITE_BIT; cursor_barrier.dstAccessMask = VK_ACCESS_SHADER_READ_BIT; cursor_barrier.oldLayout = VK_IMAGE_LAYOUT_PREINITIALIZED; @@ -828,7 +828,7 @@ namespace vk { std::array dst_barriers = {}; int num_dst_barriers = (num_imgs == 1) ? 1 : 2; for (int i = 0; i < num_dst_barriers; i++) { - dst_barriers[i] = {VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER}; + dst_barriers[i] = {.sType = VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER}; dst_barriers[i].srcAccessMask = target.initialized ? VK_ACCESS_SHADER_READ_BIT : 0; dst_barriers[i].dstAccessMask = VK_ACCESS_SHADER_WRITE_BIT; dst_barriers[i].oldLayout = target.initialized ? VK_IMAGE_LAYOUT_GENERAL : VK_IMAGE_LAYOUT_UNDEFINED; @@ -853,7 +853,7 @@ namespace vk { VK_CHECK(vkEndCommandBuffer(cmd_buf)); // Submit with timeline semaphore signaling for FFmpeg - VkTimelineSemaphoreSubmitInfo timeline_info = {VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO}; + VkTimelineSemaphoreSubmitInfo timeline_info = {.sType = VK_STRUCTURE_TYPE_TIMELINE_SEMAPHORE_SUBMIT_INFO}; std::array wait_sems = {}; std::array signal_sems = {}; std::array wait_vals = {}; @@ -877,7 +877,7 @@ namespace vk { timeline_info.signalSemaphoreValueCount = sem_count; timeline_info.pSignalSemaphoreValues = signal_vals.data(); - VkSubmitInfo submit = {VK_STRUCTURE_TYPE_SUBMIT_INFO}; + VkSubmitInfo submit = {.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO}; submit.pNext = &timeline_info; submit.waitSemaphoreCount = sem_count; submit.pWaitSemaphores = wait_sems.data(); diff --git a/src/platform/linux/wayland.cpp b/src/platform/linux/wayland.cpp index 47055920b..ca17eb070 100644 --- a/src/platform/linux/wayland.cpp +++ b/src/platform/linux/wayland.cpp @@ -117,10 +117,10 @@ namespace wl { monitor_t::monitor_t(wl_output *output): output {output}, wl_listener { - &CLASS_CALL(monitor_t, wl_geometry), - &CLASS_CALL(monitor_t, wl_mode), - &CLASS_CALL(monitor_t, wl_done), - &CLASS_CALL(monitor_t, wl_scale), + .geometry = &CLASS_CALL(monitor_t, wl_geometry), + .mode = &CLASS_CALL(monitor_t, wl_mode), + .done = &CLASS_CALL(monitor_t, wl_done), + .scale = &CLASS_CALL(monitor_t, wl_scale), }, xdg_listener { &CLASS_CALL(monitor_t, xdg_position), diff --git a/src/platform/windows/display_base.cpp b/src/platform/windows/display_base.cpp index b297b90ae..151b8a680 100644 --- a/src/platform/windows/display_base.cpp +++ b/src/platform/windows/display_base.cpp @@ -643,7 +643,7 @@ namespace platf::dxgi { return false; } - D3DKMT_OPENADAPTERFROMLUID d3dkmt_adapter = {adapter}; + D3DKMT_OPENADAPTERFROMLUID d3dkmt_adapter = {.AdapterLuid = adapter}; if (FAILED(d3dkmt_open_adapter(&d3dkmt_adapter))) { BOOST_LOG(error) << "D3DKMTOpenAdapterFromLuid() failed while trying to determine GPU HAGS status"; return false; diff --git a/src/platform/windows/display_vram.cpp b/src/platform/windows/display_vram.cpp index 5eefc3ea8..558c3bfd1 100644 --- a/src/platform/windows/display_vram.cpp +++ b/src/platform/windows/display_vram.cpp @@ -62,13 +62,13 @@ namespace platf::dxgi { static_assert(sizeof(T) % 16 == 0, "Buffer needs to be aligned on a 16-byte alignment"); D3D11_BUFFER_DESC buffer_desc { - sizeof(T), - D3D11_USAGE_IMMUTABLE, - D3D11_BIND_CONSTANT_BUFFER + .ByteWidth = sizeof(T), + .Usage = D3D11_USAGE_IMMUTABLE, + .BindFlags = D3D11_BIND_CONSTANT_BUFFER, }; D3D11_SUBRESOURCE_DATA init_data { - &t + .pSysMem = &t, }; buf_t::pointer buf_p; diff --git a/src/video.cpp b/src/video.cpp index 3bc416385..843a19a0a 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -730,6 +730,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "av1_nvenc"s, + {}, // capabilities }, { {}, // Common options @@ -739,6 +740,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "hevc_nvenc"s, + {}, // capabilities }, { {}, // Common options @@ -748,6 +750,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "h264_nvenc"s, + {}, // capabilities }, PARALLEL_ENCODING | REF_FRAMES_INVALIDATION | YUV444_SUPPORT | ASYNC_TEARDOWN // flags }; @@ -794,6 +797,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "av1_nvenc"s, + {}, // capabilities }, { // Common options @@ -821,6 +825,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "hevc_nvenc"s, + {}, // capabilities }, { { @@ -845,6 +850,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "h264_nvenc"s, + {}, // capabilities }, PARALLEL_ENCODING | YUV444_SUPPORT }; @@ -893,6 +899,7 @@ namespace video { }, {}, // Fallback options "av1_qsv"s, + {}, // capabilities }, { // Common options @@ -928,6 +935,7 @@ namespace video { }}, }, "hevc_qsv"s, + {}, // capabilities }, { // Common options @@ -958,6 +966,7 @@ namespace video { {"low_power"s, 0}, // Some old/low-end Intel GPUs don't support low power encoding }, "h264_qsv"s, + {}, // capabilities }, PARALLEL_ENCODING | CBR_WITH_VBR | RELAXED_COMPLIANCE | NO_RC_BUF_LIMIT | YUV444_SUPPORT }; @@ -1000,6 +1009,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "av1_amf"s, + {}, // capabilities }, { // Common options @@ -1040,6 +1050,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "hevc_amf"s, + {}, // capabilities }, { // Common options @@ -1070,6 +1081,7 @@ namespace video { {"usage"s, 2 /* AMF_VIDEO_ENCODER_USAGE_LOW_LATENCY */}, // Workaround for https://github.com/GPUOpen-LibrariesAndSDKs/AMF/issues/410 }, "h264_amf"s, + {}, // capabilities }, PARALLEL_ENCODING }; @@ -1102,6 +1114,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "av1_mf"s, + {}, // capabilities }, { // Common options for HEVC - Qualcomm MF encoder @@ -1116,6 +1129,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "hevc_mf"s, + {}, // capabilities }, { // Common options for H.264 - Qualcomm MF encoder @@ -1130,6 +1144,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "h264_mf"s, + {}, // capabilities }, PARALLEL_ENCODING | FIXED_GOP_SIZE // MF encoder doesn't support on-demand IDR frames }; @@ -1173,6 +1188,7 @@ namespace video { #else {}, #endif + {}, // capabilities }, { // x265's Info SEI is so long that it causes the IDR picture data to be @@ -1191,6 +1207,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "libx265"s, + {}, // capabilities }, { // Common options @@ -1204,6 +1221,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "libx264"s, + {}, // capabilities }, H264_ONLY | PARALLEL_ENCODING | ALWAYS_REPROBE | YUV444_SUPPORT }; @@ -1237,6 +1255,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "av1_vaapi"s, + {}, // capabilities }, { // Common options @@ -1252,6 +1271,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "hevc_vaapi"s, + {}, // capabilities }, { // Common options @@ -1267,6 +1287,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "h264_vaapi"s, + {}, // capabilities }, // RC buffer size will be set in platform code if supported LIMITED_GOP_SIZE | PARALLEL_ENCODING | NO_RC_BUF_LIMIT @@ -1302,6 +1323,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "av1_vulkan"s, + {}, // capabilities }, { // HEVC @@ -1320,6 +1342,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "hevc_vulkan"s, + {}, // capabilities }, { // H.264 @@ -1338,6 +1361,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "h264_vulkan"s, + {}, // capabilities }, LIMITED_GOP_SIZE | PARALLEL_ENCODING }; @@ -1375,6 +1399,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "av1_videotoolbox"s, + {}, // capabilities }, { // Common options @@ -1391,6 +1416,7 @@ namespace video { {}, // YUV444 HDR-specific options {}, // Fallback options "hevc_videotoolbox"s, + {}, // capabilities }, { // Common options @@ -1414,6 +1440,7 @@ namespace video { {"flags"s, "-low_delay"}, }, "h264_videotoolbox"s, + {}, // capabilities }, PARALLEL_ENCODING }; @@ -2524,6 +2551,8 @@ namespace video { display->offset_y, config.width, config.height, + display->logical_width, + display->logical_height, }, display->env_width, display->env_height, @@ -3053,8 +3082,8 @@ namespace video { encoder.av1.capabilities.set(); // First, test encoder viability - config_t config_max_ref_frames {1920, 1080, 60, 6000, 1000, 1, 1, 1, 0, 0, 0}; - config_t config_autoselect {1920, 1080, 60, 6000, 1000, 1, 0, 1, 0, 0, 0}; + config_t config_max_ref_frames {1920, 1080, 60, 6000, 1000, 1, 1, 1, 0, 0, 0, 0}; + config_t config_autoselect {1920, 1080, 60, 6000, 1000, 1, 0, 1, 0, 0, 0, 0}; // If the encoder isn't supported at all (not even H.264), bail early reset_display(disp, encoder.platform_formats->dev_type, output_name, config_autoselect); @@ -3148,7 +3177,7 @@ namespace video { // Test HDR and YUV444 support { auto test_yuv444 = [&](auto &flag_map, auto video_format) { - const config_t config = {1920, 1080, 60, 6000, 1000, 1, 0, 1, video_format, 0, 1}; + const config_t config = {1920, 1080, 60, 6000, 1000, 1, 0, 1, video_format, 0, 1, 0}; reset_display(disp, encoder.platform_formats->dev_type, output_name, config); if (!disp) { @@ -3168,7 +3197,7 @@ namespace video { }; auto test_yuv420_hdr = [&](auto &flag_map, auto video_format) { - const config_t config = {1920, 1080, 60, 6000, 1000, 1, 0, 3, video_format, 1, 0}; + const config_t config = {1920, 1080, 60, 6000, 1000, 1, 0, 3, video_format, 1, 0, 0}; reset_display(disp, encoder.platform_formats->dev_type, output_name, config); if (!disp) { @@ -3188,7 +3217,7 @@ namespace video { }; auto test_yuv444_hdr = [&](auto &flag_map, auto video_format) { - const config_t config = {1920, 1080, 60, 6000, 1000, 1, 0, 3, video_format, 1, 1}; + const config_t config = {1920, 1080, 60, 6000, 1000, 1, 0, 3, video_format, 1, 1, 0}; reset_display(disp, encoder.platform_formats->dev_type, output_name, config); if (!disp) { diff --git a/tests/unit/test_audio.cpp b/tests/unit/test_audio.cpp index 6c8c2a070..c1f1a32bf 100644 --- a/tests/unit/test_audio.cpp +++ b/tests/unit/test_audio.cpp @@ -34,9 +34,9 @@ INSTANTIATE_TEST_SUITE_P( Configurations, AudioTest, testing::Values( - std::make_tuple("HIGH_STEREO", config_t {5, 2, 0x3, {0}, config_flags(config_t::HIGH_QUALITY)}), - std::make_tuple("SURROUND51", config_t {5, 6, 0x3F, {0}, config_flags()}), - std::make_tuple("SURROUND71", config_t {5, 8, 0x63F, {0}, config_flags()}), + std::make_tuple("HIGH_STEREO", config_t {.packetDuration = 5, .channels = 2, .mask = 0x3, .customStreamParams = {}, .flags = config_flags(config_t::HIGH_QUALITY)}), + std::make_tuple("SURROUND51", config_t {.packetDuration = 5, .channels = 6, .mask = 0x3F, .customStreamParams = {}, .flags = config_flags()}), + std::make_tuple("SURROUND71", config_t {.packetDuration = 5, .channels = 8, .mask = 0x63F, .customStreamParams = {}, .flags = config_flags()}), std::make_tuple("SURROUND51_CUSTOM", config_t {5, 6, 0x3F, {6, 4, 2, {0, 1, 4, 5, 2, 3}}, config_flags(config_t::CUSTOM_SURROUND_PARAMS)}) ), [](const auto &info) { diff --git a/tests/unit/test_http_pairing.cpp b/tests/unit/test_http_pairing.cpp index 708220d3a..353180d67 100644 --- a/tests/unit/test_http_pairing.cpp +++ b/tests/unit/test_http_pairing.cpp @@ -262,7 +262,7 @@ INSTANTIATE_TEST_SUITE_P( /** * null values (phase 1) */ - std::make_tuple(pairing_input {.session = std::make_shared()}, pairing_output {false}), + std::make_tuple(pairing_input {.session = std::make_shared()}, pairing_output {.phase_1_success = false}), /** * null values (phase 4, phase 2 and 3 have no reason to fail since we are running them in order) */