Documentation
¶
Overview ¶
Package pwtest starts a private PipeWire daemon for tests, so producers and consumers link without touching the user's session, and runs libpipewire consumers against it as the reference a producer is checked by.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Buffer ¶
type Buffer struct {
// Size is the chunk's size: 0 for a buffer that holds no frame.
Size uint32
// Corrupted is the chunk's SPA_CHUNK_FLAG_CORRUPTED.
Corrupted bool
// Seq is the header meta's sequence number: a buffer dequeued again
// without the producer queueing it anew carries the same one.
Seq uint64
// Cursor is the cursor meta, nil when the buffers have none.
Cursor *Cursor
}
Buffer is what one dequeued buffer carried.
type Consumer ¶
type Consumer struct {
// contains filtered or unexported fields
}
Consumer is a reference consumer: a libpipewire input stream, linked to a node's first output port, asking for the header and cursor metas as screen recorders do, and reporting every buffer it dequeues.
func Consume ¶
Consume connects a reference consumer offering any size of BGRx video and links node's output_0 to it with pw-link. The daemon must be running; the consumer goes away with the test.
type Cursor ¶
type Cursor struct {
ID uint32
X, Y int32
HotspotX, HotspotY int32
// Bitmap is the bitmap the meta carried, nil when it carried none.
Bitmap *Bitmap
}
Cursor is a cursor meta: an ID of 0 is no news.
type Daemon ¶
type Daemon struct {
// contains filtered or unexported fields
}
Daemon is a private pipewire a test runs.
type Lib ¶
type Lib struct {
PropertiesNew func(s string) uintptr
StreamNewSimple func(loop uintptr, name string, props uintptr, events unsafe.Pointer, data uintptr) uintptr
StreamConnect func(stream uintptr, direction, target, flags uint32, params unsafe.Pointer, n uint32) int32
StreamDisconnect func(stream uintptr) int32
StreamDestroy func(stream uintptr)
StreamUpdate func(stream uintptr, params unsafe.Pointer, n uint32) int32
StreamDequeue func(stream uintptr) unsafe.Pointer
StreamQueue func(stream uintptr, buffer unsafe.Pointer) int32
// contains filtered or unexported fields
}
Lib is libpipewire bound through purego: the reference implementation the tests' consumers run on, so the producer is checked against the library every other PipeWire client uses.