Repository navigation
Letting an empty text clear an overlay region - #75
Conversation
doc/overlays.md says an empty string clears a region (/api/osd/1?text=), but the /api/osd query loop skips every key with an empty value, so text= did nothing: the region kept its text, the API went on reporting it, and it stayed on the stream until Divinus restarted. An empty text is now accepted and clears the text, which lets the region thread's existing removal path run; every other key still needs a value. The web page's Apply sends text= for an emptied field, so it clears the region too. Tested on an Ambarella S3L camera (HAL not upstream yet), H.264 over RTSP: text=OSDTEST drawn, text= removes it (the API reports ""), new text draws again, the web page's full query with text= and other empty fields removes it, and a $t time region is removed the same way.
PR Summary by QodoAllow empty text to clear an OSD overlay
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Reading a cleared overlay keeps it visible
|
doc/overlays.mdsays an empty string clears a region (/api/osd/1?text=), but the/api/osdquery loop skipped every key with an empty value. Sotext=did nothing: the region kept its text, the API kept reporting it, and it stayed on the stream until Divinus restarted. An emptytextnow clears the text, and the region thread's existing removal path takes it off the stream. Every other key still needs a value. The web page's Apply sendstext=for an emptied field, so clearing it there works too.Tested on an Ambarella S3L camera (HAL in #71), H.264 over RTSP, checking a frame from the stream after each request:
?text=OSDTEST&size=96&pos=100,100?text="text":"OSDTEST""text":""?text=AGAINimg=&font=…&size=&text=&…&outl=&thick=?text=$t, then?text=A region left with neither text nor image takes the default style (
region_defaults()) on its next request, as before, so text set again after clearing comes back at the default size and colour unless the request sets them.It also builds on master with the S3L toolchain. It touches only
src/server.c, so every platform picks it up.