Skip to content

feature/PNG-Decoding-Support,Video Player,AVI-Decoding,Hostshare#14

Open
SXnell wants to merge 5 commits intoviralcode:mainfrom
SXnell:main
Open

feature/PNG-Decoding-Support,Video Player,AVI-Decoding,Hostshare#14
SXnell wants to merge 5 commits intoviralcode:mainfrom
SXnell:main

Conversation

@SXnell
Copy link

@SXnell SXnell commented Jan 23, 2026

PNG decode pipeline

Added media_decode_png_buffer() with size/overflow checks and optional caller‑provided buffer support to match the JPEG API.
Switched PNG output to 0xAARRGGBB and preserved alpha per pixel; JPEG output now forces A=0xFF for consistency.
Added safeguards for oversized images in both PNG and JPEG paths.
Rendering + blending

Introduced a small alpha‑blend helper to composite PNG pixels onto the existing RGB framebuffer.
Applied blending in:
Image Viewer draw path (including scaled/rotated render)
Wallpaper rendering (blends PNG onto gradient background)
Wallpaper thumbnails in Settings
Dock icons (PNG RGBA arrays)
Image Viewer toolbar icons (RGBA arrays)
System assets / RAMFS seeding

Added wallpaper.png to the bootstrap asset generator.
Embedded wallpaper.png as a C asset and seeded wallpaper.png at boot.
Switched wallpaper selection to prefer wallpaper.png.
UI + UX

Terminal view command now accepts .png files (help text + validation).
README updated to document PNG support and decoder attribution.
Generated assets

Generated bootstrap_wallpaper_png.c.
Regenerated existing JPEG bootstrap assets as part of the asset pipeline run (if applicable).
Tested on M4 Mac, QEMU virt machine on ARM64 (Cortex‑A72), QEMU ramfb 1024x768

@SXnell
Copy link
Author

SXnell commented Jan 23, 2026

Screenshot 2026-01-23 at 11 42 13 pm

@SXnell SXnell deleted the branch viralcode:main January 24, 2026 16:50
@SXnell SXnell closed this Jan 24, 2026
@SXnell SXnell deleted the main branch January 24, 2026 16:50
@SXnell SXnell restored the main branch January 24, 2026 16:52
@SXnell SXnell reopened this Jan 24, 2026
@SXnell
Copy link
Author

SXnell commented Jan 24, 2026

oops sorry, new to github!

@SXnell SXnell changed the title PNG Decoding Support feature/PNG Decoding Support Jan 24, 2026
@SXnell SXnell deleted the branch viralcode:main January 25, 2026 07:21
@SXnell SXnell closed this Jan 25, 2026
@SXnell SXnell deleted the main branch January 25, 2026 07:21
@SXnell SXnell restored the main branch January 25, 2026 07:21
@SXnell SXnell reopened this Jan 25, 2026
@SXnell SXnell changed the title feature/PNG Decoding Support feature/PNG-Decoding-Support,Video Player,AVI-Decoding,Hostshare Jan 26, 2026
@SXnell
Copy link
Author

SXnell commented Jan 26, 2026

This PR adds a basic in-OS video playback experience (MJPEG-in-AVI, video-only) and a smooth host-to-OS workflow for importing and testing videos via QEMU virtio-9p hostshare. It also improves hostshare browsing reliability and integrates .avi launching from the File Manager.

Key Features

Video Player app (MJPEG AVI)

Plays MJPEG-in-AVI in a window with fullscreen support.
Controls: Play/Pause, seek, next/prev playlist, numeric selection.
Opens .avi directly from the File Manager.
Hostshare integration (virtio-9p)

Adds /Host/ (hostshare root) and /Videos/Host/ (hostshare Videos) access from the File Manager.
More robust directory listing for QEMU 9P2000.L (Treaddir/Rreaddir) and improved stability/diagnostics.
Host video sync + conversion

Adds hostshare-sync-videos.sh invoked by make run-gui / make run-gpu.
Scans hostshare/Videos/ for AVI, auto-converts non‑MJPEG AVIs to MJPEG into hostshare/Videos/_mjpg/, and regenerates videos.txt.
Boot-time import into /Videos/

On boot, imports playlist entries from videos.txt into the OS /Videos/ folder.
Converted _mjpg files are imported under the original .avi name for a cleaner UX.
Transparent playback fallback

If an original host .avi isn’t MJPEG, the player automatically tries the converted _mjpg version when available.
How To Test

Put any AVI files into hostshare/Videos/ on the host.
Run: make run-gui or make run-gpu
In Vib‑OS:
Browse /Videos/ (imported copies) or /Host/Videos/ (direct host files).
Double-click an .avi to open in Video Player.
Verify playback + controls (Space/P, [ ], B/N, F, < >, 1-9).
Notes / Limitations

Playback is currently MJPEG-in-AVI (video only). “Standard” AVI codecs (H.264/DivX/etc.) are supported through host-side conversion, not native decoding yet.
Hostshare is read-only by design in this dev workflow.
Files / Areas Touched

Video player + File Manager launch integration: window.c
AVI MJPEG demuxer: avi.c, avi.h
Hostshare import on boot + docs: main.c
Virtio-9p client improvements: virtio_9p.c, virtio_9p.h
Host sync/conversion script + run targets: hostshare-sync-videos.sh, Makefile
Hostshare docs: README.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant