Repository navigation
feat(camera): Jolla Camera UI on Marathon's lifecycle - #54
Draft
patrickjquinn wants to merge 6 commits into
Draft
patrickjquinn wants to merge 6 commits into
patrickjquinn wants to merge 6 commits into
Conversation
generate.py stopped with a KeyError at star-fill, which was drawn by hand because Phosphor Thin has no filled star, so no edit to icon-map.txt could be regenerated. It now leaves glyphs outside Phosphor's table as they are.
certificates, chat, sd-card, secure and sounds had no glyph, so they drew nothing and Lint_IconMap failed. Phosphor has no SD card; a hard drive stands in for storage.
libcamerasrc connected the camera's requestCompleted signal when it opened the camera and never disconnected it. The camera outlives the element, so a camera app that stops and starts its camera crashed on the first restart: reopened, every request completed twice (an assertion in GstLibcameraSrcState::requestCompleted); recreated, the freed element was called. Patch 0008 disconnects it on close; libcamera r2. With it the Q25's Camera app keeps streaming through gallery, background, camera-switch and photo/video restarts.
Every frame went through QVideoFrame::toImage(), which converts through the GPU, and then convertToFormat(), both on the GUI thread. At 30 fps that kept the Q25's GUI thread busy enough that the camera app sometimes drew nothing at all. Frames are converted on the thread that delivers them, and RGB frames are copied from the mapped buffer as they are; only the repaint is queued to the GUI thread. With the camera running the GUI thread went from about 80% to 7% of a core.
The camera app's controls come from the Jolla Camera and ask for Sailfish's icon-camera-* names: flash, timer, grid, capture mode, switch, reset, the video shutter, and the modes and white balances it shows when a camera offers them. Each maps to a Phosphor glyph, at the size Sailfish draws it. imaging and qr are the high-resolution and QR switches' icons.
The Camera app takes Shipwright's Jolla Camera controls in place of its own basic page: the shutter, the photo and video menu, the front and back switch, the settings panel pulled down from the top (timer, grid, and flash, exposure modes and white balance where the camera has them), the button layout editor, the recording pill and the camera roll beside the viewfinder, with the Jolla cover. Those QML files are the Jolla Camera's, BSD-3-Clause (LICENSE.BSD-3-Clause, installed with the app), with Shipwright's Qt 6 and Keel changes and without its own features. Marathon supplies the rest: - Camera, CameraRecorder, CameraImageProcessing, CameraConfigs and VideoOutput give that QML the Qt 5 Multimedia API it is written against, over CameraController. A control the camera lacks is not offered: exposure compensation is hidden (the software ISP ignores ExposureValue), and focus is fixed. - SettingsBase and CaptureModel put captures where Captures does (~/Pictures/Marathon); the roll is that folder, and Captures can now delete any capture, not just the latest. - The roll's controls (delete, share, open Gallery) and its video playback are Marathon's own. - CameraApp keeps Marathon's lifecycle: activity follows the shell's applicationActive, back closes the settings panel, then the roll, then leaves the app, the camera waits for the first frame, a recording holds a "recording" background task, and camera.open and camera.capture still answer. CameraController lists each camera with a stable id, its side and its mounting rotation (from the sensor's device tree node where Qt has none), sets the viewfinder format, restarts the camera for a format change (libcamerasrc cannot renegotiate), turns photos upright and writes them whole before they show in the roll, and restarts a camera that is active but sends no frames. Videos stay as the sensor delivers them: Qt 6.11's GStreamer recorder crashes on an orientation tag. Tested on the Zinwa Q25 (front IMX111, back S5KJN1): photos and H.264 video from both cameras, photo and video switches, the camera switch, the settings panel, the roll (delete, back to the viewfinder), back from the roll and leaving and returning to the app with one process throughout, camera.open and camera.capture over D-Bus, and the cover.
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.
Stacked on #53. Replaces the Camera app's basic page with the Jolla Camera's controls, taken from Shipwright's port, on Marathon's lifecycle.
UI
apps/camera/LICENSE.BSD-3-Clauseinstalled with the app): the shutter, the photo/video menu, the front/back switch, the pull-down settings panel (timer, grid; flash, exposure modes and white balance where a camera has them), the button layout editor, the recording timer, the swipe-across camera roll and the cover. Shipwright's proprietary files are not included.Camera,CameraConfigs,CameraRecorder,CameraImageProcessing,VideoOutput,SettingsBaseandCaptureModelgive that QML the Qt 5 Multimedia API it expects, overCameraController; the roll's delete/share/Open Gallery controls and video playback.ExposureValue) and focus is fixed.icon-camera-*names map to Phosphor glyphs.Lifecycle
applicationActive; the camera waits for the first frame.recordingbackground task.camera.openandcamera.capturestill answer.CameraController
Capturescan delete any capture.libcamera r2 (patch 0008): libcamerasrc never disconnected
requestCompletedwhen it closed the camera, so any in-process restart (background/return, roll and back, camera or format switch) crashed the app.Also:
generate.pyno longer stops at hand-drawn glyphs, and Reef's package page icons are mapped (Lint_IconMapwas failing).Tested on the Zinwa Q25 (front IMX111, back S5KJN1): photos and H.264 video from both cameras, photo/video and camera switches, the settings panel, deleting from the roll, back from the roll, leaving and returning (one process throughout),
camera.open/camera.captureover D-Bus, the cover.Known gaps