Files
genode/repos/libports/recipes/raw/usb_webcam/usb_webcam.config
Norman Feske eb80d6ce66 usb_webcam: on/off dependent on capture client
This commit removes the report service from the usb_webcam pkg, which
was used to enable or disable the webcam driver. The on/off state is
instead controlled by the presence of a capture client. That is, once a
capture client appears, the webcam driver is started. Vice versa, once
no capture client exists, the webcam driver is removed automatically.

Internally, the detection of presence of a capture client is based on
nitpicker's 'displays' report, which is consumed as input of the
rom_filter, which in turn generates the configuration of a dynamic sub
init.

Fixes #4287
2021-10-14 11:02:10 +02:00

111 lines
3.0 KiB
Plaintext

<config verbose="no">
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="Timer"/>
<service name="Usb"/>
</parent-provides>
<default caps="100"/>
<service name="Capture"> <default-policy> <child name="nitpicker_camera"/> </default-policy> </service>
<start name="nitpicker_camera" caps="150">
<binary name="nitpicker"/>
<resource name="RAM" quantum="4M"/>
<provides>
<service name="Gui"/> <service name="Capture"/>
</provides>
<config request_framebuffer="no">
<report displays="yes"/>
<capture/>
<domain name="" layer="1" content="client" label="no" />
<default-policy domain=""/>
</config>
<route>
<service name="Report"> <child name="report_rom"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="report_rom">
<binary name="report_rom"/>
<resource name="RAM" quantum="2M"/>
<provides> <service name="Report"/> <service name="ROM"/> </provides>
<config verbose="no">
<policy label="webcam_config -> displays" report="nitpicker_camera -> displays"/>
</config>
<route>
<any-service> <parent /> </any-service>
</route>
</start>
<start name="webcam_config">
<binary name="rom_filter"/>
<resource name="RAM" quantum="1M"/>
<provides> <service name="ROM"/> </provides>
<config verbose="no">
<input name="capture_width" rom="displays" node="displays" default="">
<node type="display">
<attribute name="width"/>
</node>
</input>
<output node="config">
<if> <has_value input="capture_width" value=""/>
<then> </then>
<else>
<inline>
<parent-provides>
<service name="ROM"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="Timer"/>
<service name="Gui"/>
<service name="Usb"/>
</parent-provides>
<default caps="128"/>
<start name="usb_webcam" caps="250">
<resource name="RAM" quantum="48M"/>
<config ld_verbose="no" enabled="yes" width="640" height="480" format="yuv" fps="15">
<vfs>
<dir name="dev"> <log/> <inline name="rtc">2018-01-01 00:01</inline> </dir>
<dir name="pipe"> <pipe/> </dir>
</vfs>
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc" pipe="/pipe"/>
<env key="LIBUSB_DEBUG" value="0"/>
</config>
<route>
<any-service> <parent/> </any-service>
</route>
</start>
</inline>
</else></if>
</output>
</config>
<route>
<service name="ROM" label="displays"> <child name="report_rom"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
<start name="webcam" caps="350">
<binary name="init"/>
<resource name="RAM" quantum="50MB"/>
<route>
<service name="ROM" label="config">
<child name="webcam_config" label="config"/>
</service>
<service name="Gui"> <child name="nitpicker_camera"/> </service>
<any-service> <parent/> </any-service>
</route>
</start>
</config>