Skip to main content

Crate moq_ext_egui

Crate moq_ext_egui 

Source
Expand description

Video views for egui, on top of [moq_ext_player].

The views draw decoded frames through the wgpu renderer in moq_video::render. They need an egui_wgpu::RenderState. A view without one shows a black placeholder.

This draws a player’s video:

use moq_ext_egui::VideoView;

let mut view = VideoView::new(ctx, "video", player.video_frames(), render_state);
// in the update loop:
ui.add(view.render());

VideoView draws a [VideoFrames] stream, and FrameView the frames you hand it. overlay::DebugOverlay paints stats over a video. Pending runs a task, such as a dial, whose result a window collects on a later frame.

Open the window with egui_wgpu_config as eframe’s wgpu_options. Without it, eframe builds a device that cannot import DMA-BUF frames on Linux, so hardware-decoded video and screen capture are copied through the CPU, and a GPU with small limits, such as the Raspberry Pi 4, fails to open the window:

ⓘ
let options = eframe::NativeOptions {
    wgpu_options: moq_ext_egui::egui_wgpu_config(),
    ..Default::default()
};

Re-exports§

pub use egui_wgpu;
pub use egui_wgpu::wgpu;

Modules§

overlay
Translucent stats bars painted over video.

Structs§

FrameView
A view that draws the frames you hand it.
Pending
A task whose one result a window collects on a later frame.
VideoView
A view that draws a [VideoFrames] stream.

Functions§

egui_wgpu_config
Creates an egui_wgpu::WgpuConfiguration for video rendering.
format_bitrate
Formats a bitrate as 1.5 Mbps, 320 kbps or 64 bps.