2222#include " VkCodecUtils/VulkanDeviceContext.h"
2323#include " VkCodecUtils/Helpers.h"
2424#include " VkVideoCore/VkVideoCoreProfile.h"
25+ #include " Logger.h"
2526
2627class VulkanVideoCapabilities
2728{
@@ -52,7 +53,7 @@ class VulkanVideoCapabilities
5253 VkResult result = GetVideoCapabilities (vkDevCtx, videoProfile, &videoCapabilities);
5354 assert (result == VK_SUCCESS);
5455 if (result != VK_SUCCESS) {
55- fprintf (stderr, " \n ERROR: Input is not supported. GetVideoCapabilities() result: 0x%x\n " , result);
56+ LOG_ERROR ( " \n ERROR: Input is not supported. GetVideoCapabilities() result: 0x%x\n " , result);
5657 }
5758 return result;
5859 }
@@ -76,7 +77,7 @@ class VulkanVideoCapabilities
7677 VkResult result = GetVideoCapabilities (vkDevCtx, videoProfile, &videoCapabilities);
7778 assert (result == VK_SUCCESS);
7879 if (result != VK_SUCCESS) {
79- fprintf (stderr, " \n ERROR: Input is not supported. GetVideoCapabilities() result: 0x%x\n " , result);
80+ LOG_ERROR ( " \n ERROR: Input is not supported. GetVideoCapabilities() result: 0x%x\n " , result);
8081 }
8182 return result;
8283 }
@@ -118,13 +119,13 @@ class VulkanVideoCapabilities
118119 pictureFormat = supportedOutFormats[0 ];
119120
120121 } else {
121- fprintf (stderr, " \n ERROR : Unsupported decode capability flags." );
122+ LOG_ERROR ( " ERROR : Unsupported decode capability flags." );
122123 return VK_ERROR_VIDEO_PROFILE_FORMAT_NOT_SUPPORTED_KHR;
123124 }
124125
125126 assert (result == VK_SUCCESS);
126127 if (result != VK_SUCCESS) {
127- fprintf (stderr, " \n ERROR : GetVideoFormats() result: 0x%x\n " , result);
128+ LOG_ERROR ( " ERROR : GetVideoFormats() result: 0x%x\n " , result);
128129 }
129130
130131 assert ((referencePicturesFormat != VK_FORMAT_UNDEFINED) && (pictureFormat != VK_FORMAT_UNDEFINED));
@@ -219,24 +220,24 @@ class VulkanVideoCapabilities
219220 }
220221
221222 if (dumpData) {
222- std::cout << " \t\t\t " << ((videoProfile.GetCodecType () == VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR) ? " h264" : " h265" ) << " decode capabilities: " << std::endl;
223+ LOG_S_DEBUG << " \t\t\t " << ((videoProfile.GetCodecType () == VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR) ? " h264" : " h265" ) << " decode capabilities: " << std::endl;
223224
224225 if (pVideoCapabilities->flags & VK_VIDEO_CAPABILITY_SEPARATE_REFERENCE_IMAGES_BIT_KHR) {
225- std::cout << " \t\t\t " << " Use separate reference images" << std::endl;
226+ LOG_S_DEBUG << " \t\t\t " << " Use separate reference images" << std::endl;
226227 }
227228
228- std::cout << " \t\t\t " << " minBitstreamBufferOffsetAlignment: " << pVideoCapabilities->minBitstreamBufferOffsetAlignment << std::endl;
229- std::cout << " \t\t\t " << " minBitstreamBufferSizeAlignment: " << pVideoCapabilities->minBitstreamBufferSizeAlignment << std::endl;
230- std::cout << " \t\t\t " << " pictureAccessGranularity: " << pVideoCapabilities->pictureAccessGranularity .width << " x " << pVideoCapabilities->pictureAccessGranularity .height << std::endl;
231- std::cout << " \t\t\t " << " minCodedExtent: " << pVideoCapabilities->minCodedExtent .width << " x " << pVideoCapabilities->minCodedExtent .height << std::endl;
232- std::cout << " \t\t\t " << " maxCodedExtent: " << pVideoCapabilities->maxCodedExtent .width << " x " << pVideoCapabilities->maxCodedExtent .height << std::endl;
233- std::cout << " \t\t\t " << " maxDpbSlots: " << pVideoCapabilities->maxDpbSlots << std::endl;
234- std::cout << " \t\t\t " << " maxActiveReferencePictures: " << pVideoCapabilities->maxActiveReferencePictures << std::endl;
229+ LOG_S_DEBUG << " \t\t\t " << " minBitstreamBufferOffsetAlignment: " << pVideoCapabilities->minBitstreamBufferOffsetAlignment << std::endl;
230+ LOG_S_DEBUG << " \t\t\t " << " minBitstreamBufferSizeAlignment: " << pVideoCapabilities->minBitstreamBufferSizeAlignment << std::endl;
231+ LOG_S_DEBUG << " \t\t\t " << " pictureAccessGranularity: " << pVideoCapabilities->pictureAccessGranularity .width << " x " << pVideoCapabilities->pictureAccessGranularity .height << std::endl;
232+ LOG_S_DEBUG << " \t\t\t " << " minCodedExtent: " << pVideoCapabilities->minCodedExtent .width << " x " << pVideoCapabilities->minCodedExtent .height << std::endl;
233+ LOG_S_DEBUG << " \t\t\t " << " maxCodedExtent: " << pVideoCapabilities->maxCodedExtent .width << " x " << pVideoCapabilities->maxCodedExtent .height << std::endl;
234+ LOG_S_DEBUG << " \t\t\t " << " maxDpbSlots: " << pVideoCapabilities->maxDpbSlots << std::endl;
235+ LOG_S_DEBUG << " \t\t\t " << " maxActiveReferencePictures: " << pVideoCapabilities->maxActiveReferencePictures << std::endl;
235236
236237 if (videoProfile.GetCodecType () == VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR) {
237238 const VkVideoDecodeH264CapabilitiesKHR* pH264DecCapabilities = (VkVideoDecodeH264CapabilitiesKHR*)pVideoDecodeCapabilities->pNext ;
238- std::cout << " \t\t\t " << " maxLevelIdc: " << pH264DecCapabilities->maxLevelIdc << std::endl;
239- std::cout << " \t\t\t " << " fieldOffsetGranularity: " << pH264DecCapabilities->fieldOffsetGranularity .x << " x " << pH264DecCapabilities->fieldOffsetGranularity .y << std::endl;
239+ LOG_S_DEBUG << " \t\t\t " << " maxLevelIdc: " << pH264DecCapabilities->maxLevelIdc << std::endl;
240+ LOG_S_DEBUG << " \t\t\t " << " fieldOffsetGranularity: " << pH264DecCapabilities->fieldOffsetGranularity .x << " x " << pH264DecCapabilities->fieldOffsetGranularity .y << std::endl;
240241
241242 if (strncmp (pVideoCapabilities->stdHeaderVersion .extensionName ,
242243 VK_STD_VULKAN_VIDEO_CODEC_H264_DECODE_EXTENSION_NAME,
@@ -247,7 +248,7 @@ class VulkanVideoCapabilities
247248 }
248249 } else if (videoProfile.GetCodecType () == VK_VIDEO_CODEC_OPERATION_DECODE_H265_BIT_KHR) {
249250 const VkVideoDecodeH265CapabilitiesKHR* pH265DecCapabilities = (VkVideoDecodeH265CapabilitiesKHR*)pVideoDecodeCapabilities->pNext ;
250- std::cout << " \t\t\t " << " maxLevelIdc: " << pH265DecCapabilities->maxLevelIdc << std::endl;
251+ LOG_S_DEBUG << " \t\t\t " << " maxLevelIdc: " << pH265DecCapabilities->maxLevelIdc << std::endl;
251252 if (strncmp (pVideoCapabilities->stdHeaderVersion .extensionName ,
252253 VK_STD_VULKAN_VIDEO_CODEC_H265_DECODE_EXTENSION_NAME,
253254 sizeof (pVideoCapabilities->stdHeaderVersion .extensionName ) - 1U ) ||
@@ -301,9 +302,9 @@ class VulkanVideoCapabilities
301302 result = vkDevCtx->GetPhysicalDeviceVideoFormatPropertiesKHR (vkDevCtx->getPhysicalDevice (), &videoFormatInfo, &supportedFormatCount, pSupportedFormats);
302303 assert (result == VK_SUCCESS);
303304 if (dumpData) {
304- std::cout << " \t\t\t " << ((videoProfile.GetCodecType () == VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR) ? " h264" : " h265" ) << " decode formats: " << std::endl;
305+ LOG_S_DEBUG << " \t\t\t " << ((videoProfile.GetCodecType () == VK_VIDEO_CODEC_OPERATION_DECODE_H264_BIT_KHR) ? " h264" : " h265" ) << " decode formats: " << std::endl;
305306 for (uint32_t fmt = 0 ; fmt < supportedFormatCount; fmt++) {
306- std::cout << " \t\t\t " << fmt << " : " << std::hex << pSupportedFormats[fmt].format << std::dec << std::endl;
307+ LOG_S_DEBUG << " \t\t\t " << fmt << " : " << std::hex << pSupportedFormats[fmt].format << std::dec << std::endl;
307308 }
308309 }
309310
0 commit comments