Repository navigation
feat: per-slot Turn in the camera settings, H.264/H.265 turned by the decoder (#201) - #225
Conversation
PR Summary by QodoAdd per-slot camera rotation across video codecs
AI Description
Diagram
High-Level Assessment
Files changed (16)
|
Code Review by Qodo
1.
|
| RtspClient c = rtspClient; | ||
| videoDecoder.setRotation(c != null ? c.rotate() : 0); | ||
| videoDecoder.createDecoder(codecH265); |
There was a problem hiding this comment.
2. Reconnects can leave video unturned 🐞 Bug ≡ Correctness
createDecoder() and the grid decode path capture rotate() when creating a codec, but RtspSession.connect() temporarily resets URL-derived rotation to zero before the new stream description arrives. If a queued frame creates a decoder during that interval, the later description restores the rotation value without recreating the H.264/H.265 decoder, so that decoder keeps the wrong turn.
Agent Prompt
## Issue description
Queued frames can create a codec while reconnect has reset URL-derived rotation but has not yet parsed the new stream description.
## Fix Focus Areas
- android/app/src/main/java/com/openipc/decoder/RtspSession.java[330-334]
- android/app/src/main/java/com/openipc/decoder/Decoder.java[609-614]
- android/app/src/main/java/com/openipc/decoder/QuadCell.java[694-701]
## Recommended Fix
Prevent decoder creation from old queued frames during negotiation, or recreate an existing codec when the effective rotation established by the new stream description differs from its configured rotation.
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
…crolls, the log names the turn in effect (Qodo on #225)
|
Qodo findings, all fixed in 22f4d0a (checked locally in
|
|
/review |
|
Code review by qodo was updated up to the latest commit 22f4d0a |
|
Qodo, second round:
v2 merged in (#227). Checked locally in |
|
/review |
Thanks for the update. Based on the commits and validation you provided:
The published review may still show those findings as open until it is refreshed against the latest commit. |
|
Code review by qodo was updated up to the latest commit f2a3af4 |
…quarter turn (Qodo on #225)
|
Qodo, third round:
Checked locally in |
|
/review |
Thanks for the update. The reported fixes address finding 1 (grid dimensions) and finding 4 (reconnect rotation). The local |
| if (turn != 0 && !rotateLogged) { | ||
| rotateLogged = true; | ||
| Log.i(TAG, tag + ": MJPEG frames turned " + wanted + "\u00b0 counter-clockwise" | ||
| + " (#200; ?rotate=0 turns it off)"); | ||
| // MJPEG is turned while drawing (#200), H.264/H.265 by the decoder (#201) | ||
| Log.i(TAG, tag + ": " + (jpeg ? "MJPEG frames" : "video") + " turned " + turn | ||
| + "\u00b0 counter-clockwise" + (slot >= 0 ? " (the slot's Turn setting)" | ||
| : " (?rotate=0 or the slot's Turn 0\u00b0 turns it off)")); |
There was a problem hiding this comment.
6. Android 5 log and stats claim a turn that isn't shown 🐞 Bug ◔ Observability
RtspSession.rotation() logs "video turned N° counter-clockwise" for H.264/H.265 whenever the slot or URL turn is non-zero, and debugState() now reports rotate from rtspClient.rotate() for every codec. On Android 5, MediaCodecManager.createDecoder() skips KEY_ROTATION (appliedRotation = 0), so the picture is not turned while the log line and /stats.json (rotate, and the docs say size is the turned one) both say it is.
Agent Prompt
## Issue description
On Android < 6, H.264/H.265 are not turned (KEY_ROTATION is skipped), but the session log says "video turned N°" and /stats.json reports `rotate`.
## Fix Focus Areas
- android/app/src/main/java/com/openipc/decoder/RtspSession.java[694-705]
- android/app/src/main/java/com/openipc/decoder/Decoder.java[1629-1631]
## Recommended Fix
In `rotation()`, when `!jpeg && Build.VERSION.SDK_INT < M`, log that the turn is not applied on this Android version instead of claiming it is. In `debugState()`, report `rotate` for non-MJPEG streams only when `videoDecoder.swapsSides()` is true or the applied rotation is non-zero (for example, expose `appliedRotation` from MediaCodecManager).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
|
Code review by qodo was updated up to the latest commit fe08665 |
|
Qodo, fourth round: the five earlier findings are resolved.
Final head fe08665 checked on Aceline-1 with the CI build: |
Thanks for the update. The five earlier findings are resolved, and finding 6 remains intentionally open as a documented follow-up for Android 5 observability. The reported Aceline-1 validation and green CI support the current implementation. |
|
/review |
|
Code review by qodo was updated up to the latest commit 56790a5 |
Part of #201. Version 2.17 (merges before #220, which becomes 2.18). Mirror moved to #226.
?rotate=and the toys' defaults.MediaFormat.KEY_ROTATION, Android 6+), MJPEG by the hardware JPEG decoder the same way, or while drawing on the software path.?rotate=now works for every codec.Checked on Aceline-1 (CI build 056c794, 1080p H.265 camera):
/snapshot.jpgand the long-press screenshot (1080×1920 for 90/270) all have the same orientation;Not here: Mirror —
setScaleX(-1)on the SurfaceView does not mirror on the AG-216, needs a GL or TextureView path: #226.