From da6965d979ffe50c1244691c9304d87f3f35158b Mon Sep 17 00:00:00 2001 From: ened Date: Thu, 20 Nov 2025 21:37:38 +0900 Subject: [PATCH] Add detail log --- .../vav2player/app/src/main/cpp/vulkan_renderer.cpp | 11 +++++++++++ .../vavcore/src/Decoder/MediaCodecSurfaceManager.cpp | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/vav2/platforms/android/applications/vav2player/app/src/main/cpp/vulkan_renderer.cpp b/vav2/platforms/android/applications/vav2player/app/src/main/cpp/vulkan_renderer.cpp index 5cbe51d..8d59889 100644 --- a/vav2/platforms/android/applications/vav2player/app/src/main/cpp/vulkan_renderer.cpp +++ b/vav2/platforms/android/applications/vav2player/app/src/main/cpp/vulkan_renderer.cpp @@ -2545,6 +2545,10 @@ bool VulkanVideoRenderer::RenderVulkanImage(VkImage sourceImage, VkSamplerYcbcrC ycbcrConversionInfo.pNext = nullptr; ycbcrConversionInfo.conversion = ycbcrConversion; + LOGI("VALIDATION: Creating ImageView with YCbCr conversion=%p", (void*)ycbcrConversionInfo.conversion); + LOGI("VALIDATION: ycbcrConversionInfo.sType=%d (expected %d)", + ycbcrConversionInfo.sType, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO); + // Create ImageView for NV12 format with YCbCr conversion VkImageViewCreateInfo viewInfo = {}; viewInfo.sType = VK_STRUCTURE_TYPE_IMAGE_VIEW_CREATE_INFO; @@ -2553,6 +2557,7 @@ bool VulkanVideoRenderer::RenderVulkanImage(VkImage sourceImage, VkSamplerYcbcrC viewInfo.viewType = VK_IMAGE_VIEW_TYPE_2D; viewInfo.format = static_cast(vkFormat); + LOGI("VALIDATION: ImageView format=%d (0x%X)", vkFormat, vkFormat); viewInfo.components.r = VK_COMPONENT_SWIZZLE_IDENTITY; viewInfo.components.g = VK_COMPONENT_SWIZZLE_IDENTITY; @@ -2581,9 +2586,15 @@ bool VulkanVideoRenderer::RenderVulkanImage(VkImage sourceImage, VkSamplerYcbcrC samplerYcbcrInfo.pNext = nullptr; samplerYcbcrInfo.conversion = ycbcrConversion; + LOGI("VALIDATION: Setting up sampler with YCbCr conversion=%p", (void*)samplerYcbcrInfo.conversion); + LOGI("VALIDATION: samplerYcbcrInfo.sType=%d (expected %d)", + samplerYcbcrInfo.sType, VK_STRUCTURE_TYPE_SAMPLER_YCBCR_CONVERSION_INFO); + VkSamplerCreateInfo samplerInfo = {}; samplerInfo.sType = VK_STRUCTURE_TYPE_SAMPLER_CREATE_INFO; samplerInfo.pNext = &samplerYcbcrInfo; // Chain YCbCr conversion to sampler + + LOGI("VALIDATION: samplerInfo.pNext=%p (pointing to YCbCr conversion info)", samplerInfo.pNext); samplerInfo.magFilter = VK_FILTER_LINEAR; samplerInfo.minFilter = VK_FILTER_LINEAR; samplerInfo.addressModeU = VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE; diff --git a/vav2/platforms/windows/vavcore/src/Decoder/MediaCodecSurfaceManager.cpp b/vav2/platforms/windows/vavcore/src/Decoder/MediaCodecSurfaceManager.cpp index 2ce5ded..487d2bd 100644 --- a/vav2/platforms/windows/vavcore/src/Decoder/MediaCodecSurfaceManager.cpp +++ b/vav2/platforms/windows/vavcore/src/Decoder/MediaCodecSurfaceManager.cpp @@ -429,10 +429,19 @@ bool MediaCodecSurfaceManager::CreateVulkanImage(void* vk_device, void* vk_insta } LogInfo("VkSamplerYcbcrConversion created successfully"); + LogInfo(" Conversion Handle: " + std::to_string(reinterpret_cast(m_ycbcr_conversion))); LogInfo(" Format: " + std::to_string(vulkan_format)); LogInfo(" YcbcrModel: " + std::to_string(ycbcrConversionCreateInfo.ycbcrModel)); LogInfo(" YcbcrRange: " + std::to_string(ycbcrConversionCreateInfo.ycbcrRange)); + // CRITICAL VALIDATION: Verify conversion handle is not null + if (m_ycbcr_conversion == VK_NULL_HANDLE) { + LogError("CRITICAL: VkSamplerYcbcrConversion is VK_NULL_HANDLE after creation!"); + return false; + } else { + LogInfo("VALIDATION OK: VkSamplerYcbcrConversion handle is valid (non-null)"); + } + // Step 3: Create VkImage with external memory VkExternalMemoryImageCreateInfo external_mem_info = {}; external_mem_info.sType = VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO;