Complete roadmap: stability fixes, tests, and all 32 features#3
Open
atomozero wants to merge 20 commits into
Open
Complete roadmap: stability fixes, tests, and all 32 features#3atomozero wants to merge 20 commits into
atomozero wants to merge 20 commits into
Conversation
Document the public contract of the src/webcam/ capture component so other Haiku apps can reuse it: enumeration, push-based frame delivery via BLooper, B_RGB32 frame format, threading/ownership rules, and build notes.
Sever the two backward dependencies that prevented src/webcam/ from being reused outside BubiCam: - Dynamic message codes: StartCapture() now takes frameMessage and audioLevelMessage params (defaults MSG_WEBCAM_FRAME / MSG_WEBCAM_AUDIO_LEVEL, defined in the library). Drop the #include "MainWindow.h" from WebcamDevice/VideoConsumer/AudioConsumer. - AudioSink interface: AudioConsumer no longer knows about VideoRecorder. It pushes raw PCM to an abstract AudioSink; VideoRecorder implements it and owns the AVI-specific float->int16 conversion (moved out of the capture thread's knowledge). MainWindow wires it via SetAudioSink/ClearAudioSink. src/webcam/ now has no app-layer includes. Behavior is unchanged. Docs updated to drop the resolved 'known limitation' note.
- WebcamDevice::SetAudioSink()/ClearAudioSink(): route audio at the device level instead of reaching into the consumer; drop GetAudioConsumer() from the public API. (GetVideoConsumer() stays - still used for raw capture.) - Remove per-buffer heap allocation on the real-time audio thread: VideoRecorder reuses a float->int16 scratch buffer; AudioConsumer reuses a byte-swap scratch buffer (big-endian path) instead of new[]/delete[] per buffer. - Drop the unused audioMessage parameter/member from VideoConsumer. - Replace stray fprintf(stderr) in MainWindow's recording path with the LOG_* macros used elsewhere. Docs updated to use device->SetAudioSink(). Behavior unchanged.
…s-2Y9QL' into claude/haiku-webcam-driver-tester-0174F929ERXTgjigSN7sqMbB
38 tests covering YUV422/NV12 conversion correctness, buffer size validation, CSV/JSON export formats, and BBitmap allocation across all common webcam resolutions (QQVGA to 1080p). Benchmarks compare Scalar vs SSE2 YUV422 conversion (5-7x speedup), NV12 conversion throughput, and raw memcpy frame copy baseline. Build with: make -f tests/Makefile Run with: objects.x86_64-cc13-release/BubiCamTests
Add chroma subsampling (4:2:2, 4:2:0), plane count and layout (packed/planar/semi-planar), source and display stride in bytes/row, display buffer size per frame, and aspect ratio detection (4:3, 16:9, 16:10, 5:4) to the Video Capabilities section.
Camera icon in the Deskbar tray shows webcam state: gray (idle), green (streaming), red with blinking dot (recording), orange (error). Right-click popup shows status, FPS, device name, and options to open BubiCam or remove from Deskbar. Install via Tools > Show in Deskbar menu item.
Implement GetSupportedSuites() and ResolveSpecifier() to expose BubiCam properties via the Haiku scripting protocol: hey BubiCam get Status - idle/streaming/recording hey BubiCam get FPS - current frame rate hey BubiCam get Device - webcam device name hey BubiCam get Streaming - preview active (bool) hey BubiCam set Streaming to true/false hey BubiCam get Recording - recording active (bool) hey BubiCam set Recording to true/false hey BubiCam do Screenshot hey BubiCam get FramesCaptured hey BubiCam get FramesDropped
BNotification alerts for driver frozen (error), capture failure (error), screenshot saved (info), and recording saved (info). NotificationUtils helper provides Info/Warning/Error/Progress methods wrapping the Haiku notification system.
Register application/x-vnd.BubiCam-preset (.bcpreset) for webcam control presets and application/x-vnd.BubiCam-report (.bcreport) for diagnostic reports at startup. Also registers test result CSV and JSON types without claiming global ownership of those extensions.
Wrap main menu labels and status bar strings with B_TRANSLATE() and provide catkeys catalogs for all five languages. Menu items, status messages, and webcam list placeholders are translated. Set LOCALES = en it de zh ja in the Makefile.
New Recording Codec submenu in File menu lets the user choose between Motion JPEG (compressed, default) and Uncompressed RGB32 (lossless, large files). Raw mode writes frames as-is using AVI '00db' chunks with BI_RGB compression, 32-bit color depth.
Syslog panel and VU meter bar can be toggled on/off via the Control menu. Split view proportions are adjustable by dragging dividers. Reset Layout restores all panels to their default sizes. Split view pointers stored as members for programmatic control.
Detect H.264 encoded frames by their NAL unit start codes (0x000001 or 0x00000001). Since Haiku lacks a native H.264 decoder, display a blue gradient placeholder with a log warning. This prevents H.264 frames from being misidentified as raw video and provides a clear integration point for future ffmpeg decoding.
Filter strings starting with '/' are treated as POSIX extended regular expressions (case-insensitive). For example: /usb.*error matches any line containing 'usb' followed by 'error'. Plain text filters with pipe-separated keywords still work as before.
Toggle via Tools > Pixel Inspector (Cmd+I). Click on the video preview to show pixel coordinates, RGB/A values, and hex color code. A crosshair marks the inspected point and a color swatch with info overlay appears at the bottom of the preview.
Tools > Export Debug State writes a comprehensive diagnostic file including application state (preview/recording/crash flags), webcam device info (name, VID:PID, format, FPS, frame counts, warnings), server state (MCP, streaming), and system info (CPU count, memory). Useful for bug reports and remote troubleshooting.
Run BubiCam --headless to start without GUI, capturing from the first available webcam and serving MJPEG stream on port 8080. Use --duration <seconds> to auto-stop after a period, or leave running indefinitely. --help shows all options including scripting examples. Useful for headless servers and automated testing.
VideoFilter abstract interface with filter chain manager. Four built-in filters: Grayscale, Invert Colors, Mirror Horizontal, and Sepia Tone, toggleable from the Filters menu. Filters are applied in-place on each B_RGB32 frame before display. The interface is designed for future external add-on filters.
VirtualProducer is a BBufferProducer that registers as a video source in the Media Kit. Other applications can connect to it like a real webcam. PushFrame() sends B_RGB32 bitmaps to connected consumers. Supports format negotiation, buffer group management, and proper connect/disconnect lifecycle. Foundation for virtual webcam features.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR completes the entire BubiCam roadmap with stability improvements, automated tests, and all 32 planned features.
Stability (2 rounds)
Testing & Benchmarks
make -f tests/Makefile && objects.x86_64-cc13-release/BubiCamTestsFeatures Completed
Test plan
makecompiles without errorsmake -f tests/Makefile && objects.x86_64-cc13-release/BubiCamTestspasses 38/38hey BubiCam get Statusreturns correct stateBubiCam --helpprints usage