mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	spa: libcamera: source: use enum types
Use the appropriate enum types instead of bare `uint32_t`,
this provides better type safety in C++.
(cherry picked from commit 0ea7dc9f19)
			
			
This commit is contained in:
		
							parent
							
								
									3dd413e131
								
							
						
					
					
						commit
						d1eb5f6d20
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		| 
						 | 
					@ -71,7 +71,7 @@ struct port {
 | 
				
			||||||
	struct spa_fraction rate = {};
 | 
						struct spa_fraction rate = {};
 | 
				
			||||||
	StreamConfiguration streamConfig;
 | 
						StreamConfiguration streamConfig;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	uint32_t memtype = 0;
 | 
						spa_data_type memtype = SPA_DATA_Invalid;
 | 
				
			||||||
	uint32_t buffers_blocks = 1;
 | 
						uint32_t buffers_blocks = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct buffer buffers[MAX_BUFFERS];
 | 
						struct buffer buffers[MAX_BUFFERS];
 | 
				
			||||||
| 
						 | 
					@ -375,9 +375,9 @@ static int spa_libcamera_clear_buffers(struct impl *impl, struct port *port)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct format_info {
 | 
					struct format_info {
 | 
				
			||||||
	PixelFormat pix;
 | 
						PixelFormat pix;
 | 
				
			||||||
	uint32_t format;
 | 
						spa_video_format format;
 | 
				
			||||||
	uint32_t media_type;
 | 
						spa_media_type media_type;
 | 
				
			||||||
	uint32_t media_subtype;
 | 
						spa_media_subtype media_subtype;
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MAKE_FMT(pix,fmt,mt,mst) { pix, SPA_VIDEO_FORMAT_ ##fmt, SPA_MEDIA_TYPE_ ##mt, SPA_MEDIA_SUBTYPE_ ##mst }
 | 
					#define MAKE_FMT(pix,fmt,mt,mst) { pix, SPA_VIDEO_FORMAT_ ##fmt, SPA_MEDIA_TYPE_ ##mt, SPA_MEDIA_SUBTYPE_ ##mst }
 | 
				
			||||||
| 
						 | 
					@ -433,7 +433,7 @@ static const struct format_info *find_format_info_by_media_type(uint32_t type,
 | 
				
			||||||
	for (i = startidx; i < SPA_N_ELEMENTS(format_info); i++) {
 | 
						for (i = startidx; i < SPA_N_ELEMENTS(format_info); i++) {
 | 
				
			||||||
		if ((format_info[i].media_type == type) &&
 | 
							if ((format_info[i].media_type == type) &&
 | 
				
			||||||
		    (format_info[i].media_subtype == subtype) &&
 | 
							    (format_info[i].media_subtype == subtype) &&
 | 
				
			||||||
		    (format == 0 || format_info[i].format == format))
 | 
							    (format == SPA_VIDEO_FORMAT_UNKNOWN || format_info[i].format == format))
 | 
				
			||||||
			return &format_info[i];
 | 
								return &format_info[i];
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return NULL;
 | 
						return NULL;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue