Skip to content

Played media through GStreamer - #19

Closed
colemancda wants to merge 12 commits into
masterfrom
feature/media
Closed

colemancda wants to merge 12 commits into
masterfrom
feature/media

Conversation

@colemancda

Copy link
Copy Markdown
Member

Adds LinuxMedia, the media player contract (AppRuntime's MediaPlayer.md), so a guest's MediaPlayer plays and its VideoPlayer shows the picture.

  • The engine. AppRuntime's shared HostMediaPlayback, over a MediaEngine per player that is a GStreamer playbin.
    • GStreamer is opened at run time, as WPE WebKit is, so the host builds without its headers. Without it, every source fails as unavailable.
    • The pictures go to an appsink as RGBA, with at most two waiting and late ones dropped.
    • The sound goes to playbin's own sink.
  • The main loop. It runs every engine while it has a pipeline: it reads the bus, takes the newest picture and reports the time. No GLib main loop runs, and no GStreamer thread touches the UI.
  • Coverage: loading (length, streams, first picture), play and pause, accurate seeking, rate, volume and mute, looping, buffering for network sources, the end, and errors mapped to the contract's codes. canPlay answers from the plugins found.
  • HostVideoView in LinuxUI draws VideoPlayer nodes, scaled by scaling. Its controls (play and pause, a scrubber, the time) hide after three seconds of playing and come back with a tap. controls: .none shows the picture alone.
  • Registration: in linux-app-host and the packager, which now accepts the audio capability.
  • Docs and installs: Plan.md §15 describes it (the sections after it are renumbered), and the README lists it. CI and the Dockerfile install libgstreamer1.0-0 and the base, good and libav plugins.

Checked on Debian 13 x86_64 with GStreamer 1.26:

  • A probe guest built with guest.py for linux-x86_64 played a 640 × 360 H.264 and AAC MP4 from its bundle through linux-app-host, offscreen.
  • It reported ready, 640 × 360, with audio, 0:10 long. The picture advanced in time, the controls hid while playing, and onEnd fired at the end.
  • swift test passes.

Building a guest for x86_64 Linux needs PureSwift/AppRuntime#36.

Not yet:

  • Hardware decoding (VA-API).
  • Now-playing and the media keys (MPRIS), and background playback.
  • Interruptions and unplugged headphones.
  • Pictures are copied at their full size each frame, which a large video makes costly.
  • Seeking, rate, looping, network sources and sound output haven't been tried; the run was offscreen.

@colemancda

Copy link
Copy Markdown
Member Author

Opened by mistake: this branch already exists with other work (PR #18 is merged from it), and the push of a separate local branch of the same name was rejected, so this PR shows that branch's later commits under the wrong description. Closing; nothing here needs review.

@colemancda colemancda closed this Nov 23, 2026
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