wireplumber/split-config-file.py

49 lines
1.6 KiB
Python
Raw Normal View History

#!/usr/bin/python3
import hashlib
import sys
def sha256_from_data(data):
hash_sha256 = hashlib.sha256()
hash_sha256.update(data)
return hash_sha256.hexdigest()
contents = open('90-enable-all.lua', 'r', encoding='utf-8').read()
sha256sum = sha256_from_data(contents.encode('utf-8'))
Accepting request 1128888 from home:alarrosa:branches:multimedia:libs - Update to version 0.4.16: * Additions: - Added a new "sm-objects" script that allows loading objects on demand via metadata entries that describe the object to load; this can be used to load pipewire modules, such as filters or network sources/sinks, on demand - Added a mechanism to override device profile priorities in the configuration, mainly as a way to re-prioritize Bluetooth codecs, but this also can be used for other devices - Added a mechanism in the endpoints policy to allow connecting filters between a certain endpoint's virtual sink and the device sink; this is specifically intended to allow plugging a filter-chain to act as equalizer on the Multimedia endpoint - Added wp_core_get_own_bound_id() method in WpCore * Changes: - PipeWire 0.3.68 is now required - policy-dsp now has the ability to hide hardware nodes behind the DSP sink to prevent hardware misuse or damage - JSON parsing in Lua now allows keys inside objects to be without quotes - Added optional argument in the Lua JSON parse() method to limit recursions, making it possible to partially parse a JSON object - It is now possible to pass nil in Lua object constructors that expect an optional properties object; previously, omitting the argument was the only way to skip the properties - The endpoints policy now marks the endpoint nodes as "passive" instead of marking their links, adjusting for the behavior change in PipeWire 0.3.68 - Removed the "passive" property from si-standard-link, since OBS-URL: https://build.opensuse.org/request/show/1128888 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=63
2023-11-26 11:24:38 +00:00
expected_sha256sum = '86888e9d3fcc952c41e778ab4edae4a0eb1f9f51b62ae0772befa9f0fdef611d'
if sha256sum != expected_sha256sum:
print('The script has to be updated for new changes in 90-enable-all.lua')
print(f'File sha256sum: {sha256sum}')
print(f'expected sha256sum: {expected_sha256sum}')
sys.exit(1)
content_sections = contents.split('\n\n')
sections = ['enable-metadata',
'default-access-policy',
'load-devices',
Accepting request 952225 from home:alarrosa:branches:multimedia:libs - Update to version 0.4.8: * Highlights: - Added bluetooth profile auto-switching support. Bluetooth headsets will now automatically switch to the HSP/HFP profile when making a call and go back to the A2DP profile after the call ends (#90) - Added an option (enabled by default) to auto-switch to echo-cancel virtual device nodes when the echo-cancel module is loaded in pipewire-pulse, if there is no other configured default node * Fixes: - Fixed a regression that prevented nodes from being selected as default when using the pro-audio profile (#163) - Fixed a regression that caused encoded audio streams to stall (#178) - Fixed restoring bluetooth device profiles * Library: - A new WpSpaJson API was added as a front-end to spa-json. This is also exposed to Lua, so that Lua scripts can natively parse and write data in the spa-json format * Misc: - wpctl can now list the configured default sources and sinks and has a new command that allows clearing those configured defaults, so that wireplumber goes back to choosing the default nodes based on node priorities - The restore-stream script now has its own configuration file in main.lua.d/40-stream-defaults.lua and has independent options for restoring properties and target nodes - The restore-stream script now supports rule-based configuration to disable restoring volume properties and/or OBS-URL: https://build.opensuse.org/request/show/952225 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=30
2022-02-07 17:43:50 +00:00
'track-user-choices-devices',
'track-user-choices-streams',
'link-nodes-by-roles',
Accepting request 1128888 from home:alarrosa:branches:multimedia:libs - Update to version 0.4.16: * Additions: - Added a new "sm-objects" script that allows loading objects on demand via metadata entries that describe the object to load; this can be used to load pipewire modules, such as filters or network sources/sinks, on demand - Added a mechanism to override device profile priorities in the configuration, mainly as a way to re-prioritize Bluetooth codecs, but this also can be used for other devices - Added a mechanism in the endpoints policy to allow connecting filters between a certain endpoint's virtual sink and the device sink; this is specifically intended to allow plugging a filter-chain to act as equalizer on the Multimedia endpoint - Added wp_core_get_own_bound_id() method in WpCore * Changes: - PipeWire 0.3.68 is now required - policy-dsp now has the ability to hide hardware nodes behind the DSP sink to prevent hardware misuse or damage - JSON parsing in Lua now allows keys inside objects to be without quotes - Added optional argument in the Lua JSON parse() method to limit recursions, making it possible to partially parse a JSON object - It is now possible to pass nil in Lua object constructors that expect an optional properties object; previously, omitting the argument was the only way to skip the properties - The endpoints policy now marks the endpoint nodes as "passive" instead of marking their links, adjusting for the behavior change in PipeWire 0.3.68 - Removed the "passive" property from si-standard-link, since OBS-URL: https://build.opensuse.org/request/show/1128888 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=63
2023-11-26 11:24:38 +00:00
'suspend-idle-nodes',
'allow-loading-objects-on-demand']
if len(content_sections) != len(sections):
print('The script has to be updated for new changes in 90-enable-all.lua')
sys.exit(1)
for i, (content, sec) in enumerate(zip(content_sections, sections)):
if sec == 'load-devices':
lines = content.split('\n')
open(f'90-{i}-1-enable-alsa.lua', 'w',
encoding='utf-8').write(lines[1])
open(f'90-{i}-2-enable-v4l2.lua', 'w',
encoding='utf-8').write(lines[2])
Accepting request 1128888 from home:alarrosa:branches:multimedia:libs - Update to version 0.4.16: * Additions: - Added a new "sm-objects" script that allows loading objects on demand via metadata entries that describe the object to load; this can be used to load pipewire modules, such as filters or network sources/sinks, on demand - Added a mechanism to override device profile priorities in the configuration, mainly as a way to re-prioritize Bluetooth codecs, but this also can be used for other devices - Added a mechanism in the endpoints policy to allow connecting filters between a certain endpoint's virtual sink and the device sink; this is specifically intended to allow plugging a filter-chain to act as equalizer on the Multimedia endpoint - Added wp_core_get_own_bound_id() method in WpCore * Changes: - PipeWire 0.3.68 is now required - policy-dsp now has the ability to hide hardware nodes behind the DSP sink to prevent hardware misuse or damage - JSON parsing in Lua now allows keys inside objects to be without quotes - Added optional argument in the Lua JSON parse() method to limit recursions, making it possible to partially parse a JSON object - It is now possible to pass nil in Lua object constructors that expect an optional properties object; previously, omitting the argument was the only way to skip the properties - The endpoints policy now marks the endpoint nodes as "passive" instead of marking their links, adjusting for the behavior change in PipeWire 0.3.68 - Removed the "passive" property from si-standard-link, since OBS-URL: https://build.opensuse.org/request/show/1128888 OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/wireplumber?expand=0&rev=63
2023-11-26 11:24:38 +00:00
open(f'90-{i}-3-enable-libcamera.lua', 'w',
encoding='utf-8').write(lines[3])
continue
filename = f'90-{i}-{sec}.lua'
open(filename, 'w', encoding='utf-8').write(content)