timinglog

package
v0.0.0-...-3c26423 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 3, 2026 License: GPL-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package timinglog keeps the times of two events on one clock: a keyboard report was written to USB, and the last byte of an OS Services video frame was there. A tool that measures the time from a key to the frame that shows it reads both times here, so the network to the KVM is not part of its result.

The log has memory only between Start and Stop, and keeps the newest entries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Frame

func Frame(rtpTimestamp uint32, complete time.Time)

Frame logs an OS Services video frame: the RTP timestamp of its packets, and when its last byte was there.

func Key

func Key(code byte, written time.Time)

Key logs a keyboard report: the code of its first key, and when it was written to USB.

func Start

func Start()

Start starts an empty log.

func Stop

func Stop()

Stop stops the log and frees its memory.

Types

type Log

type Log struct {
	Running bool `json:"running"`
	// KeyCount and FrameCount count every entry since Start. A count above
	// the number of entries tells that the oldest are gone.
	KeyCount   uint32 `json:"keyCount"`
	FrameCount uint32 `json:"frameCount"`
	// Keys: when the report was written, and the code of its first key, 0
	// when no key is down.
	Keys [][2]int64 `json:"keys"`
	// Frames: when the frame was complete, and the RTP timestamp of its
	// packets.
	Frames [][2]int64 `json:"frames"`
}

Log is the timing log as a tool reads it. Each entry is a time in microseconds and a value, the oldest entry first.

func Answer

func Answer(action string) Log

Answer does the action of a request and returns the log after it: "start" starts an empty log, "stop" stops the log, and each other action only reads.

func Read

func Read() Log

Read returns the log.

type VideoTap

type VideoTap struct {
	interceptor.NoOp
	// contains filtered or unexported fields
}

VideoTap reads the RTP timestamp of the video packets that one peer connection sends. The track makes the timestamps itself, so the sender of a frame reads the timestamp of its packets here.

A VideoTap is the interceptor factory and the interceptor of one peer connection. It is the last in the registry: a packet that an earlier interceptor sends again does not pass it.

func (*VideoTap) BindLocalStream

func (t *VideoTap) BindLocalStream(info *interceptor.StreamInfo, writer interceptor.RTPWriter) interceptor.RTPWriter

func (*VideoTap) Last

func (t *VideoTap) Last() (timestamp uint32, packets uint64)

Last returns the RTP timestamp of the newest video packet, and the number of video packets until now. A sender that sees the number change across the write of a frame has the timestamp of that frame.

func (*VideoTap) NewInterceptor

func (t *VideoTap) NewInterceptor(string) (interceptor.Interceptor, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL