mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	pulse-server: print encoding name in format_info
This commit is contained in:
		
							parent
							
								
									686524ce40
								
							
						
					
					
						commit
						4b591df145
					
				
					 2 changed files with 23 additions and 2 deletions
				
			
		| 
						 | 
					@ -476,9 +476,28 @@ enum encoding {
 | 
				
			||||||
	ENCODING_TRUEHD_IEC61937,
 | 
						ENCODING_TRUEHD_IEC61937,
 | 
				
			||||||
	ENCODING_DTSHD_IEC61937,
 | 
						ENCODING_DTSHD_IEC61937,
 | 
				
			||||||
	ENCODING_MAX,
 | 
						ENCODING_MAX,
 | 
				
			||||||
	NCODING_INVALID = -1,
 | 
						ENCODING_INVALID = -1,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static const char *encoding_names[] = {
 | 
				
			||||||
 | 
						[ENCODING_ANY] = "ANY",
 | 
				
			||||||
 | 
						[ENCODING_PCM] = "PCM",
 | 
				
			||||||
 | 
						[ENCODING_AC3_IEC61937] = "AC3-IEC61937",
 | 
				
			||||||
 | 
						[ENCODING_EAC3_IEC61937] = "EAC3-IEC61937",
 | 
				
			||||||
 | 
						[ENCODING_MPEG_IEC61937] = "MPEG-IEC61937",
 | 
				
			||||||
 | 
						[ENCODING_DTS_IEC61937] = "DTS-IEC61937",
 | 
				
			||||||
 | 
						[ENCODING_MPEG2_AAC_IEC61937] = "MPEG2-AAC-IEC61937",
 | 
				
			||||||
 | 
						[ENCODING_TRUEHD_IEC61937] = "TRUEHD-IEC61937",
 | 
				
			||||||
 | 
						[ENCODING_DTSHD_IEC61937] = "DTSHD-IEC61937",
 | 
				
			||||||
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static inline const char *format_encoding2name(enum encoding enc)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (enc >= 0 && enc < (int)SPA_N_ELEMENTS(encoding_names))
 | 
				
			||||||
 | 
							return encoding_names[enc];
 | 
				
			||||||
 | 
						return "INVALID";
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
struct format_info {
 | 
					struct format_info {
 | 
				
			||||||
	enum encoding encoding;
 | 
						enum encoding encoding;
 | 
				
			||||||
	struct pw_properties *props;
 | 
						struct pw_properties *props;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -850,7 +850,9 @@ static int message_dump(enum spa_log_level level, struct message *m)
 | 
				
			||||||
			const struct spa_dict_item *it;
 | 
								const struct spa_dict_item *it;
 | 
				
			||||||
			if ((res = read_format_info(m, &info)) < 0)
 | 
								if ((res = read_format_info(m, &info)) < 0)
 | 
				
			||||||
				return res;
 | 
									return res;
 | 
				
			||||||
			pw_log(level, "%u: format-info: n_items:%u", o, info.props->dict.n_items);
 | 
								pw_log(level, "%u: format-info: enc:%s n_items:%u",
 | 
				
			||||||
 | 
										o, format_encoding2name(info.encoding),
 | 
				
			||||||
 | 
										info.props->dict.n_items);
 | 
				
			||||||
			spa_dict_for_each(it, &info.props->dict)
 | 
								spa_dict_for_each(it, &info.props->dict)
 | 
				
			||||||
				pw_log(level, "     '%s': '%s'", it->key, it->value);
 | 
									pw_log(level, "     '%s': '%s'", it->key, it->value);
 | 
				
			||||||
			break;
 | 
								break;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue