fix(player): clear canvas.Image File field to display GStreamer frames

Critical fix for Fyne canvas rendering:

Fyne's canvas.Image has two ways to display content:
1. File field (string path) - takes precedence
2. Image field (image.Image) - used if File is empty

When buildVideoPane creates canvas.Image with NewImageFromFile(),
it sets the File field. Later when frameDisplayLoop sets Image field,
Fyne still tries to render from File path, ignoring the Image data.

Fix: Clear img.File before setting img.Image in frameDisplayLoop.

This allows GStreamer frames to actually display on screen instead
of showing the static placeholder frame.

Without this fix:
- GStreamer extracts frames perfectly (confirmed by logs)
- Frames are set to img.Image and Refresh() is called
- But Fyne still renders the static file, not the dynamic frames

With this fix:
- img.File cleared, so Fyne uses img.Image field
- Dynamic GStreamer frames display in real-time
- Video playback now visible!
This commit is contained in:
Stu Leak 2026-01-09 21:26:21 -05:00
parent 6a604dbb35
commit b80dfdac9e

View File

@ -11398,6 +11398,8 @@ func (p *playSession) frameDisplayLoop() {
// Update UI on main thread
fyne.CurrentApp().Driver().DoFromGoroutine(func() {
if p.img != nil {
// Clear file reference so Fyne uses the Image field
p.img.File = ""
p.img.Image = frame
p.img.Refresh()
logging.Debug(logging.CatPlayer, "Frame %d updated (%.2fs, paused=%v, size=%dx%d)",