Add modular capture backends, resolution profiles, Wayland support

This commit is contained in:
Hoid 2026-02-14 10:00:19 +00:00
parent 3b363192f2
commit 80ba9b1b90
16 changed files with 2266 additions and 45 deletions

View file

@ -2,23 +2,27 @@
package d2r
import (
"fmt"
"image"
"git.cloonar.com/openclawd/iso-bot/pkg/plugin"
"git.cloonar.com/openclawd/iso-bot/pkg/engine/resolution"
)
// Plugin implements plugin.Plugin for D2R.
type Plugin struct {
config Config
services plugin.EngineServices
detector *Detector
reader *Reader
config Config
services plugin.EngineServices
detector *Detector
reader *Reader
resolutionRegistry *resolution.Registry
}
// New creates a new D2R plugin with default config.
func New() *Plugin {
return &Plugin{
config: DefaultConfig(),
resolutionRegistry: resolution.NewRegistry(),
}
}
@ -36,8 +40,14 @@ func (p *Plugin) Info() plugin.PluginInfo {
// Init initializes the plugin with engine services.
func (p *Plugin) Init(services plugin.EngineServices) error {
p.services = services
p.detector = NewDetector(p.config)
p.reader = NewReader(p.config)
// Register D2R resolution profiles
if err := RegisterProfiles(p.resolutionRegistry); err != nil {
return fmt.Errorf("failed to register D2R profiles: %w", err)
}
p.detector = NewDetector(p.config, services)
p.reader = NewReader(p.config, services)
return nil
}
@ -63,3 +73,8 @@ func (p *Plugin) DefaultLootFilter() plugin.LootFilter {
// TODO: Return default rule engine
return nil
}
// SupportedResolutions returns resolutions available for D2R.
func (p *Plugin) SupportedResolutions() []image.Point {
return p.resolutionRegistry.SupportedResolutions("d2r")
}