PipeWire: pw_buffer Struct Reference

PipeWire 1.6.5

Loading...
Searching...
No Matches
pw_buffer Struct Reference
Stream

a buffer structure obtained from pw_stream_dequeue_buffer(). More...

`#include <pipewire/stream.h>`

## Data Fields
struct spa_buffer * | buffer
| the spa buffer
void * | user_data
| user data attached to the buffer.
uint64_t | size
| This field is set by the user and the sum of all queued buffers is returned in the time info.
uint64_t | requested
| For playback streams, this field contains the suggested amount of data to provide.
uint64_t | time
| For capture streams, this field contains the cycle time in nanoseconds when this buffer was queued in the stream.

## Detailed Description

a buffer structure obtained from pw_stream_dequeue_buffer().

The size of this structure can grow as more fields are added in the future

Examples
  audio-capture.c, audio-dsp-sink.c, audio-dsp-sink2.c, audio-src-ring.c, audio-src-ring2.c, audio-src.c, midi-src.c, tutorial4.c, tutorial5.c, video-dsp-play.c, video-dsp-src.c, video-play-fixate.c, video-play-pull.c, video-play-reneg.c, video-play-sync.c, video-play.c, video-src-alloc.c, video-src-fixate.c, video-src-reneg.c, video-src-sync.c, and video-src.c.

## Field Documentation

## ◆ buffer

struct spa_buffer* pw_buffer::buffer

the spa buffer

Examples
  audio-capture.c, audio-src-ring.c, audio-src-ring2.c, audio-src.c, midi-src.c, tutorial4.c, tutorial5.c, video-dsp-play.c, video-dsp-src.c, video-play-fixate.c, video-play-pull.c, video-play-reneg.c, video-play-sync.c, video-play.c, video-src-alloc.c, video-src-fixate.c, video-src-reneg.c, video-src-sync.c, and video-src.c.

## ◆ user_data

void* pw_buffer::user_data

user data attached to the buffer.

The user of the stream can set custom data associated with the buffer, typically in the add_buffer event. Any cleanup should be performed in the remove_buffer event. The user data is returned unmodified each time a buffer is dequeued.

## ◆ size

uint64_t pw_buffer::size

This field is set by the user and the sum of all queued buffers is returned in the time info.

For audio, it is advised to use the number of frames in the buffer for this field.

## ◆ requested

uint64_t pw_buffer::requested

For playback streams, this field contains the suggested amount of data to provide.

For audio streams this will be the amount of frames required by the resampler. This field is 0 when no suggestion is provided. Since 0.3.50

Examples
  audio-src-ring.c, audio-src-ring2.c, audio-src.c, and tutorial4.c.

## ◆ time

uint64_t pw_buffer::time

For capture streams, this field contains the cycle time in nanoseconds when this buffer was queued in the stream.

It can be compared against the pw_time values or pw_stream_get_nsec() Since 1.0.5

The documentation for this struct was generated from the following file:

- pipewire/stream.h