PipeWire  0.2.9
stream.c File Reference
Include dependency graph for stream.c:

Data Structures

struct  buffer
struct  queue
struct  data
struct  param
struct  control
struct  props
struct  stream


#define NAME   "stream"
#define MAX_BUFFERS   64
#define MIN_QUEUED   1
#define MAX_PORTS   1
#define BUFFER_FLAG_MAPPED   (1 << 0)
#define BUFFER_FLAG_QUEUED   (1 << 1)
#define PARAM_TYPE_INIT   (1 << 0)
#define PARAM_TYPE_OTHER   (1 << 1)
#define PARAM_TYPE_FORMAT   (1 << 2)
#define DEFAULT_VOLUME   1.0


SPA_EXPORT struct pw_streampw_stream_new (struct pw_remote *remote, const char *name, struct pw_properties *props)
SPA_EXPORT struct pw_streampw_stream_new_simple (struct pw_loop *loop, const char *name, struct pw_properties *props, const struct pw_stream_events *events, void *data)
SPA_EXPORT const char * pw_stream_state_as_string (enum pw_stream_state state)
SPA_EXPORT void pw_stream_destroy (struct pw_stream *stream)
SPA_EXPORT void pw_stream_add_listener (struct pw_stream *stream, struct spa_hook *listener, const struct pw_stream_events *events, void *data)
SPA_EXPORT enum pw_stream_state pw_stream_get_state (struct pw_stream *stream, const char **error)
SPA_EXPORT const char * pw_stream_get_name (struct pw_stream *stream)
SPA_EXPORT const struct pw_propertiespw_stream_get_properties (struct pw_stream *stream)
SPA_EXPORT int pw_stream_update_properties (struct pw_stream *stream, const struct spa_dict *dict)
SPA_EXPORT struct pw_remotepw_stream_get_remote (struct pw_stream *stream)
SPA_EXPORT int pw_stream_connect (struct pw_stream *stream, enum pw_direction direction, uint32_t target_id, enum pw_stream_flags flags, const struct spa_pod **params, uint32_t n_params)
SPA_EXPORT uint32_t pw_stream_get_node_id (struct pw_stream *stream)
SPA_EXPORT int pw_stream_disconnect (struct pw_stream *stream)
SPA_EXPORT void pw_stream_finish_format (struct pw_stream *stream, int res, const struct spa_pod **params, uint32_t n_params)
SPA_EXPORT int pw_stream_set_control (struct pw_stream *stream, uint32_t id, float value,...)
 Set control values. More...
SPA_EXPORT const struct pw_stream_controlpw_stream_get_control (struct pw_stream *stream, uint32_t id)
 Get control information. More...
SPA_EXPORT int pw_stream_set_active (struct pw_stream *stream, bool active)
SPA_EXPORT int pw_stream_get_time (struct pw_stream *stream, struct pw_time *time)
SPA_EXPORT struct pw_bufferpw_stream_dequeue_buffer (struct pw_stream *stream)
 Get a buffer that can be filled for playback streams or consumed for capture streams. More...
SPA_EXPORT int pw_stream_queue_buffer (struct pw_stream *stream, struct pw_buffer *buffer)
 Submit a buffer for playback or recycle a buffer for capture. More...
SPA_EXPORT int pw_stream_flush (struct pw_stream *stream, bool drain)
 Flush a stream. More...

Macro Definition Documentation


#define BUFFER_FLAG_MAPPED   (1 << 0)


#define BUFFER_FLAG_QUEUED   (1 << 1)


#define DEFAULT_VOLUME   1.0




#define MAX_BUFFERS   64


#define MAX_PORTS   1


#define MIN_QUEUED   1


#define NAME   "stream"


#define PARAM_TYPE_FORMAT   (1 << 2)


#define PARAM_TYPE_INIT   (1 << 0)


#define PARAM_TYPE_OTHER   (1 << 1)

Function Documentation

◆ pw_stream_add_listener()

SPA_EXPORT void pw_stream_add_listener ( struct pw_stream stream,
struct spa_hook *  listener,
const struct pw_stream_events events,
void *  data 

Referenced by pw_stream_new_simple().

Here is the caller graph for this function:

◆ pw_stream_connect()

SPA_EXPORT int pw_stream_connect ( struct pw_stream stream,
enum pw_direction  direction,
uint32_t  target_id,
enum pw_stream_flags  flags,
const struct spa_pod **  params,
uint32_t  n_params 

◆ pw_stream_dequeue_buffer()

SPA_EXPORT struct pw_buffer* pw_stream_dequeue_buffer ( struct pw_stream stream)

Get a buffer that can be filled for playback streams or consumed for capture streams.

◆ pw_stream_destroy()

SPA_EXPORT void pw_stream_destroy ( struct pw_stream stream)

◆ pw_stream_disconnect()

SPA_EXPORT int pw_stream_disconnect ( struct pw_stream stream)

◆ pw_stream_finish_format()

SPA_EXPORT void pw_stream_finish_format ( struct pw_stream stream,
int  res,
const struct spa_pod **  params,
uint32_t  n_params 

◆ pw_stream_flush()

SPA_EXPORT int pw_stream_flush ( struct pw_stream stream,
bool  drain 

Flush a stream.

When drain is true, the drained callback will be called when all data is played or recorded

References pw_loop_invoke.

◆ pw_stream_get_control()

SPA_EXPORT const struct pw_stream_control* pw_stream_get_control ( struct pw_stream stream,
uint32_t  id 

Get control information.

◆ pw_stream_get_name()

SPA_EXPORT const char* pw_stream_get_name ( struct pw_stream stream)

◆ pw_stream_get_node_id()

SPA_EXPORT uint32_t pw_stream_get_node_id ( struct pw_stream stream)

◆ pw_stream_get_properties()

SPA_EXPORT const struct pw_properties* pw_stream_get_properties ( struct pw_stream stream)

◆ pw_stream_get_remote()

SPA_EXPORT struct pw_remote* pw_stream_get_remote ( struct pw_stream stream)

◆ pw_stream_get_state()

SPA_EXPORT enum pw_stream_state pw_stream_get_state ( struct pw_stream stream,
const char **  error 

◆ pw_stream_get_time()

SPA_EXPORT int pw_stream_get_time ( struct pw_stream stream,
struct pw_time time 

◆ pw_stream_new()

◆ pw_stream_new_simple()

SPA_EXPORT struct pw_stream* pw_stream_new_simple ( struct pw_loop loop,
const char *  name,
struct pw_properties props,
const struct pw_stream_events events,
void *  data 
loopa pw_loop to use
namea stream name
propsstream properties, ownership is taken
eventsstream events
datadata passed to events

References pw_core::pw_core_destroy(), pw_core::pw_core_new(), pw_remote::pw_remote_new(), pw_stream_add_listener(), and pw_stream::pw_stream_new().

◆ pw_stream_queue_buffer()

SPA_EXPORT int pw_stream_queue_buffer ( struct pw_stream stream,
struct pw_buffer buffer 

Submit a buffer for playback or recycle a buffer for capture.

References buffer::id, NAME, and pw_log::pw_log_trace.

◆ pw_stream_set_active()

SPA_EXPORT int pw_stream_set_active ( struct pw_stream stream,
bool  active 

◆ pw_stream_set_control()

SPA_EXPORT int pw_stream_set_control ( struct pw_stream stream,
uint32_t  id,
float  value,

Set control values.

References NAME, and pw_log::pw_log_debug.

◆ pw_stream_state_as_string()

◆ pw_stream_update_properties()

SPA_EXPORT int pw_stream_update_properties ( struct pw_stream stream,
const struct spa_dict *  dict