Commit 2c3e5c4
Extract RecordingPipeline from CameraViewController (UI modernization PR 9) (#132)
* Extract RecordingPipeline from CameraViewController (UI modernization PR 9)
Mechanical move, no behavior/threading changes: RecordingPipeline (non-UI)
now owns the asset writer and its inputs, the six-boolean recording state
machine, the writing queue, per-frame write/crop, and saving/sending the
finished movie. The VC stays the sample-buffer delegate (captureOutput fans
out to the frame streamers, which are live preview, not recording) and keeps
the microphone-permission flow, forwarding recording frames to the pipeline.
Seams: sendMessage (actor relay for the start ack, stop response and video
resource — captures the session ref, not the VC), onRecordingStarted/Stopped
(timer overlay), onModeChanged (idle vs recording chrome), onError,
onPhotosAccessDenied.
CameraViewController: 962 -> 632 lines. New device-free tests cover asset
writer input setup including the even-rounded 4:3 crop rect and the
stop-while-idle guard. 385/385 tests green (381 + 4 new).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
* Apply review fixes to the RecordingPipeline extraction
New-code cleanups from the senior Swift review: tighten access control on
the pipeline (assetWriter/videoCropContext/writeSampleBuffer private,
pixelBufferAdaptor/cachedVideoCropRect private(set)), document that onError
fires on the writing queue, name the idle condition at both onModeChanged
call sites, and use XCTUnwrap instead of force-unwraps in the tests.
Also three pre-existing one-liners the extraction surfaced: guard the
missing-microphone case so it reaches the record-without-audio fallback
instead of crashing on audioDevice!, wire the silent startWriting() failure
to onError, and drop two DEBUG prints from production paths.
385/385 tests green.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent 70cd5ee commit 2c3e5c4
6 files changed
Lines changed: 612 additions & 377 deletions
File tree
- Docs
- RemoteCamTests
- RemoteCam
- RemoteShutter.xcodeproj
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
| 143 | + | |
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
156 | | - | |
157 | | - | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
158 | 173 | | |
159 | 174 | | |
160 | 175 | | |
| |||
283 | 298 | | |
284 | 299 | | |
285 | 300 | | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
0 commit comments