<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="Report"> <default-policy> <child name="report_rom" label="capture"/> </default-policy> </service>
	<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">
			<capture/>
			<domain name="" layer="1" content="client" label="no" />
			<default-policy domain=""/>
		</config>
		<route>
			<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="capture" report="capture"/>
		</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="webcam_enabled" rom="capture" node="capture">
				<attribute name="enabled"/>
			</input>

			<output node="config">
				<if> <has_value input="webcam_enabled" value="true"/>
				<then>
					<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>
				</then></if>
			</output>
		</config>
		<route>
			<service name="ROM" label="capture">
				<child name="report_rom" label="capture"/>
			</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>
