Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feat]修正ps ptz速度错误 #95

Merged
merged 1 commit into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion document/gb28181.md
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ Method: POST
"channel_id": <string>, // 通道ID
"iris_in": <bool>, // 光圈小
"iris_out": <bool> // 光圈大
"focus_near": <bool> // 聚焦远
"focus_near": <bool> // 聚焦近
"focus_far": <bool> // 聚焦远
"speed": <int> // 步长,1~8
}
Expand Down
7 changes: 4 additions & 3 deletions gb28181/ptz.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,11 @@ func (p *Ptz) Pack() string {
buf[0] = PTZFirstByte
buf[1] = getAssembleCode()
buf[2] = 0
if p.ZoomIn {
if p.ZoomOut {
buf[3] |= 1 << 5
}
if p.ZoomOut {

if p.ZoomIn {
buf[3] |= 1 << 4
}
if p.Up {
Expand All @@ -113,7 +114,7 @@ func (p *Ptz) Pack() string {
}
buf[4] = p.Speed
buf[5] = p.Speed
buf[6] = p.Speed
buf[6] = p.Speed << 4
getVerificationCode(buf)
return hex.EncodeToString(buf)
}
Expand Down
Loading