Skip to content

Conversation

@dabrain34
Copy link
Contributor

@dabrain34 dabrain34 commented Jun 19, 2025

Use lint action from
https://github.com/marketplace/actions/c-c-linter
which allows to run clang-format on cpp files.

@dabrain34 dabrain34 force-pushed the dab_add_lint branch 4 times, most recently from d5aab0e to 6686eb8 Compare June 19, 2025 13:47
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v16.0.6

Only 1 out of 19 clang-format concerns fit within this pull request's diff.

Click here for the full clang-format patch
diff --git a/vk_video_decoder/demos/vk-video-dec/Main.cpp b/vk_video_decoder/demos/vk-video-dec/Main.cpp
index 7c934b1..4f40f52 100644
--- a/vk_video_decoder/demos/vk-video-dec/Main.cpp
+++ b/vk_video_decoder/demos/vk-video-dec/Main.cpp
@@ -31,3 +31 @@
-int main(int argc, const char **argv)
-{
-
+int main(int argc, const char** argv) {
@@ -38,7 +36,3 @@ int main(int argc, const char **argv)
-    VkResult result = VideoStreamDemuxer::Create(decoderConfig.videoFileName.c_str(),
-                                        decoderConfig.forceParserType,
-                                        decoderConfig.enableStreamDemuxing,
-                                        decoderConfig.initialWidth,
-                                        decoderConfig.initialHeight,
-                                        decoderConfig.initialBitdepth,
-                                        videoStreamDemuxer);
+    VkResult result = VideoStreamDemuxer::Create(decoderConfig.videoFileName.c_str(), decoderConfig.forceParserType,
+                                                 decoderConfig.enableStreamDemuxing, decoderConfig.initialWidth,
+                                                 decoderConfig.initialHeight, decoderConfig.initialBitdepth, videoStreamDemuxer);
@@ -50,3 +44,3 @@ int main(int argc, const char **argv)
-    VkVideoCodecOperationFlagsKHR videoCodecOperation = (decoderConfig.forceParserType != VK_VIDEO_CODEC_OPERATION_NONE_KHR) ?
-                                                                    decoderConfig.forceParserType :
-                                                                    videoStreamDemuxer->GetVideoCodec();
+    VkVideoCodecOperationFlagsKHR videoCodecOperation = (decoderConfig.forceParserType != VK_VIDEO_CODEC_OPERATION_NONE_KHR)
+                                                            ? decoderConfig.forceParserType
+                                                            : videoStreamDemuxer->GetVideoCodec();
@@ -55,8 +49,3 @@ int main(int argc, const char **argv)
-    result = vkDevCtxt.InitVulkanDecoderDevice(decoderConfig.appName.c_str(),
-                                                        VK_NULL_HANDLE,
-                                                        videoCodecOperation,
-                                                        !decoderConfig.noPresent,
-                                                        decoderConfig.directMode,
-                                                        decoderConfig.validate,
-                                                        decoderConfig.validateVerbose,
-                                                        decoderConfig.verbose);
+    result = vkDevCtxt.InitVulkanDecoderDevice(decoderConfig.appName.c_str(), VK_NULL_HANDLE, videoCodecOperation,
+                                               !decoderConfig.noPresent, decoderConfig.directMode, decoderConfig.validate,
+                                               decoderConfig.validateVerbose, decoderConfig.verbose);
@@ -69,4 +58,3 @@ int main(int argc, const char **argv)
-    const int32_t numDecodeQueues = ((decoderConfig.queueId != 0) ||
-                                     (decoderConfig.enableHwLoadBalancing != 0)) ?
-                                     -1 : // all available HW decoders
-                                      1;  // only one HW decoder instance
+    const int32_t numDecodeQueues =
+        ((decoderConfig.queueId != 0) || (decoderConfig.enableHwLoadBalancing != 0)) ? -1 :  // all available HW decoders
+            1;                                                                               // only one HW decoder instance
@@ -86 +73,0 @@ int main(int argc, const char **argv)
-
@@ -88,2 +75 @@ int main(int argc, const char **argv)
-        const Shell::Configuration configuration(decoderConfig.appName.c_str(),
-                                                 decoderConfig.backBufferCount,
+        const Shell::Configuration configuration(decoderConfig.appName.c_str(), decoderConfig.backBufferCount,
@@ -98,9 +84,4 @@ int main(int argc, const char **argv)
-        result = vkDevCtxt.InitPhysicalDevice(decoderConfig.deviceId, decoderConfig.GetDeviceUUID(),
-                                              (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_TRANSFER_BIT |
-                                              requestVideoComputeQueueMask |
-                                              requestVideoDecodeQueueMask),
-                                              displayShell,
-                                              requestVideoDecodeQueueMask,
-                                              videoCodecOperation,
-                                              0,
-                                              VK_VIDEO_CODEC_OPERATION_NONE_KHR);
+        result = vkDevCtxt.InitPhysicalDevice(
+            decoderConfig.deviceId, decoderConfig.GetDeviceUUID(),
+            (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_TRANSFER_BIT | requestVideoComputeQueueMask | requestVideoDecodeQueueMask),
+            displayShell, requestVideoDecodeQueueMask, videoCodecOperation, 0, VK_VIDEO_CODEC_OPERATION_NONE_KHR);
@@ -108 +88,0 @@ int main(int argc, const char **argv)
-r@@ -112,9 +92,8 @@ int main(int argc, const char **argv)
-uteQueueMask | requestVideoDecodeQueueMask),
+            displayShell, requestVi-deoDecodeQueueMask, videoCodecOperation, 0, VK_VIDEO_CODEC_OPERATION_NONE_KHR);
@@ -108 +8-8-,0 @@ int main(int argc, const char **argv)
-r@@ -112,9 +92,8 @@ int main(int argc,- const char **argv)
-uteQueueMask | requestVideoDecodeQueueMask),
+            displa-yShell, requestVi-deoDecodeQueueMask, videoCodecOperation, 0, VK_VIDEO_CODEC_OP-ERATION_NONE_KHR);
@@ -108 +8-8-,0 @@ int main(int argc, const char **argv)
-r@@ -112,9- +92,8 @@ int main(int argc,- const char **argv)
-uteQueueMask | requestVideoDecodeQueu-eMask),
+            displa-yShell, requestVi-deoDecodeQueueMask, videoCodecOperation,+        assert(displayShell->PhysDeviceCanPresent(vkDevCtxt.getPhysicalDevice(), vkDevCtxt.GetPresentQueueFamilyIdx()));
+
+        vkDevCtxt.CreateVulkanDevice(numDecodeQueues,                   // numDecodeQueues
+                                     0,                                 // num encode queues
+                                     videoCodecOperation,               // videoCodecs
+                                     false,                             // createTransferQueue
+                                     true,                              // createGraphicsQueue
+                                     true,                              // createDisplayQueue
@@ -122 +101 @@ int main(int argc, const char **argv)
-gv)
-r@@ -112,9- +92,8 @@ int main(int a+        );
@@ -133,6 +112,3 @@ int main(int argc, const char **argv)
-                            videoCodecOperation,               // videoCodecs
+       -                              false,                             // cre-ateTransferQueue
+                                     true,                   -           // createGraphicsQueue
+                          -           true,                              // createDisplayQueue
@@ -12-2 +101 @@ int main(int argc, const char **argv)
-gv)
-r@@ -1+            result =
+                VkVideoFrameOutput::Create(decoderConfig.outputFileName.c_str(), decoderConfig.outputy4m,
+                                           decoderConfig.outputcrcPerFrame, crcOutputFile, decoderConfig.crcInitValue, frameToFile);
@@ -155 +130,0 @@ int main(int argc, const char **argv)
-e@@ -157,5 +132,2 @@ int main(int argc, const char **argv)
-                           decoderConfig.outputcrcPerFrame, crcOutputFile, dec-oderConfig.crcInitValue, frameToFile);
@@ -155 +130,0 @@ int main(int argc, co-nst char **argv)
-e@@ -157,5 +132,2 @@ int main(int argc, const char **argv)
--                           decoderConfig.outputcrcPerFr-ame, crcOutputFile, dec-oderConfig.crcInitValue, frameToFile);
@@ -155 +130,+                                              (VK_QUEUE_TRANSFER_BIT | requestVideoDecodeQueueMask | requestVideoComputeQueueMask),
+                                              nullptr, requestVideoDecodeQueueMask);
@@ -163 +134,0 @@ int main(int argc, const char **argv)
-*@@ -168,12 +139,12 @@ int main(int argc, const char **argv)
-C-onfig.outputcrcPerFr-ame, crcOutputFile, dec-oderConfig.crcInitValue, frameToFile);-
@@ -155 +130,+                                              (VK_QUEUE_TRANSFER_BIT |- requestVideoDecodeQueueMask | requestVideoComputeQueueMask),
+                    -                          nullptr, requestVideoDecodeQueueMask);
@@ -163 +134,0 @@ int main(int argc, const char -**argv)
-*@@ -168,12 +139,12 @@ int main(int argc, const char **argv)
-C-onfig.outputcrcPerFr-ame, crcOutputFile, dec-oderCo-nfig.crcInitValue, frameToFile);-
@@ -155 +130,+                                              (VK_QUEUE_TRANSFER-_BIT |- requestVideoDecodeQueueMask | requestVideoComputeQueueMask),
+                    -                          nullptr, requestVideoDe-codeQueueMask);
@@ -163 +134,0 @@ int main(int argc, const char -**argv)
-*@-@ -168,12 +139,12 @@ int main(int argc, const char **argv)
-C-onfig.outputc-rcPerFr-ame, crcOutputFile, dec-oderCo-nfig.crcInitValue, frameToFile);-
@@ -155 +130,+                 -                             (VK_QUEUE_TRANSFER-_+        result = vkDevCtxt.CreateVulkanDevice(
+            numDecodeQueues,      // numDecodeQueues
+            0,                    // num encode queues
+            videoCodecOperation,  // videoCodecs
+            // If no graphics or compute queue is requested, only video queues
+            // will be created. Not all implementations support transfer on video queues,
+            // so request a separate transfer queue for such implementations.
+            ((vkDevCtxt.GetVideoDecodeQueueFlag() & VK_QUEUE_TRANSFER_BIT) == 0),  //  createTransferQueue
+            false,                                                                 // createGraphicsQueue
+            false,                                                                 // createDisplayQueue
+            requestVideoComputeQueueMask != 0                                      // createComputeQueue
+        );
@@ -181 +151,0 @@ int main(int argc, const char **argv)
- @@ -196,6 +166,3 @@ int main(int argc, const char **argv)
- or compute queue is requested, only video queues
+            // will be created. Not- all implementations support transfer on video queues,
+            // -so request a separate transfer queue for such implementations.
+            ((v-kDevCtxt.GetVideoDecodeQueueFlag() & VK_QUEUE_TRANSFER_BIT) =-= 0),  //  createTransferQueue
+            false,                        -                                         // createGraphicsQu+            result =
+                VkVideoFrameOutput::Create(decoderConfig.outputFileName.c_str(), decoderConfig.outputy4m,
+                                           decoderConfig.outputcrcPerFrame, crcOutputFile, decoderConfig.crcInitValue, frameToFile);
@@ -218 +185 @@ int main(int argc, const char **argv)
-ER_BIT) =-= 0),  //  createTransferQu+        printf("ccououou");

Have any feedback or feature suggestions? Share it here.

@github-actions github-actions bot dismissed their stale review June 19, 2025 14:08

outdated suggestion

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v16.0.6

Only 1 out of 19 clang-format concerns fit within this pull request's diff.

Click here for the full clang-format patch
diff --git a/vk_video_decoder/demos/vk-video-dec/Main.cpp b/vk_video_decoder/demos/vk-video-dec/Main.cpp
index 42ba753..e439541 100644
--- a/vk_video_decoder/demos/vk-video-dec/Main.cpp
+++ b/vk_video_decoder/demos/vk-video-dec/Main.cpp
@@ -31,3 +31 @@
-int main(int argc, const char **argv)
-{
-
+int main(int argc, const char** argv) {
@@ -38,7 +36,3 @@ int main(int argc, const char **argv)
-    VkResult result = VideoStreamDemuxer::Create(decoderConfig.videoFileName.c_str(),
-                                        decoderConfig.forceParserType,
-                                        decoderConfig.enableStreamDemuxing,
-                                        decoderConfig.initialWidth,
-                                        decoderConfig.initialHeight,
-                                        decoderConfig.initialBitdepth,
-                                        videoStreamDemuxer);
+    VkResult result = VideoStreamDemuxer::Create(decoderConfig.videoFileName.c_str(), decoderConfig.forceParserType,
+                                                 decoderConfig.enableStreamDemuxing, decoderConfig.initialWidth,
+                                                 decoderConfig.initialHeight, decoderConfig.initialBitdepth, videoStreamDemuxer);
@@ -50,3 +44,3 @@ int main(int argc, const char **argv)
-    VkVideoCodecOperationFlagsKHR videoCodecOperation = (decoderConfig.forceParserType != VK_VIDEO_CODEC_OPERATION_NONE_KHR) ?
-                                                                    decoderConfig.forceParserType :
-                                                                    videoStreamDemuxer->GetVideoCodec();
+    VkVideoCodecOperationFlagsKHR videoCodecOperation = (decoderConfig.forceParserType != VK_VIDEO_CODEC_OPERATION_NONE_KHR)
+                                                            ? decoderConfig.forceParserType
+                                                            : videoStreamDemuxer->GetVideoCodec();
@@ -55,8 +49,3 @@ int main(int argc, const char **argv)
-    result = vkDevCtxt.InitVulkanDecoderDevice(decoderConfig.appName.c_str(),
-                                                        VK_NULL_HANDLE,
-                                                        videoCodecOperation,
-                                                        !decoderConfig.noPresent,
-                                                        decoderConfig.directMode,
-                                                        decoderConfig.validate,
-                                                        decoderConfig.validateVerbose,
-                                                        decoderConfig.verbose);
+    result = vkDevCtxt.InitVulkanDecoderDevice(decoderConfig.appName.c_str(), VK_NULL_HANDLE, videoCodecOperation,
+                                               !decoderConfig.noPresent, decoderConfig.directMode, decoderConfig.validate,
+                                               decoderConfig.validateVerbose, decoderConfig.verbose);
@@ -69,4 +58,3 @@ int main(int argc, const char **argv)
-    const int32_t numDecodeQueues = ((decoderConfig.queueId != 0) ||
-                                     (decoderConfig.enableHwLoadBalancing != 0)) ?
-                                     -1 : // all available HW decoders
-                                      1;  // only one HW decoder instance
+    const int32_t numDecodeQueues =
+        ((decoderConfig.queueId != 0) || (decoderConfig.enableHwLoadBalancing != 0)) ? -1 :  // all available HW decoders
+            1;                                                                               // only one HW decoder instance
@@ -86 +73,0 @@ int main(int argc, const char **argv)
-
@@ -88,2 +75 @@ int main(int argc, const char **argv)
-        const Shell::Configuration configuration(decoderConfig.appName.c_str(),
-                                                 decoderConfig.backBufferCount,
+        const Shell::Configuration configuration(decoderConfig.appName.c_str(), decoderConfig.backBufferCount,
@@ -98,9 +84,4 @@ int main(int argc, const char **argv)
-        result = vkDevCtxt.InitPhysicalDevice(decoderConfig.deviceId, decoderConfig.GetDeviceUUID(),
-                                              (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_TRANSFER_BIT |
-                                              requestVideoComputeQueueMask |
-                                              requestVideoDecodeQueueMask),
-                                              displayShell,
-                                              requestVideoDecodeQueueMask,
-                                              videoCodecOperation,
-                                              0,
-                                              VK_VIDEO_CODEC_OPERATION_NONE_KHR);
+        result = vkDevCtxt.InitPhysicalDevice(
+            decoderConfig.deviceId, decoderConfig.GetDeviceUUID(),
+            (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_TRANSFER_BIT | requestVideoComputeQueueMask | requestVideoDecodeQueueMask),
+            displayShell, requestVideoDecodeQueueMask, videoCodecOperation, 0, VK_VIDEO_CODEC_OPERATION_NONE_KHR);
@@ -108 +88,0 @@ int main(int argc, const char **argv)
-e@@ -112,9 +92,8 @@ int main(int argc, const char **argv)
-puteQueueMask | requestVideoDecodeQueueMask),
+            displayShell, requestV-ideoDecodeQueueMask, videoCodecOperation, 0, VK_VIDEO_CODEC_OPERATION_NONE_KHR);
@@ -108 +-8-8,0 @@ int main(int argc, const char **argv)
-e@@ -112,9 +92,8 @@ int main(int argc-, const char **argv)
-puteQueueMask | requestVideoDecodeQueueMask),
+            disp-layShell, requestV-ideoDecodeQueueMask, videoCodecOperation, 0, VK_VIDEO_CODEC_-OPERATION_NONE_KHR);
@@ -108 +-8-8,0 @@ int main(int argc, const char **argv)
-e@@ -112-,9 +92,8 @@ int main(int argc-, const char **argv)
-puteQueueMask | requestVideoDecodeQ-ueueMask),
+            disp-layShell, requestV-ideoDecodeQueueMask, videoCodecOperati+        assert(displayShell->PhysDeviceCanPresent(vkDevCtxt.getPhysicalDevice(), vkDevCtxt.GetPresentQueueFamilyIdx()));
+
+        vkDevCtxt.CreateVulkanDevice(numDecodeQueues,                   // numDecodeQueues
+                                     0,                                 // num encode queues
+                                     videoCodecOperation,               // videoCodecs
+                                     false,                             // createTransferQueue
+                                     true,                              // createGraphicsQueue
+                                     true,                              // createDisplayQueue
@@ -122 +101 @@ int main(int argc, const char **argv)
-*argv)
-e@@ -112-,9 +92,8 @@ int main(in+        );
@@ -133,6 +112,3 @@ int main(int argc, const char **argv)
-                             videoCodecOperation,               // videoCodecs
+      -                               false,                             // cr-eateTransferQueue
+                                     true,                  -            // createGraphicsQueue
+                         -            true,                              // createDisplayQueue
@@ -1-22 +101 @@ int main(int argc, const char **argv)
-*argv)
-e@+            result =
+                VkVideoFrameOutput::Create(decoderConfig.outputFileName.c_str(), decoderConfig.outputy4m,
+                                           decoderConfig.outputcrcPerFrame, crcOutputFile, decoderConfig.crcInitValue, frameToFile);
@@ -155 +130,0 @@ int main(int argc, const char **argv)
-d@@ -157,5 +132,2 @@ int main(int argc, const char **argv)
-                            decoderConfig.outputcrcPerFrame, crcOutputFile, de-coderConfig.crcInitValue, frameToFile);
@@ -155 +130,0 @@ int main(int argc, c-onst char **argv)
-d@@ -157,5 +132,2 @@ int main(int argc, const char **argv)
--                            decoderConfig.outputcrcPer-Frame, crcOutputFile, de-coderConfig.crcInitValue, frameToFile);
@@ -155 +13+                                              (VK_QUEUE_TRANSFER_BIT | requestVideoDecodeQueueMask | requestVideoComputeQueueMask),
+                                              nullptr, requestVideoDecodeQueueMask);
@@ -163 +134,0 @@ int main(int argc, const char **argv)
-r@@ -168,12 +139,12 @@ int main(int argc, const char **argv)
-d-erConfig.outputcrcPer-Frame, crcOutputFile, de-coderConfig.crcInitValue, frameToFil-e);
@@ -155 +13+                                              (VK_QUEUE_TRANSFER_BIT -| requestVideoDecodeQueueMask | requestVideoComputeQueueMask),
+                   -                           nullptr, requestVideoDecodeQueueMask);
@@ -163 +134,0 @@ int main(int argc, const char- **argv)
-r@@ -168,12 +139,12 @@ int main(int argc, const char **argv)
-d-erConfig.outputcrcPer-Frame, crcOutputFile, de-cod-erConfig.crcInitValue, frameToFil-e);
@@ -155 +13+                                              (VK_QUEUE_TRANSF-ER_BIT -| requestVideoDecodeQueueMask | requestVideoComputeQueueMask),
+                   -                           nullptr, requestVideo-DecodeQueueMask);
@@ -163 +134,0 @@ int main(int argc, const char- **argv)
--r@@ -168,12 +139,12 @@ int main(int argc, const char **argv)
-d-erConfig.ou-tputcrcPer-Frame, crcOutputFile, de-cod-erConfig.crcInitValue, frameToFil-e);
@@ -155 +13+              -                                (VK_QUEUE_TRANSF-+        result = vkDevCtxt.CreateVulkanDevice(
+            numDecodeQueues,      // numDecodeQueues
+            0,                    // num encode queues
+            videoCodecOperation,  // videoCodecs
+            // If no graphics or compute queue is requested, only video queues
+            // will be created. Not all implementations support transfer on video queues,
+            // so request a separate transfer queue for such implementations.
+            ((vkDevCtxt.GetVideoDecodeQueueFlag() & VK_QUEUE_TRANSFER_BIT) == 0),  //  createTransferQueue
+            false,                                                                 // createGraphicsQueue
+            false,                                                                 // createDisplayQueue
+            requestVideoComputeQueueMask != 0                                      // createComputeQueue
+        );
@@ -181 +151,0 @@ int main(int argc, const char **argv)
-k@@ -196,6 +166,3 @@ int main(int argc, const char **argv)
-            result = VkVideoFrameOutput::Create(decoderConfig.outputFileName.c_str(),
-                                              decoderConfig.outputy4m,
-                                              decoderConfig.outputcrcPerFrame,
-                                              crcOutputFile,
-                                              decoderConfig.crcInitValue,
-                                              frameToFile);
+            result =
+                VkVideoFrameOutput::Create(decoderConfig.outputFileName.c_str(), decoderConfig.outputy4m,
+                                           decoderConfig.outputcrcPerFrame, crcOutputFile, decoderConfig.crcInitValue, frameToFile);
@@ -218 +185 @@ int main(int argc, const char **argv)
-        printf    ( "ccououou"  )  ;
+        printf("ccououou");

Have any feedback or feature suggestions? Share it here.

@github-actions github-actions bot dismissed their stale review June 19, 2025 14:11

outdated suggestion

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v16.0.6

Click here for the full clang-format patch
diff --git a/vk_video_decoder/demos/vk-video-dec/Main.cpp b/vk_video_decoder/demos/vk-video-dec/Main.cpp
index 8d09d1c..e439541 100644
--- a/vk_video_decoder/demos/vk-video-dec/Main.cpp
+++ b/vk_video_decoder/demos/vk-video-dec/Main.cpp
@@ -31,3 +31 @@
-int main(int argc, const char **argv)
-{
-
+int main(int argc, const char** argv) {
@@ -38,7 +36,3 @@ int main(int argc, const char **argv)
-    VkResult result = VideoStreamDemuxer::Create(decoderConfig.videoFileName.c_str(),
-                                        decoderConfig.forceParserType,
-                                        decoderConfig.enableStreamDemuxing,
-                                        decoderConfig.initialWidth,
-                                        decoderConfig.initialHeight,
-                                        decoderConfig.initialBitdepth,
-                                        videoStreamDemuxer);
+    VkResult result = VideoStreamDemuxer::Create(decoderConfig.videoFileName.c_str(), decoderConfig.forceParserType,
+                                                 decoderConfig.enableStreamDemuxing, decoderConfig.initialWidth,
+                                                 decoderConfig.initialHeight, decoderConfig.initialBitdepth, videoStreamDemuxer);
@@ -50,3 +44,3 @@ int main(int argc, const char **argv)
-    VkVideoCodecOperationFlagsKHR videoCodecOperation = (decoderConfig.forceParserType != VK_VIDEO_CODEC_OPERATION_NONE_KHR) ?
-                                                                    decoderConfig.forceParserType :
-                                                                    videoStreamDemuxer->GetVideoCodec();
+    VkVideoCodecOperationFlagsKHR videoCodecOperation = (decoderConfig.forceParserType != VK_VIDEO_CODEC_OPERATION_NONE_KHR)
+                                                            ? decoderConfig.forceParserType
+                                                            : videoStreamDemuxer->GetVideoCodec();
@@ -55,8 +49,3 @@ int main(int argc, const char **argv)
-    result = vkDevCtxt.InitVulkanDecoderDevice(decoderConfig.appName.c_str(),
-                                                        VK_NULL_HANDLE,
-                                                        videoCodecOperation,
-                                                        !decoderConfig.noPresent,
-                                                        decoderConfig.directMode,
-                                                        decoderConfig.validate,
-                                                        decoderConfig.validateVerbose,
-                                                        decoderConfig.verbose);
+    result = vkDevCtxt.InitVulkanDecoderDevice(decoderConfig.appName.c_str(), VK_NULL_HANDLE, videoCodecOperation,
+                                               !decoderConfig.noPresent, decoderConfig.directMode, decoderConfig.validate,
+                                               decoderConfig.validateVerbose, decoderConfig.verbose);
@@ -69,4 +58,3 @@ int main(int argc, const char **argv)
-    const int32_t numDecodeQueues = ((decoderConfig.queueId != 0) ||
-                                     (decoderConfig.enableHwLoadBalancing != 0)) ?
-                                     -1 : // all available HW decoders
-                                      1;  // only one HW decoder instance
+    const int32_t numDecodeQueues =
+        ((decoderConfig.queueId != 0) || (decoderConfig.enableHwLoadBalancing != 0)) ? -1 :  // all available HW decoders
+            1;                                                                               // only one HW decoder instance
@@ -86 +73,0 @@ int main(int argc, const char **argv)
-
@@ -88,2 +75 @@ int main(int argc, const char **argv)
-        const Shell::Configuration configuration(decoderConfig.appName.c_str(),
-                                                 decoderConfig.backBufferCount,
+        const Shell::Configuration configuration(decoderConfig.appName.c_str(), decoderConfig.backBufferCount,
@@ -98,9 +84,4 @@ int main(int argc, const char **argv)
-        result = vkDevCtxt.InitPhysicalDevice(decoderConfig.deviceId, decoderConfig.GetDeviceUUID(),
-                                              (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_TRANSFER_BIT |
-                                              requestVideoComputeQueueMask |
-                                              requestVideoDecodeQueueMask),
-                                              displayShell,
-                                              requestVideoDecodeQueueMask,
-                                              videoCodecOperation,
-                                              0,
-                                              VK_VIDEO_CODEC_OPERATION_NONE_KHR);
+        result = vkDevCtxt.InitPhysicalDevice(
+            decoderConfig.deviceId, decoderConfig.GetDeviceUUID(),
+            (VK_QUEUE_GRAPHICS_BIT | VK_QUEUE_TRANSFER_BIT | requestVideoComputeQueueMask | requestVideoDecodeQueueMask),
+            displayShell, requestVideoDecodeQueueMask, videoCodecOperation, 0, VK_VIDEO_CODEC_OPERATION_NONE_KHR);
@@ -108 +88,0 @@ int main(int argc, const char **argv)
-
@@ -112,9 +92,8 @@ int main(int argc, const char **argv)
-        assert(displayShell->PhysDeviceCanPresent(vkDevCtxt.getPhysicalDevice(),
-                                                  vkDevCtxt.GetPresentQueueFamilyIdx()));
-
-        vkDevCtxt.CreateVulkanDevice(numDecodeQueues,           // numDecodeQueues
-                                     0,                         // num encode queues
-                                     videoCodecOperation,       // videoCodecs
-                                     false,                     // createTransferQueue
-                                     true,                      // createGraphicsQueue
-                                     true,                      // createDisplayQueue
+        assert(displayShell->PhysDeviceCanPresent(vkDevCtxt.getPhysicalDevice(), vkDevCtxt.GetPresentQueueFamilyIdx()));
+
+        vkDevCtxt.CreateVulkanDevice(numDecodeQueues,                   // numDecodeQueues
+                                     0,                                 // num encode queues
+                                     videoCodecOperation,               // videoCodecs
+                                     false,                             // createTransferQueue
+                                     true,                              // createGraphicsQueue
+                                     true,                              // createDisplayQueue
@@ -122 +101 @@ int main(int argc, const char **argv)
-teTransferQueue
-                       +        );
@@ -133,6 +112,3 @@ int main(int argc, const char **argv)
-                             videoCodecOperation,               // videoCodecs
+      -                               false,                             // cr-eateTransferQueue
+                                     true,                  -            // createGraphicsQueue
+                         -            true,                              // createDisplayQueue
@@ -1-22 +101 @@ int main(int argc, const char **argv)
-teTransfer+            result =
+                VkVideoFrameOutput::Create(decoderConfig.outputFileName.c_str(), decoderConfig.outputy4m,
+                                           decoderConfig.outputcrcPerFrame, crcOutputFile, decoderConfig.crcInitValue, frameToFile);
@@ -155 +130,0 @@ int main(int argc, const char **argv)
-d@@ -157,5 +132,2 @@ int main(int argc, const char **argv)
-                            decoderConfig.outputcrcPerFrame, crcOutputFile, de-coderConfig.crcInitValue, frameToFile);
@@ -155 +130,0 @@ int main(int argc, c-onst char **argv)
-d@@ -157,5 +132,2 @@ int main(int argc, const char **argv)
--                            decoderConfig.outputcrcPer-Frame, crcOutputFile, de-coderConfig.crcInitValue, frameToFile);
@@ -155 +13+                                              (VK_QUEUE_TRANSFER_BIT | requestVideoDecodeQueueMask | requestVideoComputeQueueMask),
+                                              nullptr, requestVideoDecodeQueueMask);
@@ -163 +134,0 @@ int main(int argc, const char **argv)
-r@@ -168,12 +139,12 @@ int main(int argc, const char **argv)
-d-erConfig.outputcrcPer-Frame, crcOutputFile, de-coderConfig.crcInitValue, frameToFil-e);
@@ -155 +13+                                              (VK_QUEUE_TRANSFER_BIT -| requestVideoDecodeQueueMask | requestVideoComputeQueueMask),
+                   -                           nullptr, requestVideoDecodeQueueMask);
@@ -163 +134,0 @@ int main(int argc, const char- **argv)
-r@@ -168,12 +139,12 @@ int main(int argc, const char **argv)
-d-erConfig.outputcrcPer-Frame, crcOutputFile, de-cod-erConfig.crcInitValue, frameToFil-e);
@@ -155 +13+                                              (VK_QUEUE_TRANSF-ER_BIT -| requestVideoDecodeQueueMask | requestVideoComputeQueueMask),
+                   -                           nullptr, requestVideo-DecodeQueueMask);
@@ -163 +134,0 @@ int main(int argc, const char- **argv)
--r@@ -168,12 +139,12 @@ int main(int argc, const char **argv)
-d-erConfig.ou-tputcrcPer-Frame, crcOutputFile, de-cod-erConfig.crcInitValue, frameToFil-e);
@@ -155 +13+              -                                (VK_QUEUE_TRANSF-+        result = vkDevCtxt.CreateVulkanDevice(
+            numDecodeQueues,      // numDecodeQueues
+            0,                    // num encode queues
+            videoCodecOperation,  // videoCodecs
+            // If no graphics or compute queue is requested, only video queues
+            // will be created. Not all implementations support transfer on video queues,
+            // so request a separate transfer queue for such implementations.
+            ((vkDevCtxt.GetVideoDecodeQueueFlag() & VK_QUEUE_TRANSFER_BIT) == 0),  //  createTransferQueue
+            false,                                                                 // createGraphicsQueue
+            false,                                                                 // createDisplayQueue
+            requestVideoComputeQueueMask != 0                                      // createComputeQueue
+        );
@@ -181 +151,0 @@ int main(int argc, const char **argv)
-k@@ -196,6 +166,3 @@ int main(int argc, const char **argv)
-s or compute queue is requested, only video queues
+            // will be created. No-t all implementations support transfer on video queues,
+            //- so request a separate transfer queue for such implementations.
+            ((-vkDevCtxt.GetVideoDecodeQueueFlag() & VK_QUEUE_TRANSFER_BIT) -== 0),  //  createTransferQueue
+            false,                       -                                          // createGraphicsQ+            result =
+                VkVideoFrameOutput::Create(decoderConfig.outputFileName.c_str(), decoderConfig.outputy4m,
+                                           decoderConfig.outputcrcPerFrame, crcOutputFile, decoderConfig.crcInitValue, frameToFile);

Have any feedback or feature suggestions? Share it here.

@github-actions github-actions bot dismissed their stale review June 19, 2025 14:32

outdated suggestion

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v16.0.6

Click here for the full clang-format patch
diff --git a/vk_video_decoder/demos/vk-video-dec/Main.cpp b/vk_video_decoder/demos/vk-video-dec/Main.cpp
index 42ba753..8d09d1c 100644
--- a/vk_video_decoder/demos/vk-video-dec/Main.cpp
+++ b/vk_video_decoder/demos/vk-video-dec/Main.cpp
@@ -218 +218 @@ int main(int argc, const char **argv)
-        printf    ( "ccououou"  )  ;
+        printf("ccououou");

Have any feedback or feature suggestions? Share it here.

@github-actions github-actions bot dismissed their stale review June 19, 2025 14:35

outdated suggestion

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v16.0.6

Click here for the full clang-format patch
diff --git a/vk_video_decoder/demos/vk-video-dec/Main.cpp b/vk_video_decoder/demos/vk-video-dec/Main.cpp
index 42ba753..8d09d1c 100644
--- a/vk_video_decoder/demos/vk-video-dec/Main.cpp
+++ b/vk_video_decoder/demos/vk-video-dec/Main.cpp
@@ -218 +218 @@ int main(int argc, const char **argv)
-        printf    ( "ccououou"  )  ;
+        printf("ccououou");

Have any feedback or feature suggestions? Share it here.

@github-actions github-actions bot dismissed their stale review June 19, 2025 14:57

outdated suggestion

@dabrain34 dabrain34 force-pushed the dab_add_lint branch 3 times, most recently from 47c5bd5 to 50837b2 Compare June 19, 2025 15:24
@dabrain34 dabrain34 changed the title github actions: add lint job github actions: add cpp-lint action Jun 19, 2025
Use lint action from
https://github.com/marketplace/actions/c-c-linter
which allows to run clang-format on cpp files.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants