Skip to content

feat: 8 camera slots, multi-view up to 3x3 (#13) - #64

Merged
compot-dev merged 4 commits into
v2from
feat/eight-slots
Oct 12, 2026
Merged

compot-dev merged 4 commits into
v2from
feat/eight-slots

Conversation

@compot-dev

Copy link
Copy Markdown
Collaborator

Closes #13. Stacked on #63 (SurfaceView cells); the base will be switched to v2 once #63 is merged.

What changes

  • 8 camera slots; the menu row is Q, 1–8 (empty slots are grey, as before).
  • Multi-view (Q) shows a 2×2 grid while only slots 1–4 are used, and a 3×3 grid (the ninth cell stays black) once any of slots 5–8 has a URL. Cell index = slot index, so stored settings and the Quad audio choice stay compatible.
  • The grid is built when multi-view starts and when it resumes, so it follows slot changes. The resume path was missing in the first local build and the screen stayed black; that was found on the device and fixed before this PR.
  • READMEs: 8 slots, 2×2/3×3, a note on decoder limits and substreams; Only 4 camera slots is removed from Known limitations.
  • Tests: QuadGridTest (grid size), savedSlotIsClamped updated for 8 slots.

Feasibility on the device (AG-216, Android 10, local debug build, 8 slots filled with the main streams of the 4 lab cameras, i.e. each camera twice):

  • 8 sessions and 8 decoders started; 7 cells play. The 8th was the second connection to the XM camera, which accepts only one RTSP client (Socket closed); this is a camera limit, not an app limit.
  • 60 s with 7 streams: about 148 % CPU (of 400 %), no codec errors, no NAL drops, 1 GC per minute, no JNISurfaceTexture threads (fix: Quad cells render to SurfaceView (#61) #63). The two cells with the highest-resolution stream logged a queue overflow once each.

The CI build will be device-tested before merging.

@compot-dev
compot-dev changed the base branch from fix/quad-surfaceview to v2 October 12, 2026 17:31
@compot-dev

Copy link
Copy Markdown
Collaborator Author

Device test of the CI build fa5bb4a on the AG-216 (Android 10):

  • Menu row Q, 1–8; empty slots are grey; the active slot is highlighted.
  • 3×3 grid with all 8 slots playing at once: 8 cameras, H.264 and H.265, 1080p and above; 8 sessions, 8 decoders, no reconnects.
  • 30 s with the grid: about 136 % CPU (of 400 %), 0 queue overflows, 0 NAL drops, 0 codec errors, 0 logged GCs, no crash.
  • The 2×2 grid is still used while only slots 1–4 have URLs.
  • Settings survive the upgrade from v2 (slots 1–4 kept; 5–8 start empty).

Two cameras could not be used, and both are camera limits rather than app issues: the XM model accepts only one RTSP client, and one SSC335 camera answers PLAY but sends no RTP (the JPEG snapshot works).

The README screenshot is replaced by the 8-camera grid with the menu (3c5e39f).

@compot-dev

Copy link
Copy Markdown
Collaborator Author

/review

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0) 🎨 UX issues (0) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Later camera slots become unreachable ✓ Resolved
Description
MenuManager now creates eight camera buttons in a single, non-scrollable horizontal row inside a
wrap-content popup. When the row exceeds the available display width, its rightmost buttons extend
off-screen, so users on narrow displays or with larger text cannot select those slots through the
menu.
Code

android/app/src/main/java/com/openipc/decoder/MenuManager.java[38]

+    private static final int CAM_COUNT = Decoder.CAM_COUNT;
Evidence
The changed count drives the loop that adds eight individually selectable buttons to one horizontal
row. The popup and row use wrap-content widths, and the code provides no scrolling or wrapping when
that row is wider than the display.

android/app/src/main/java/com/openipc/decoder/MenuManager.java[36-39]
android/app/src/main/java/com/openipc/decoder/MenuManager.java[104-106]
android/app/src/main/java/com/openipc/decoder/MenuManager.java[144-151]
android/app/src/main/java/com/openipc/decoder/MenuManager.java[155-178]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Expanding the camera count adds buttons to a fixed horizontal menu row, leaving later slots off-screen when the row is wider than the display.
## Fix Focus Areas
- android/app/src/main/java/com/openipc/decoder/MenuManager.java[104-106]
- android/app/src/main/java/com/openipc/decoder/MenuManager.java[144-178]
## Recommended Fix
Give the camera row a width bounded by the available screen and make it horizontally scrollable or wrap its buttons into multiple rows. Verify that all eight slots remain selectable on narrow displays and with larger system text.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Tip of the day
💡 Did you know, you can commit Qodo's fix in one click with committable suggestions (GitHub & GitLab)

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

- CAM_COUNT is 8 in Decoder and MenuManager; the menu row is Q, 1-8
- Multi-view shows a 2x2 grid while only slots 1-4 are used, and a 3x3 grid (the
  ninth cell stays black) once any of slots 5-8 has a URL. Cell index = slot index,
  so stored settings and the Quad audio choice stay compatible
- The grid is built when multi-view starts or resumes, so it follows slot changes
- Tests: grid size, 8 slots, slot clamping up to 7; READMEs updated
On a narrow screen or with a large font the last slot buttons could end up off-screen
(Qodo). The row is now in a HorizontalScrollView, which also follows the focus when
moving with a remote.
@compot-dev

Copy link
Copy Markdown
Collaborator Author

Re Later camera slots become unreachable: fixed in 22a50f2. The slot row (Q, 1–8) is now inside a HorizontalScrollView, so every slot stays reachable on narrow screens and with large fonts, and the row follows the focus when moving with a remote. On the AG-216 at 1280×720 the row fits without scrolling. The branch is also rebased onto v2 after #65.

/review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only 4 camera slots

1 participant