VideoTools/vendor/fyne.io/fyne/v2/driver/software/render.go
Stu Leak 68df790d27 Fix player frame generation and video playback
Major improvements to UnifiedPlayer:

1. GetFrameImage() now works when paused for responsive UI updates
2. Play() method properly starts FFmpeg process
3. Frame display loop runs continuously for smooth video display
4. Disabled audio temporarily to fix video playback fundamentals
5. Simplified FFmpeg command to focus on video stream only

Player now:
- Generates video frames correctly
- Shows video when paused
- Has responsive progress tracking
- Starts playback properly

Next steps: Re-enable audio playback once video is stable
2026-01-07 22:20:00 -05:00

32 lines
886 B
Go

package software
import (
"image"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/internal/app"
)
// RenderCanvas takes a canvas and renders it to a regular Go image using the provided Theme.
// This is the same as setting the application theme and then calling Canvas.Capture().
func RenderCanvas(c fyne.Canvas, t fyne.Theme) image.Image {
fyne.CurrentApp().Settings().SetTheme(t)
app.ApplyThemeTo(c.Content(), c)
return c.Capture()
}
// Render takes a canvas object and renders it to a regular Go image using the provided Theme.
// The returned image will be set to the object's minimum size.
// Use the theme.LightTheme() or theme.DarkTheme() to access the builtin themes.
func Render(obj fyne.CanvasObject, t fyne.Theme) image.Image {
fyne.CurrentApp().Settings().SetTheme(t)
c := NewCanvas()
c.SetPadded(false)
c.SetContent(obj)
app.ApplyThemeTo(obj, c)
return c.Capture()
}