mirror of
https://github.com/bluenviron/mediamtx.git
synced 2025-12-20 02:00:05 -08:00
rpi: rename rpiCameraProfile into rpiCameraH264Profile, rpiCameraLevel into rpiCameraH264Level (#3965) (#4785)
This commit is contained in:
parent
1cabc382b0
commit
0fe12f8bf6
5 changed files with 66 additions and 52 deletions
|
|
@ -452,9 +452,9 @@ components:
|
|||
type: integer
|
||||
rpiCameraBitrate:
|
||||
type: integer
|
||||
rpiCameraProfile:
|
||||
rpiCameraHardwareH264Profile:
|
||||
type: string
|
||||
rpiCameraLevel:
|
||||
rpiCameraHardwareH264Level:
|
||||
type: string
|
||||
rpiCameraMJPEGQuality:
|
||||
type: integer
|
||||
|
|
|
|||
|
|
@ -77,8 +77,8 @@ func TestConfFromFile(t *testing.T) {
|
|||
RPICameraCodec: "auto",
|
||||
RPICameraIDRPeriod: 60,
|
||||
RPICameraBitrate: 5000000,
|
||||
RPICameraProfile: "main",
|
||||
RPICameraLevel: "4.1",
|
||||
RPICameraHardwareH264Profile: "main",
|
||||
RPICameraHardwareH264Level: "4.1",
|
||||
RPICameraMJPEGQuality: 60,
|
||||
RunOnDemandStartTimeout: 5 * Duration(time.Second),
|
||||
RunOnDemandCloseAfter: 10 * Duration(time.Second),
|
||||
|
|
|
|||
|
|
@ -191,8 +191,10 @@ type Path struct {
|
|||
RPICameraCodec string `json:"rpiCameraCodec"`
|
||||
RPICameraIDRPeriod uint `json:"rpiCameraIDRPeriod"`
|
||||
RPICameraBitrate uint `json:"rpiCameraBitrate"`
|
||||
RPICameraProfile string `json:"rpiCameraProfile"`
|
||||
RPICameraLevel string `json:"rpiCameraLevel"`
|
||||
RPICameraProfile *string `json:"rpiCameraProfile,omitempty"` // deprecated
|
||||
RPICameraLevel *string `json:"rpiCameraLevel,omitempty"` // deprecated
|
||||
RPICameraHardwareH264Profile string `json:"rpiCameraHardwareH264Profile"`
|
||||
RPICameraHardwareH264Level string `json:"rpiCameraHardwareH264Level"`
|
||||
RPICameraJPEGQuality *uint `json:"rpiCameraJPEGQuality,omitempty"` // deprecated
|
||||
RPICameraMJPEGQuality uint `json:"rpiCameraMJPEGQuality"`
|
||||
RPICameraPrimaryName string `json:"-"` // filled by Check()
|
||||
|
|
@ -255,8 +257,8 @@ func (pconf *Path) setDefaults() {
|
|||
pconf.RPICameraCodec = "auto"
|
||||
pconf.RPICameraIDRPeriod = 60
|
||||
pconf.RPICameraBitrate = 5000000
|
||||
pconf.RPICameraProfile = "main"
|
||||
pconf.RPICameraLevel = "4.1"
|
||||
pconf.RPICameraHardwareH264Profile = "main"
|
||||
pconf.RPICameraHardwareH264Level = "4.1"
|
||||
pconf.RPICameraMJPEGQuality = 60
|
||||
|
||||
// Hooks
|
||||
|
|
@ -495,16 +497,28 @@ func (pconf *Path) validate(
|
|||
return fmt.Errorf("invalid 'rpiCameraAfSpeed' value")
|
||||
}
|
||||
|
||||
switch pconf.RPICameraProfile {
|
||||
case "baseline", "main", "high":
|
||||
default:
|
||||
return fmt.Errorf("invalid 'rpiCameraProfile' value")
|
||||
if pconf.RPICameraProfile != nil {
|
||||
l.Log(logger.Warn, "parameter 'rpiCameraProfile' is deprecated"+
|
||||
" and has been replaced with 'rpiCameraHardwareH264Profile'")
|
||||
pconf.RPICameraHardwareH264Profile = *pconf.RPICameraProfile
|
||||
}
|
||||
|
||||
switch pconf.RPICameraLevel {
|
||||
if pconf.RPICameraLevel != nil {
|
||||
l.Log(logger.Warn, "parameter 'rpiCameraLevel' is deprecated"+
|
||||
" and has been replaced with 'rpiCameraHardwareH264Level'")
|
||||
pconf.RPICameraHardwareH264Level = *pconf.RPICameraLevel
|
||||
}
|
||||
|
||||
switch pconf.RPICameraHardwareH264Profile {
|
||||
case "baseline", "main", "high":
|
||||
default:
|
||||
return fmt.Errorf("invalid 'rpiCameraHardwareH264Profile' value")
|
||||
}
|
||||
|
||||
switch pconf.RPICameraHardwareH264Level {
|
||||
case "4.0", "4.1", "4.2":
|
||||
default:
|
||||
return fmt.Errorf("invalid 'rpiCameraLevel' value")
|
||||
return fmt.Errorf("invalid 'rpiCameraHardwareH264Level' value")
|
||||
}
|
||||
|
||||
if pconf.RPICameraJPEGQuality != nil {
|
||||
|
|
|
|||
|
|
@ -71,8 +71,8 @@ func paramsFromConf(logLevel conf.LogLevel, cnf *conf.Path) params {
|
|||
Codec: cnf.RPICameraCodec,
|
||||
IDRPeriod: uint32(cnf.RPICameraIDRPeriod),
|
||||
Bitrate: uint32(cnf.RPICameraBitrate),
|
||||
Profile: cnf.RPICameraProfile,
|
||||
Level: cnf.RPICameraLevel,
|
||||
Profile: cnf.RPICameraHardwareH264Profile,
|
||||
Level: cnf.RPICameraHardwareH264Level,
|
||||
SecondaryWidth: uint32(cnf.RPICameraSecondaryWidth),
|
||||
SecondaryHeight: uint32(cnf.RPICameraSecondaryHeight),
|
||||
SecondaryFPS: float32(cnf.RPICameraSecondaryFPS),
|
||||
|
|
|
|||
|
|
@ -618,10 +618,10 @@ pathDefaults:
|
|||
rpiCameraIDRPeriod: 60
|
||||
# Bitrate (when codec is hardwareH264 or softwareH264).
|
||||
rpiCameraBitrate: 5000000
|
||||
# H264 profile (baseline, main or high).
|
||||
rpiCameraProfile: main
|
||||
# H264 level (4.0, 4.1 or 4.2).
|
||||
rpiCameraLevel: '4.1'
|
||||
# Hardware H264 profile (baseline, main or high) (when codec is hardwareH264).
|
||||
rpiCameraHardwareH264Profile: main
|
||||
# Hardware H264 level (4.0, 4.1 or 4.2) (when codec is hardwareH264).
|
||||
rpiCameraHardwareH264Level: '4.1'
|
||||
# M-JPEG JPEG quality (when codec is mjpeg).
|
||||
rpiCameraMJPEGQuality: 60
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue