inac wrote: ↑
Thu Feb 28, 2019 1:47 pm
I have the setup [rawcam] - [ISP] . The connection is created with mmal_connection_create.
When I set the black level
Code: Select all
mmal_port_parameter_set_uint32(isp_input, MMAL_PARAMETER_BLACK_LEVEL, level));
when setup the ISP and enable everything works. But changing the parameter while everything is running the parameter is not set i.e. I cannot set the black level during streaming. So I have the following questions.
1) When can I set mmal_port_parameter_set?
You'll need to refer to the IL docs for the answer for each parameter. MMAL is built on the same underlying components as IL, and parameters should have similar enums.
http://www.jvcref.com/files/PI/document ... s/isp.html
(which is a rendering of https://github.com/raspberrypi/firmware ... s/isp.html
) - OMX_IndexParamBrcmBlackLevel
In the IL world, OMX_IndexParam... can only be changed whilst the component or port is disabled. OMX_IndexConfig... can be changed at any time.
inac wrote:2) Can it be set when the ports, connections and components are enabled?
As it is an IL Param, technically no.
There's no real reason that I can't rework it to work allow changes at any time, but at the moment it won't update (and is slightly naughty in not returning an error).
inac wrote:3) Do I need a mmal_port_format_commit after a mmal_port_parameter_set?
No. Parameters should never affect the port format.
inac wrote:4) What is the range of level (it's only positive)?
The maximum value that your input format can represent, ie 255 for 8 bit data, 1023 for 10bit data, 4095 for 12bit data, 65535 for 16 bit data. Using the maximum value won't be useful though as it will just make your entire image black.
Black level is basically the noise floor of the sensor. Cover the sensor completely and capture a frame. The highest value found (ignoring defective pixels) is typically the value you want to use for black level.
In theory you can have a different black level for each of the colour components, but I haven't exposed that either as generally the 4 channels are fairly closely matched.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.