blue-debug opened a new pull request, #21628:
URL: https://github.com/apache/nuttx/pull/21628

   *Note: Please adhere to [Contributing 
Guidelines](https://github.com/apache/nuttx/blob/master/CONTRIBUTING.md).*
   
   ## Summary
   
   Three independent changes for the simulator camera and the v4l2m2m codec 
drivers:
   
   - arch/sim: add dedicated camera loop interval config — add 
SIM_CAMERA_LOOP_INTERVAL so the camera loop interval can be tuned independently 
from the general SIM_LOOP_INTERVAL, and use it in sim_camera.c.
   - arch/sim: add sensor control ops to sim camera driver — implement 
get_supported_value/get_value/set_value for the sim camera sensor, exposing 
brightness and exposure controls with configurable ranges, so libcamera and 
V4L2 control enumeration work in the simulator.
   - arch/sim: fix encoder/decoder CAPTURE buffer leak on empty frame — when 
the x264 encoder accepts input but has no output yet (lookahead delay), or the 
decoder has no frame ready, the CAPTURE buffer taken from the pool was never 
returned, causing buffer starvation. Return it with bytesused = 0 so DQBUF 
hands it back to userspace, and cancel pending HPWORK on close to avoid a 
use-after-free callback.
   
   ## Impact
   
   - New Kconfig option SIM_CAMERA_LOOP_INTERVAL (default 10, unchanged 
behavior).
   - The sim camera sensor now advertises brightness/exposure controls.
   - The sim encoder/decoder no longer lose one CAPTURE buffer per empty frame. 
No API or struct layout changes.
   
   ## Testing
   
   - sim:nxcamera with SIM_CAMERA_LOOP_INTERVAL=25: nxcamera capture works (12 
frames written), and the new sensor control ops enumerate and round-trip 
correctly:
   
         nxcamera> query brightness
         brightness: min=-100 max=100 step=1 default=0
         nxcamera> set brightness 42
         nxcamera> get brightness
         brightness = 42
         nxcamera> query exposure
         exposure: min=1 max=10000 step=1 default=100
         nxcamera> set exposure 500
         nxcamera> get exposure
         exposure = 500
         nxcamera> query exposure_auto
         exposure_auto: min=0 max=3 step=1 default=0
   
   - With SIM_VIDEO_DECODER/ENCODER and OpenH264/libx264 enabled the image 
builds and links; nxcodec encode (8 frames, x264) and decode (59 frames, 
openh264) produce identical output with and without the leak fix (no 
regression). 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to