mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-31 22:25:38 -04:00
cleanup
This commit is contained in:
parent
0a6d1ce7ef
commit
8e2d02c08c
1 changed files with 29 additions and 7 deletions
|
|
@ -1228,6 +1228,7 @@ static void capture_process(void *d)
|
||||||
|
|
||||||
static int apply_props(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
static int apply_props(struct spa_loop *loop, bool async, uint32_t seq, const void *data, size_t size, void *user_data)
|
||||||
{
|
{
|
||||||
|
const struct impl *impl = user_data;
|
||||||
const struct spa_pod *props = data;
|
const struct spa_pod *props = data;
|
||||||
spa_filter_graph_set_props(impl->graph, SPA_DIRECTION_OUTPUT, props);
|
spa_filter_graph_set_props(impl->graph, SPA_DIRECTION_OUTPUT, props);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -1235,8 +1236,6 @@ static int apply_props(struct spa_loop *loop, bool async, uint32_t seq, const vo
|
||||||
|
|
||||||
static void control_process(void *d)
|
static void control_process(void *d)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "control process\n");
|
|
||||||
|
|
||||||
struct impl *impl = d;
|
struct impl *impl = d;
|
||||||
|
|
||||||
struct pw_buffer *control = pw_stream_dequeue_buffer(impl->control);
|
struct pw_buffer *control = pw_stream_dequeue_buffer(impl->control);
|
||||||
|
|
@ -1269,7 +1268,6 @@ static void control_process(void *d)
|
||||||
|
|
||||||
static void playback_process(void *d)
|
static void playback_process(void *d)
|
||||||
{
|
{
|
||||||
pw_log_error("playback process");
|
|
||||||
struct impl *impl = d;
|
struct impl *impl = d;
|
||||||
struct pw_buffer *in, *out;
|
struct pw_buffer *in, *out;
|
||||||
uint32_t i, data_size = 0;
|
uint32_t i, data_size = 0;
|
||||||
|
|
@ -1627,12 +1625,38 @@ static const struct pw_stream_events out_stream_events = {
|
||||||
.param_changed = playback_param_changed,
|
.param_changed = playback_param_changed,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
static void control_destroy(void *d)
|
||||||
|
{
|
||||||
|
struct impl *impl = d;
|
||||||
|
spa_hook_remove(&impl->control_listener);
|
||||||
|
impl->control = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void control_state_changed(void *data, enum pw_stream_state old,
|
||||||
|
enum pw_stream_state state, const char *error)
|
||||||
|
{
|
||||||
|
struct impl *impl = data;
|
||||||
|
|
||||||
|
switch (state) {
|
||||||
|
case PW_STREAM_STATE_PAUSED:
|
||||||
|
pw_stream_flush(impl->control, false);
|
||||||
|
break;
|
||||||
|
case PW_STREAM_STATE_ERROR:
|
||||||
|
pw_log_info("module %p: error: %s", impl, error);
|
||||||
|
break;
|
||||||
|
case PW_STREAM_STATE_STREAMING:
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
static const struct pw_stream_events control_stream_events = {
|
static const struct pw_stream_events control_stream_events = {
|
||||||
PW_VERSION_STREAM_EVENTS,
|
PW_VERSION_STREAM_EVENTS,
|
||||||
.destroy = NULL,
|
.destroy = control_destroy,
|
||||||
.process = control_process,
|
.process = control_process,
|
||||||
.io_changed = NULL,
|
.io_changed = NULL,
|
||||||
.state_changed = NULL,
|
.state_changed = control_state_changed,
|
||||||
.param_changed = NULL,
|
.param_changed = NULL,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -1940,8 +1964,6 @@ static void copy_props(struct impl *impl, struct pw_properties *props, const cha
|
||||||
SPA_EXPORT
|
SPA_EXPORT
|
||||||
int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
||||||
{
|
{
|
||||||
fprintf(stdout, "module init reached\n");
|
|
||||||
|
|
||||||
struct pw_context *context = pw_impl_module_get_context(module);
|
struct pw_context *context = pw_impl_module_get_context(module);
|
||||||
const struct pw_properties *p;
|
const struct pw_properties *p;
|
||||||
struct pw_properties *props;
|
struct pw_properties *props;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue