PipeWire: stream.c File Reference

PipeWire 0.3.5

Data Structures | Macros | Functions
stream.c File Reference
Include dependency graph for stream.c:

## Data Structures
struct | buffer
struct | queue
struct | data
struct | param
struct | control
struct | stream

## Macros
#define | NAME "stream"
#define | MAX_BUFFERS 64
#define | MASK_BUFFERS (MAX_BUFFERS-1)
#define | MAX_PORTS 1
#define | BUFFER_FLAG_MAPPED (1 << 0)
#define | BUFFER_FLAG_QUEUED (1 << 1)
#define | PARAM_FLAG_LOCKED (1 << 0)

## Functions
SPA_EXPORT struct pw_stream * | pw_stream_new (struct pw_core *core, const char *name, struct pw_properties *props)
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)
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_properties * | pw_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_core * | pw_stream_get_core (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 int | pw_stream_set_error (struct pw_stream *stream, int res, const char *error,...)
SPA_EXPORT int | pw_stream_update_params (struct pw_stream *stream, const struct spa_pod **params, uint32_t n_params)
SPA_EXPORT int | pw_stream_set_control (struct pw_stream *stream, uint32_t id, uint32_t n_values, float *values,...)
| Set control values. More...
SPA_EXPORT const struct pw_stream_control * | pw_stream_get_control (struct pw_stream *stream, uint32_t id)
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_buffer * | pw_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

## ◆ BUFFER_FLAG_MAPPED

#define BUFFER_FLAG_MAPPED (1 << 0)

## ◆ BUFFER_FLAG_QUEUED

#define BUFFER_FLAG_QUEUED (1 << 1)

## ◆ MASK_BUFFERS

#define MASK_BUFFERS (MAX_BUFFERS-1)

## ◆ MAX_BUFFERS

#define MAX_BUFFERS 64

## ◆ MAX_PORTS

#define MAX_PORTS 1

## ◆ NAME

#define NAME "stream"

## ◆ PARAM_FLAG_LOCKED

#define PARAM_FLAG_LOCKED (1 << 0)

## 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
| ) |  |

## ◆ 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
| ) |  |

References NAME, PW_DIRECTION_INPUT, pw_log::pw_log_debug, and res.

## ◆ 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.

References res.

## ◆ pw_stream_destroy()

SPA_EXPORT void pw_stream_destroy | ( | struct pw_stream * | stream | ) |

References NAME, pw_log::pw_log_debug, and pw_stream::pw_stream_disconnect().

## ◆ pw_stream_disconnect()

SPA_EXPORT int pw_stream_disconnect | ( | struct pw_stream * | stream | ) |

References NAME, pw_core_disconnect(), pw_impl_node::pw_impl_node_destroy(), pw_impl_node_set_active(), pw_log::pw_log_debug, and pw_proxy::pw_proxy_destroy().

## ◆ 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
| ) |  |

## ◆ pw_stream_get_core()

SPA_EXPORT struct pw_core* pw_stream_get_core | ( | struct pw_stream * | stream | ) |

## ◆ 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_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
| ) |  |

References pw_time::delay, NAME, pw_time::now, pw_log::pw_log_trace, pw_time::queued, pw_time::rate, pw_time::ticks, and stream::time.

## ◆ pw_stream_new()

SPA_EXPORT struct pw_stream* pw_stream_new | ( | struct pw_core * | core,
|  | const char * | name,
|  | struct pw_properties * | props
| ) |  |

## ◆ 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
| ) |  |

References pw_context_new(), pw_properties::pw_properties_new(), and res.

## ◆ 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, pw_log::pw_log_trace, and res.

## ◆ pw_stream_set_active()

SPA_EXPORT int pw_stream_set_active | ( | struct pw_stream * | stream,
|  | bool | active
| ) |  |

References NAME, pw_impl_node_set_active(), and pw_log::pw_log_debug.

## ◆ pw_stream_set_control()

SPA_EXPORT int pw_stream_set_control | ( | struct pw_stream * | stream,
|  | uint32_t | id,
|  | uint32_t | n_values,
|  | float * | values,
|  |  | ...
| ) |  |

Set control values.

References NAME, pw_log::pw_log_debug, va_start(), and control::values.

## ◆ pw_stream_set_error()

SPA_EXPORT int pw_stream_set_error | ( | struct pw_stream * | stream,
|  | int | res,
|  | const char * | error,
|  |  | ...
| ) |  |

References args, pw_proxy_error(), res, and va_start().

## ◆ pw_stream_state_as_string()

SPA_EXPORT const char* pw_stream_state_as_string | ( | enum pw_stream_state | state | ) |

References PW_STREAM_STATE_CONNECTING, PW_STREAM_STATE_ERROR, PW_STREAM_STATE_PAUSED, PW_STREAM_STATE_STREAMING, and PW_STREAM_STATE_UNCONNECTED.

## ◆ pw_stream_update_params()

SPA_EXPORT int pw_stream_update_params | ( | struct pw_stream * | stream,
|  | const struct spa_pod ** | params,
|  | uint32_t | n_params
| ) |  |

References NAME, pw_log::pw_log_debug, and res.

## ◆ pw_stream_update_properties()

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

References pw_impl_node_update_properties(), pw_properties::pw_properties_update(), and res.