MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Hpp / parseVideoFormat

Function parseVideoFormat

generator/VkXMLParser.cpp:3112–3162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3110}
3111
3112VideoFormat parseVideoFormat( tinyxml2::XMLElement const * element )
3113{
3114 int const line = element->GetLineNum();
3115 std::map<std::string, std::string> attributes = getAttributes( element );
3116 if ( attributes.contains( "extend" ) )
3117 {
3118 checkAttributes( "vk.xml", line, attributes, { { "extend", {} } }, {} );
3119 }
3120 else
3121 {
3122 checkAttributes( "vk.xml", line, attributes, { { "name", {} }, { "usage", {} } }, {} );
3123 }
3124 std::vector<tinyxml2::XMLElement const *> children = getChildElements( element );
3125 checkElements( "vk.xml", line, children, {}, { { "videoformatproperties", MultipleAllowed::No }, { "videorequirecapabilities", MultipleAllowed::No } } );
3126
3127 VideoFormat videoFormat{ .xmlLine = line };
3128 for ( auto const & attribute : attributes )
3129 {
3130 if ( attribute.first == "extend" )
3131 {
3132 checkNoList( attribute.second, line );
3133 videoFormat.extend = attribute.second;
3134 }
3135 else if ( attribute.first == "name" )
3136 {
3137 checkNoList( attribute.second, line );
3138 videoFormat.name = attribute.second;
3139 }
3140 else if ( attribute.first == "usage" )
3141 {
3142 checkNoList( attribute.second, line );
3143 videoFormat.usage = attribute.second;
3144 // CHECK: usage after extensions
3145 }
3146 }
3147
3148 for ( auto child : children )
3149 {
3150 std::string value = child->Value();
3151 if ( value == "videoformatproperties" )
3152 {
3153 videoFormat.videoFormatProperties = std::make_optional<VideoFormatProperties>( parseVideoFormatProperties( child ) );
3154 }
3155 else if ( value == "videorequirecapabilities" )
3156 {
3157 videoFormat.videoRequireCapabilities = std::make_optional<VideoRequireCapabilities>( parseVideoRequireCapabilities( child ) );
3158 }
3159 }
3160
3161 return videoFormat;
3162}
3163
3164VideoFormatProperties parseVideoFormatProperties( tinyxml2::XMLElement const * element )
3165{

Callers 1

parseVideoCodecFunction · 0.85

Calls 7

getAttributesFunction · 0.85
checkAttributesFunction · 0.85
getChildElementsFunction · 0.85
checkElementsFunction · 0.85
checkNoListFunction · 0.85

Tested by

no test coverage detected