Skip to content

Commit 52f074c

Browse files
committed
docs/tests: address follow-up review comments
1 parent e9984e9 commit 52f074c

3 files changed

Lines changed: 22 additions & 17 deletions

File tree

docs/content/c-interface.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,7 @@ bool frame_callback(const CcapVideoFrame* frame, void* userData) {
138138
ccap_provider_set_new_frame_callback(provider, frame_callback, NULL);
139139
```
140140
141-
### 7. Cleanup Resources
142-
143-
```c
144-
// Stop capture
145-
ccap_provider_stop(provider);
146-
147-
// Close device
148-
ccap_provider_close(provider);
149-
150-
// Destroy provider
151-
ccap_provider_destroy(provider);
152-
```
153-
154-
### 8. Optional: Video Writing (Windows/macOS)
141+
### 7. Optional: Video Writing (Windows/macOS)
155142
156143
When built with `CCAP_ENABLE_VIDEO_WRITER=ON`, the C API can write camera frames to MP4/MOV files.
157144
@@ -186,6 +173,19 @@ if (writer) {
186173
}
187174
```
188175

176+
### 8. Cleanup Resources
177+
178+
```c
179+
// Stop capture
180+
ccap_provider_stop(provider);
181+
182+
// Close device
183+
ccap_provider_close(provider);
184+
185+
// Destroy provider
186+
ccap_provider_destroy(provider);
187+
```
188+
189189
## Complete Example
190190
191191
See `examples/ccap_c_example.c` for a complete usage example.

docs/content/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ if (provider.open("", true)) {
217217
}
218218
```
219219

220-
Writer input supports `NV12`, `I420`, `BGR24`, and `BGRA32`.
220+
Writer input supports `NV12`, `NV12f`, `I420`, `I420f`, `BGR24`, and `BGRA32`.
221221

222222
`VideoFrame::orientation` is honored by the writer path, including `BottomToTop` frames common on Windows RGB capture.
223223

tests/test_video_writer.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -692,11 +692,16 @@ TEST_F(VideoWriterCTest, BottomToTopFramesRoundTripUpright) {
692692
// Helper: locate the built-in test video by walking up from CWD to find the project root
693693
static fs::path findTestVideo() {
694694
fs::path projectRoot = fs::current_path();
695-
while (projectRoot.has_parent_path()) {
695+
while (true) {
696696
if (fs::exists(projectRoot / "CMakeLists.txt") && fs::exists(projectRoot / "tests")) {
697697
break;
698698
}
699-
projectRoot = projectRoot.parent_path();
699+
700+
const fs::path parent = projectRoot.parent_path();
701+
if (parent.empty() || parent == projectRoot) {
702+
break;
703+
}
704+
projectRoot = parent;
700705
}
701706
return projectRoot / "tests" / "test-data" / "test.mp4";
702707
}

0 commit comments

Comments
 (0)