mirror of
https://github.com/amitbet/vnc2video.git
synced 2025-09-19 17:14:15 +00:00
Merge branch 'fix-renderer-init' of https://github.com/gyuchang/vnc2video
This commit is contained in:
@@ -43,9 +43,6 @@ func Connect(ctx context.Context, c net.Conn, cfg *ClientConfig) (*ClientConn, e
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
canvas := NewVncCanvas(int(conn.Width()), int(conn.Height()))
|
|
||||||
canvas.DrawCursor = cfg.DrawCursor
|
|
||||||
conn.Canvas = canvas
|
|
||||||
return conn, nil
|
return conn, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -84,15 +84,6 @@ func main() {
|
|||||||
//go vcodec.Run("C:\\Users\\betzalel\\Dropbox\\go\\src\\vnc2video\\example\\client\\ffmpeg.exe", "output.mp4")
|
//go vcodec.Run("C:\\Users\\betzalel\\Dropbox\\go\\src\\vnc2video\\example\\client\\ffmpeg.exe", "output.mp4")
|
||||||
//vcodec.Run("./output")
|
//vcodec.Run("./output")
|
||||||
|
|
||||||
//screenImage := vnc.NewVncCanvas(int(cc.Width()), int(cc.Height()))
|
|
||||||
|
|
||||||
for _, enc := range ccfg.Encodings {
|
|
||||||
myRenderer, ok := enc.(vnc.Renderer)
|
|
||||||
|
|
||||||
if ok {
|
|
||||||
myRenderer.SetTargetImage(screenImage)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// var out *os.File
|
// var out *os.File
|
||||||
|
|
||||||
logger.Tracef("connected to: %s", os.Args[1])
|
logger.Tracef("connected to: %s", os.Args[1])
|
||||||
|
15
handlers.go
15
handlers.go
@@ -345,6 +345,21 @@ func (*DefaultClientServerInitHandler) Handle(c Conn) error {
|
|||||||
// return err
|
// return err
|
||||||
// }
|
// }
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
// set up canvas and init renderer before other
|
||||||
|
cfg := c.Config().(*ClientConfig)
|
||||||
|
canvas := NewVncCanvas(int(c.Width()), int(c.Height()))
|
||||||
|
canvas.DrawCursor = cfg.DrawCursor
|
||||||
|
c.(*ClientConn).Canvas = canvas
|
||||||
|
|
||||||
|
for _, enc := range cfg.Encodings {
|
||||||
|
myRenderer, ok := enc.(Renderer)
|
||||||
|
|
||||||
|
if ok {
|
||||||
|
myRenderer.SetTargetImage(canvas)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user