PipeWire  0.3.33
context.c File Reference

Data Structures

struct  object_entry
 

Macros

#define NAME   "context"
 
#define DEFAULT_CLOCK_RATE   48000u
 
#define DEFAULT_CLOCK_QUANTUM   1024u
 
#define DEFAULT_CLOCK_MIN_QUANTUM   32u
 
#define DEFAULT_CLOCK_MAX_QUANTUM   8192u
 
#define DEFAULT_CLOCK_POWER_OF_TWO_QUANTUM   true
 
#define DEFAULT_VIDEO_WIDTH   640
 
#define DEFAULT_VIDEO_HEIGHT   480
 
#define DEFAULT_VIDEO_RATE_NUM   25u
 
#define DEFAULT_VIDEO_RATE_DENOM   1u
 
#define DEFAULT_LINK_MAX_BUFFERS   64u
 
#define DEFAULT_MEM_WARN_MLOCK   false
 
#define DEFAULT_MEM_ALLOW_MLOCK   true
 

Functions

struct pw_context * pw_context_new (struct pw_loop *main_loop, struct pw_properties *properties, size_t user_data_size)
 Create a new context object. More...
 
void pw_context_destroy (struct pw_context *context)
 Destroy a context object. More...
 
void * pw_context_get_user_data (struct pw_context *context)
 Get the context user data. More...
 
void pw_context_add_listener (struct pw_context *context, struct spa_hook *listener, const struct pw_context_events *events, void *data)
 Add a new event listener to a context. More...
 
const struct spa_supportpw_context_get_support (struct pw_context *context, uint32_t *n_support)
 Get the context support objects. More...
 
struct pw_looppw_context_get_main_loop (struct pw_context *context)
 get the context main loop More...
 
struct pw_work_queue * pw_context_get_work_queue (struct pw_context *context)
 Get the work queue from the context: Since 0.3.26. More...
 
const struct pw_propertiespw_context_get_properties (struct pw_context *context)
 Get the context properties. More...
 
const char * pw_context_get_conf_section (struct pw_context *context, const char *section)
 Get a config section for this context. More...
 
int pw_context_update_properties (struct pw_context *context, const struct spa_dict *dict)
 Update context properties. More...
 
int pw_context_for_each_global (struct pw_context *context, int(*callback)(void *data, struct pw_global *global), void *data)
 Iterate the globals of the context. More...
 
struct pw_global * pw_context_find_global (struct pw_context *context, uint32_t id)
 Find a context global by id. More...
 
struct pw_impl_port * pw_context_find_port (struct pw_context *context, struct pw_impl_port *other_port, uint32_t id, struct pw_properties *props, uint32_t n_format_filters, struct spa_pod **format_filters, char **error)
 Find a port to link with. More...
 
int pw_context_debug_port_params (struct pw_context *this, struct spa_node *node, enum spa_direction direction, uint32_t port_id, uint32_t id, int err, const char *debug,...)
 
int pw_context_find_format (struct pw_context *context, struct pw_impl_port *output, struct pw_impl_port *input, struct pw_properties *props, uint32_t n_format_filters, struct spa_pod **format_filters, struct spa_pod **format, struct spa_pod_builder *builder, char **error)
 Find a common format between two ports. More...
 
int pw_context_recalc_graph (struct pw_context *context, const char *reason)
 
int pw_context_add_spa_lib (struct pw_context *context, const char *factory_regexp, const char *lib)
 add a spa library for the given factory_name regex More...
 
const char * pw_context_find_spa_lib (struct pw_context *context, const char *factory_name)
 find the library name for a spa factory More...
 
struct spa_handlepw_context_load_spa_handle (struct pw_context *context, const char *factory_name, const struct spa_dict *info)
 
int pw_context_register_export_type (struct pw_context *context, struct pw_export_type *type)
 register a type that can be exported on a context_proxy. More...
 
const struct pw_export_typepw_context_find_export_type (struct pw_context *context, const char *type)
 find information about registered export type More...
 
int pw_context_set_object (struct pw_context *context, const char *type, void *value)
 add an object to the context More...
 
void * pw_context_get_object (struct pw_context *context, const char *type)
 get an object from the context More...
 

Macro Definition Documentation

◆ DEFAULT_CLOCK_MAX_QUANTUM

#define DEFAULT_CLOCK_MAX_QUANTUM   8192u

◆ DEFAULT_CLOCK_MIN_QUANTUM

#define DEFAULT_CLOCK_MIN_QUANTUM   32u

◆ DEFAULT_CLOCK_POWER_OF_TWO_QUANTUM

#define DEFAULT_CLOCK_POWER_OF_TWO_QUANTUM   true

◆ DEFAULT_CLOCK_QUANTUM

#define DEFAULT_CLOCK_QUANTUM   1024u

◆ DEFAULT_CLOCK_RATE

#define DEFAULT_CLOCK_RATE   48000u

◆ DEFAULT_LINK_MAX_BUFFERS

#define DEFAULT_LINK_MAX_BUFFERS   64u

◆ DEFAULT_MEM_ALLOW_MLOCK

#define DEFAULT_MEM_ALLOW_MLOCK   true

◆ DEFAULT_MEM_WARN_MLOCK

#define DEFAULT_MEM_WARN_MLOCK   false

◆ DEFAULT_VIDEO_HEIGHT

#define DEFAULT_VIDEO_HEIGHT   480

◆ DEFAULT_VIDEO_RATE_DENOM

#define DEFAULT_VIDEO_RATE_DENOM   1u

◆ DEFAULT_VIDEO_RATE_NUM

#define DEFAULT_VIDEO_RATE_NUM   25u

◆ DEFAULT_VIDEO_WIDTH

#define DEFAULT_VIDEO_WIDTH   640

◆ NAME

#define NAME   "context"

Function Documentation

◆ pw_context_debug_port_params()

int pw_context_debug_port_params ( struct pw_context *  this,
struct spa_node node,
enum spa_direction  direction,
uint32_t  port_id,
uint32_t  id,
int  err,
const char *  debug,
  ... 
)

◆ pw_context_find_format()

int pw_context_find_format ( struct pw_context *  context,
struct pw_impl_port *  output,
struct pw_impl_port *  input,
struct pw_properties props,
uint32_t  n_format_filters,
struct spa_pod **  format_filters,
struct spa_pod **  format,
struct spa_pod_builder builder,
char **  error 
)

Find a common format between two ports.

Parameters
contexta context object
outputan output port
inputan input port
propsextra properties
n_format_filtersnumber of format filters
format_filtersarray of format filters
[out]formatthe common format between the ports
builderbuilder to use for processing
[out]erroran error when something is wrong
Returns
a common format of NULL on error

Find a common format between the given ports. The format will be restricted to a subset given with the format filters.

References NAME, PW_IMPL_PORT_STATE_CONFIGURE, pw_log_debug, PW_NODE_STATE_IDLE, spa_aprintf, SPA_LOG_LEVEL_DEBUG, spa_node_port_enum_params_sync(), SPA_PARAM_EnumFormat, SPA_PARAM_Format, spa_pod_builder_init(), and spa_strerror.

◆ pw_context_find_port()

struct pw_impl_port* pw_context_find_port ( struct pw_context *  context,
struct pw_impl_port *  other_port,
uint32_t  id,
struct pw_properties props,
uint32_t  n_format_filters,
struct spa_pod **  format_filters,
char **  error 
)

Find a port to link with.

Parameters
contexta context
other_porta port to find a link with
idthe id of a port or PW_ID_ANY
propsextra properties
n_format_filtersnumber of filters
format_filtersarray of format filters
[out]erroran error when something is wrong
Returns
a port that can be used to link to otherport or NULL on error

References NAME, PW_ID_ANY, pw_log_debug, and spa_list_for_each.

◆ pw_context_recalc_graph()

int pw_context_recalc_graph ( struct pw_context *  context,
const char *  reason 
)