mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pod: improve the vararg pod builder and parser
Automatically parse and build key/value when in objects without having to prefix the key with ":" Automatically build control/value when in sequence without the "." prefix. Remove the builder with key/pod, taking a reference to the stack built temporary pods is not allowed in c++. We can use the varargs version with the same convenient syntax. Remove the parser "*" option, it is unused. Improve spa_pod_builder_add_* and spa_pod_parser_get_* and make them look similar.
This commit is contained in:
		
							parent
							
								
									79d68ace68
								
							
						
					
					
						commit
						80cfda89c1
					
				
					 59 changed files with 1833 additions and 2005 deletions
				
			
		| 
						 | 
				
			
			@ -124,16 +124,16 @@ static struct spa_pod *sdl_build_formats(SDL_RendererInfo *info, struct spa_pod_
 | 
			
		|||
			spa_pod_builder_id(b, id);
 | 
			
		||||
	}
 | 
			
		||||
	spa_pod_builder_pop(b);
 | 
			
		||||
	spa_pod_builder_props(b,
 | 
			
		||||
		SPA_FORMAT_VIDEO_size,      &SPA_POD_CHOICE_RANGE_Rectangle(
 | 
			
		||||
							SPA_RECTANGLE(WIDTH, HEIGHT),
 | 
			
		||||
							SPA_RECTANGLE(1,1),
 | 
			
		||||
							SPA_RECTANGLE(info->max_texture_width,
 | 
			
		||||
	spa_pod_builder_add(b,
 | 
			
		||||
		SPA_FORMAT_VIDEO_size,      SPA_POD_CHOICE_RANGE_Rectangle(
 | 
			
		||||
							&SPA_RECTANGLE(WIDTH, HEIGHT),
 | 
			
		||||
							&SPA_RECTANGLE(1,1),
 | 
			
		||||
							&SPA_RECTANGLE(info->max_texture_width,
 | 
			
		||||
								      info->max_texture_height)),
 | 
			
		||||
		SPA_FORMAT_VIDEO_framerate, &SPA_POD_CHOICE_RANGE_Fraction(
 | 
			
		||||
							SPA_FRACTION(25,1),
 | 
			
		||||
							SPA_FRACTION(0,1),
 | 
			
		||||
							SPA_FRACTION(30,1)),
 | 
			
		||||
		SPA_FORMAT_VIDEO_framerate, SPA_POD_CHOICE_RANGE_Fraction(
 | 
			
		||||
							&SPA_FRACTION(25,1),
 | 
			
		||||
							&SPA_FRACTION(0,1),
 | 
			
		||||
							&SPA_FRACTION(30,1)),
 | 
			
		||||
		0);
 | 
			
		||||
	return spa_pod_builder_pop(b);
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue