mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-10-29 05:40:27 -04:00 
			
		
		
		
	don't force a MEDIA_ROLE property
The application has to set a media role.
This commit is contained in:
		
							parent
							
								
									6469663265
								
							
						
					
					
						commit
						1bd31c1cf1
					
				
					 2 changed files with 24 additions and 25 deletions
				
			
		|  | @ -419,8 +419,6 @@ static int snd_pcm_pipewire_prepare(snd_pcm_ioplug_t *io) | |||
| 		pw_properties_set(props, PW_KEY_MEDIA_CATEGORY, | ||||
| 				io->stream == SND_PCM_STREAM_PLAYBACK ? | ||||
| 				"Playback" : "Capture"); | ||||
| 	if (pw_properties_get(props, PW_KEY_MEDIA_ROLE) == NULL) | ||||
| 		pw_properties_set(props, PW_KEY_MEDIA_ROLE, "Music"); | ||||
| 
 | ||||
| 	pw->stream = pw_stream_new(pw->core, pw->node_name, props); | ||||
| 	if (pw->stream == NULL) | ||||
|  |  | |||
|  | @ -970,28 +970,28 @@ static int create_stream(pa_stream_direction_t direction, | |||
| 			devid = PW_ID_ANY; | ||||
| 	} | ||||
| 
 | ||||
| 	if ((str = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_ROLE)) == NULL) | ||||
| 		str = "Music"; | ||||
| 	else if (strcmp(str, "video") == 0) | ||||
| 		str = "Movie"; | ||||
| 	else if (strcmp(str, "music") == 0) | ||||
| 		str = "Music"; | ||||
| 	else if (strcmp(str, "game") == 0) | ||||
| 		str = "Game"; | ||||
| 	else if (strcmp(str, "event") == 0) | ||||
| 		str = "Notification"; | ||||
| 	else if (strcmp(str, "phone") == 0) | ||||
| 		str = "Communication"; | ||||
| 	else if (strcmp(str, "animation") == 0) | ||||
| 		str = "Movie"; | ||||
| 	else if (strcmp(str, "production") == 0) | ||||
| 		str = "Production"; | ||||
| 	else if (strcmp(str, "a11y") == 0) | ||||
| 		str = "Accessibility"; | ||||
| 	else if (strcmp(str, "test") == 0) | ||||
| 		str = "Test"; | ||||
| 	else | ||||
| 		str = "Music"; | ||||
| 	if ((str = pa_proplist_gets(s->proplist, PA_PROP_MEDIA_ROLE)) != NULL) { | ||||
| 		if (strcmp(str, "video") == 0) | ||||
| 			str = "Movie"; | ||||
| 		else if (strcmp(str, "music") == 0) | ||||
| 			str = "Music"; | ||||
| 		else if (strcmp(str, "game") == 0) | ||||
| 			str = "Game"; | ||||
| 		else if (strcmp(str, "event") == 0) | ||||
| 			str = "Notification"; | ||||
| 		else if (strcmp(str, "phone") == 0) | ||||
| 			str = "Communication"; | ||||
| 		else if (strcmp(str, "animation") == 0) | ||||
| 			str = "Movie"; | ||||
| 		else if (strcmp(str, "production") == 0) | ||||
| 			str = "Production"; | ||||
| 		else if (strcmp(str, "a11y") == 0) | ||||
| 			str = "Accessibility"; | ||||
| 		else if (strcmp(str, "test") == 0) | ||||
| 			str = "Test"; | ||||
| 		else | ||||
| 			str = "Music"; | ||||
| 	} | ||||
| 
 | ||||
| 	stride = pa_frame_size(&s->sample_spec); | ||||
| 	if (direction == PA_STREAM_RECORD) | ||||
|  | @ -1004,7 +1004,8 @@ static int create_stream(pa_stream_direction_t direction, | |||
| 	items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_CATEGORY, | ||||
| 				direction == PA_STREAM_PLAYBACK ? | ||||
| 					"Playback" : monitor ? "Monitor" : "Capture"); | ||||
| 	items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_ROLE, str); | ||||
| 	if (str != NULL) | ||||
| 		items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_MEDIA_ROLE, str); | ||||
| 	if (monitor) | ||||
| 		items[n_items++] = SPA_DICT_ITEM_INIT(PW_KEY_STREAM_MONITOR, "true"); | ||||
| 	if (no_remix) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Wim Taymans
						Wim Taymans