Skip to content

Commit

Permalink
rpi: add rpiCameraFlickerPeriod (#3463)
Browse files Browse the repository at this point in the history
  • Loading branch information
aler9 committed Aug 18, 2024
1 parent c5059fa commit 9c72aca
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apidocs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ components:
type: number
rpiCameraExposure:
type: string
rpiCameraFlickerPeriod:
type: string
rpiCameraAWB:
type: string
rpiCameraAWBGains:
Expand Down
1 change: 1 addition & 0 deletions internal/conf/conf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func TestConfFromFile(t *testing.T) {
RPICameraSaturation: 1,
RPICameraSharpness: 1,
RPICameraExposure: "normal",
RPICameraFlickerPeriod: "auto",
RPICameraAWB: "auto",
RPICameraAWBGains: []float64{0, 0},
RPICameraDenoise: "off",
Expand Down
2 changes: 2 additions & 0 deletions internal/conf/path.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ type Path struct {
RPICameraSaturation float64 `json:"rpiCameraSaturation"`
RPICameraSharpness float64 `json:"rpiCameraSharpness"`
RPICameraExposure string `json:"rpiCameraExposure"`
RPICameraFlickerPeriod string `json:"rpiCameraFlickerPeriod"`
RPICameraAWB string `json:"rpiCameraAWB"`
RPICameraAWBGains []float64 `json:"rpiCameraAWBGains"`
RPICameraDenoise string `json:"rpiCameraDenoise"`
Expand Down Expand Up @@ -205,6 +206,7 @@ func (pconf *Path) setDefaults() {
pconf.RPICameraSaturation = 1
pconf.RPICameraSharpness = 1
pconf.RPICameraExposure = "normal"
pconf.RPICameraFlickerPeriod = "auto"
pconf.RPICameraAWB = "auto"
pconf.RPICameraAWBGains = []float64{0, 0}
pconf.RPICameraDenoise = "off"
Expand Down
1 change: 1 addition & 0 deletions internal/core/path_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func pathConfCanBeUpdated(oldPathConf *conf.Path, newPathConf *conf.Path) bool {
clone.RPICameraSaturation = newPathConf.RPICameraSaturation
clone.RPICameraSharpness = newPathConf.RPICameraSharpness
clone.RPICameraExposure = newPathConf.RPICameraExposure
clone.RPICameraFlickerPeriod = newPathConf.RPICameraFlickerPeriod
clone.RPICameraAWB = newPathConf.RPICameraAWB
clone.RPICameraAWBGains = newPathConf.RPICameraAWBGains
clone.RPICameraDenoise = newPathConf.RPICameraDenoise
Expand Down
1 change: 1 addition & 0 deletions internal/staticsources/rpicamera/params.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ type params struct {
Saturation float64
Sharpness float64
Exposure string
FlickerPeriod string
AWB string
AWBGainRed float64
AWBGainBlue float64
Expand Down
1 change: 1 addition & 0 deletions internal/staticsources/rpicamera/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ func paramsFromConf(logLevel conf.LogLevel, cnf *conf.Path) params {
Saturation: cnf.RPICameraSaturation,
Sharpness: cnf.RPICameraSharpness,
Exposure: cnf.RPICameraExposure,
FlickerPeriod: cnf.RPICameraFlickerPeriod,
AWB: cnf.RPICameraAWB,
AWBGainRed: cnf.RPICameraAWBGains[0],
AWBGainBlue: cnf.RPICameraAWBGains[1],
Expand Down
2 changes: 2 additions & 0 deletions mediamtx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -527,6 +527,8 @@ pathDefaults:
# exposure mode.
# values: normal, short, long, custom
rpiCameraExposure: normal
# Manual flicker correction period
rpiCameraFlickerPeriod: auto
# auto-white-balance mode.
# values: auto, incandescent, tungsten, fluorescent, indoor, daylight, cloudy, custom
rpiCameraAWB: auto
Expand Down

0 comments on commit 9c72aca

Please sign in to comment.