fix lint errors

This commit is contained in:
Siyuan 2025-09-25 23:28:30 +00:00
parent c5034e00d6
commit 8f68956b44
2 changed files with 11 additions and 12 deletions

View File

@ -37,14 +37,14 @@ func NewNative(opts NativeOptions) *Native {
onVideoStateChange := opts.OnVideoStateChange
if onVideoStateChange == nil {
onVideoStateChange = func(state VideoState) {
nativeLogger.Info().Msg("video state changed")
nativeLogger.Info().Interface("state", state).Msg("video state changed")
}
}
onVideoFrameReceived := opts.OnVideoFrameReceived
if onVideoFrameReceived == nil {
onVideoFrameReceived = func(frame []byte, duration time.Duration) {
nativeLogger.Info().Msg("video frame received")
nativeLogger.Info().Interface("frame", frame).Dur("duration", duration).Msg("video frame received")
}
}
@ -69,10 +69,10 @@ func NewNative(opts NativeOptions) *Native {
systemVersion: opts.SystemVersion,
appVersion: opts.AppVersion,
displayRotation: opts.DisplayRotation,
onVideoStateChange: opts.OnVideoStateChange,
onVideoFrameReceived: opts.OnVideoFrameReceived,
onIndevEvent: opts.OnIndevEvent,
onRpcEvent: opts.OnRpcEvent,
onVideoStateChange: onVideoStateChange,
onVideoFrameReceived: onVideoFrameReceived,
onIndevEvent: onIndevEvent,
onRpcEvent: onRpcEvent,
videoLock: sync.Mutex{},
screenLock: sync.Mutex{},
}
@ -93,7 +93,9 @@ func (n *Native) Start() {
n.initUI()
go n.tickUI()
videoInit()
if err := videoInit(); err != nil {
n.l.Error().Err(err).Msg("failed to initialize video")
}
close(n.ready)
}

View File

@ -366,15 +366,12 @@ func (s *NetworkInterfaceState) updateNtpServersFromLease(lease *udhcpc.Lease) e
}
func (s *NetworkInterfaceState) handleInitialCheck() {
if s.IsUp() {
}
// if s.IsUp() {}
s.onInitialCheck(s)
}
func (s *NetworkInterfaceState) handleStateChange() {
if s.IsUp() {
} else {
}
// if s.IsUp() {} else {}
s.onStateChange(s)
}