Add inclusion of new encode file to VideoHppGenerator, add compile test for video. (#2002)

This commit is contained in:
Andreas Süßenbach 2024-12-02 08:51:02 +01:00 committed by GitHub
parent 06b91cfdc2
commit 1e92bf4fcd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 70 additions and 2 deletions

View File

@ -42,8 +42,15 @@ void VideoHppGenerator::generateHppFile() const
#ifndef VULKAN_VIDEO_HPP #ifndef VULKAN_VIDEO_HPP
#define VULKAN_VIDEO_HPP #define VULKAN_VIDEO_HPP
// clang-format off
#include <vulkan/vulkan.hpp>
// clang-format on
#include <vk_video/vulkan_video_codec_av1std.h> #include <vk_video/vulkan_video_codec_av1std.h>
#include <vk_video/vulkan_video_codec_av1std_decode.h> #include <vk_video/vulkan_video_codec_av1std_decode.h>
#if ( 301 < VK_HEADER_VERSION )
# include <vk_video/vulkan_video_codec_av1std_encode.h>
#endif
#include <vk_video/vulkan_video_codecs_common.h> #include <vk_video/vulkan_video_codecs_common.h>
#include <vk_video/vulkan_video_codec_h264std.h> #include <vk_video/vulkan_video_codec_h264std.h>
#include <vk_video/vulkan_video_codec_h264std_decode.h> #include <vk_video/vulkan_video_codec_h264std_decode.h>
@ -51,7 +58,6 @@ void VideoHppGenerator::generateHppFile() const
#include <vk_video/vulkan_video_codec_h265std.h> #include <vk_video/vulkan_video_codec_h265std.h>
#include <vk_video/vulkan_video_codec_h265std_decode.h> #include <vk_video/vulkan_video_codec_h265std_decode.h>
#include <vk_video/vulkan_video_codec_h265std_encode.h> #include <vk_video/vulkan_video_codec_h265std_encode.h>
#include <vulkan/vulkan.hpp>
#if !defined( VULKAN_HPP_VIDEO_NAMESPACE ) #if !defined( VULKAN_HPP_VIDEO_NAMESPACE )
# define VULKAN_HPP_VIDEO_NAMESPACE video # define VULKAN_HPP_VIDEO_NAMESPACE video

View File

@ -46,3 +46,4 @@ add_subdirectory( UniqueHandle )
if(CMAKE_SIZEOF_VOID_P EQUAL 8) if(CMAKE_SIZEOF_VOID_P EQUAL 8)
add_subdirectory( UniqueHandleDefaultArguments ) add_subdirectory( UniqueHandleDefaultArguments )
endif() endif()
add_subdirectory( Video )

View File

@ -0,0 +1,15 @@
# Copyright(c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
vulkan_hpp__setup_test( NAME Video )

40
tests/Video/Video.cpp Normal file
View File

@ -0,0 +1,40 @@
// Copyright(c) 2024, NVIDIA CORPORATION. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// VulkanHpp Samples : Video
// Compile test on using vk::video
#if defined( _MSC_VER )
# pragma warning( disable : 4101 ) // 'name': unreference local variable
#elif defined( __clang__ )
# pragma clang diagnostic ignored "-Wunused-variable"
#elif defined( __GNUC__ )
# pragma GCC diagnostic ignored "-Wunused-variable"
#else
// unknown compiler... just ignore the warnings for yourselves ;)
#endif
#include <vulkan/vulkan_video.hpp>
int main( int /*argc*/, char ** /*argv*/ )
{
vk::video::H264ChromaFormatIdc x;
vk::video::H264ProfileIdc y;
#if ( 301 < VK_HEADER_VERSION )
vk::video::EncodeAV1DecoderModelInfo z;
#endif
return 0;
}

View File

@ -7,8 +7,15 @@
#ifndef VULKAN_VIDEO_HPP #ifndef VULKAN_VIDEO_HPP
#define VULKAN_VIDEO_HPP #define VULKAN_VIDEO_HPP
// clang-format off
#include <vulkan/vulkan.hpp>
// clang-format on
#include <vk_video/vulkan_video_codec_av1std.h> #include <vk_video/vulkan_video_codec_av1std.h>
#include <vk_video/vulkan_video_codec_av1std_decode.h> #include <vk_video/vulkan_video_codec_av1std_decode.h>
#if ( 301 < VK_HEADER_VERSION )
# include <vk_video/vulkan_video_codec_av1std_encode.h>
#endif
#include <vk_video/vulkan_video_codec_h264std.h> #include <vk_video/vulkan_video_codec_h264std.h>
#include <vk_video/vulkan_video_codec_h264std_decode.h> #include <vk_video/vulkan_video_codec_h264std_decode.h>
#include <vk_video/vulkan_video_codec_h264std_encode.h> #include <vk_video/vulkan_video_codec_h264std_encode.h>
@ -16,7 +23,6 @@
#include <vk_video/vulkan_video_codec_h265std_decode.h> #include <vk_video/vulkan_video_codec_h265std_decode.h>
#include <vk_video/vulkan_video_codec_h265std_encode.h> #include <vk_video/vulkan_video_codec_h265std_encode.h>
#include <vk_video/vulkan_video_codecs_common.h> #include <vk_video/vulkan_video_codecs_common.h>
#include <vulkan/vulkan.hpp>
#if !defined( VULKAN_HPP_VIDEO_NAMESPACE ) #if !defined( VULKAN_HPP_VIDEO_NAMESPACE )
# define VULKAN_HPP_VIDEO_NAMESPACE video # define VULKAN_HPP_VIDEO_NAMESPACE video