mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 04:32:44 +00:00 
			
		
		
		
	LibWeb/Ladybird: Use the abstract audio output in a new audio plugin
The implementation of this plugin is meant to eventually replace all current audio plugins in Ladybird. The benefits over the current Qt- based audio playback plugin in Ladybird are: - Low latency: With direct access to PulseAudio, we can ask for a specific latency to output to allow minimal delay when pausing or seeking a stream. - Accurate timestamps: The Qt audio playback API does not expose audio time properly. When we have access directly to PulseAudio APIs, we can enable their timing interpolation to get an accurate monotonically- increasing timestamp of the playing audio. - Resiliency: With more control over how the underlying audio API is called, we have the power to fix most bugs we might encounter. The PulseAudio wrappers already avoid some bugs that occur with QAudioSink when running through WSLg.
This commit is contained in:
		
							parent
							
								
									bc4d4f0f95
								
							
						
					
					
						commit
						ad440f9e9a
					
				
					 5 changed files with 225 additions and 0 deletions
				
			
		|  | @ -27,6 +27,7 @@ | |||
| #include <LibWeb/Loader/FrameLoader.h> | ||||
| #include <LibWeb/Loader/ResourceLoader.h> | ||||
| #include <LibWeb/PermissionsPolicy/AutoplayAllowlist.h> | ||||
| #include <LibWeb/Platform/AudioCodecPluginAgnostic.h> | ||||
| #include <LibWeb/Platform/EventLoopPluginSerenity.h> | ||||
| #include <LibWeb/WebSockets/WebSocket.h> | ||||
| #include <LibWebView/RequestServerAdapter.h> | ||||
|  | @ -54,7 +55,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) | |||
|     Web::Platform::ImageCodecPlugin::install(*new Ladybird::ImageCodecPlugin); | ||||
| 
 | ||||
|     Web::Platform::AudioCodecPlugin::install_creation_hook([](auto loader) { | ||||
| #if defined(HAVE_PULSEAUDIO) | ||||
|         return Web::Platform::AudioCodecPluginAgnostic::create(move(loader)); | ||||
| #else | ||||
|         return Ladybird::AudioCodecPluginQt::create(move(loader)); | ||||
| #endif | ||||
|     }); | ||||
| 
 | ||||
|     Web::FrameLoader::set_default_favicon_path(DeprecatedString::formatted("{}/res/icons/16x16/app-browser.png", s_serenity_resource_root)); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Zaggy1024
						Zaggy1024