diff --git a/TODO b/TODO index 072621e..7fc516c 100644 --- a/TODO +++ b/TODO @@ -4,3 +4,6 @@ 3. 整体重构! 4. 综合调试 +# 2022-9-30 +1. 视频没有图像 +2. qemu只在声卡初始化后才开始抓取声音 \ No newline at end of file diff --git a/lib/webrtcconnection/connection.go b/lib/webrtcconnection/connection.go index d9c78b1..d2494ec 100644 --- a/lib/webrtcconnection/connection.go +++ b/lib/webrtcconnection/connection.go @@ -61,7 +61,7 @@ func New(o *Options) (*Connection, error) { } func (c *Connection) Regist(offer *webrtc.SessionDescription) (*webrtc.SessionDescription, error) { - logrus.Debug("received offer ", offer) + logrus.Debug("received offer ") rtc, err := c.api.NewPeerConnection(webrtc.Configuration{ ICEServers: []webrtc.ICEServer{ @@ -78,6 +78,10 @@ func (c *Connection) Regist(offer *webrtc.SessionDescription) (*webrtc.SessionDe logrus.Debug("connection state has changed: ", connectionState.String()) }) + rtc.OnICECandidate(func(i *webrtc.ICECandidate) { + logrus.Debug("cadidate: ", i) + }) + for _, track := range c.stream.GetTracks() { track.OnEnded(func(err error) { logrus.Errorf("Track (ID: %s, kind: %s) ended with error: %v", track.ID(), track.Kind().String(), err) diff --git a/servers/qemuserver/server.go b/servers/qemuserver/server.go index f433b60..f3c9219 100644 --- a/servers/qemuserver/server.go +++ b/servers/qemuserver/server.go @@ -130,6 +130,7 @@ func (s *Server) Run() error { logrus.Fatal(err) } + logrus.Debug("start reading PCM") defer close(s.pcm) for { b := make([]byte, 2048) // to be configured diff --git a/web/src/components/AceScreen.vue b/web/src/components/AceScreen.vue index 446e64a..69e8b59 100644 --- a/web/src/components/AceScreen.vue +++ b/web/src/components/AceScreen.vue @@ -101,7 +101,7 @@ onMounted(() => { el.oncontextmenu = () => false; document.getElementById("data").appendChild(el); - if (el.track.kind === "video") { + if (ev.track.kind === "video") { const ctx = video.getContext("2d"); setTimeout(() => { ctx.drawImage(this.video, 0, 0);