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

Function parseVideoCodecs

generator/VkXMLParser.cpp:3072–3110  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3070}
3071
3072std::vector<VideoCodec> parseVideoCodecs( tinyxml2::XMLElement const * element )
3073{
3074 int const line = element->GetLineNum();
3075 checkAttributes( "vk.xml", line, getAttributes( element ), {}, {} );
3076 std::vector<tinyxml2::XMLElement const *> children = getChildElements( element );
3077 checkElements( "vk.xml", line, children, { { "videocodec", MultipleAllowed::Yes } } );
3078
3079 std::vector<VideoCodec> videoCodecs;
3080 for ( auto child : children )
3081 {
3082 std::string value = child->Value();
3083 if ( value == "videocodec" )
3084 {
3085 VideoCodec videoCodec = parseVideoCodec( child );
3086 checkForError( "vk.xml", !containsByName( videoCodecs, videoCodec.name ), line, "video codec <" + videoCodec.name + "> already specified" );
3087 if ( !videoCodec.extend.empty() )
3088 {
3089 checkForError( "vk.xml",
3090 containsByName( videoCodecs, videoCodec.extend ),
3091 line,
3092 "video codec <" + videoCodec.name + "> extends unknown video codec <" + videoCodec.extend + ">" );
3093 }
3094 for ( auto const & videoFormat : videoCodec.videoFormats )
3095 {
3096 if ( !videoFormat.extend.empty() )
3097 {
3098 checkForError(
3099 "vk.xml",
3100 std::ranges::any_of( videoCodecs, [&videoFormat]( VideoCodec const & vc ) { return containsByName( vc.videoFormats, videoFormat.extend ); } ),
3101 videoFormat.xmlLine,
3102 "videocodec <" + videoCodec.name + "> extends unknown video format <" + videoFormat.extend + ">" );
3103 }
3104 }
3105 videoCodecs.push_back( std::move( videoCodec ) );
3106 }
3107 }
3108
3109 return videoCodecs;
3110}
3111
3112VideoFormat parseVideoFormat( tinyxml2::XMLElement const * element )
3113{

Callers 1

parseRegistryFunction · 0.85

Calls 7

checkAttributesFunction · 0.85
getAttributesFunction · 0.85
getChildElementsFunction · 0.85
checkElementsFunction · 0.85
parseVideoCodecFunction · 0.85
checkForErrorFunction · 0.85
containsByNameFunction · 0.85

Tested by

no test coverage detected