stream: rename _drive() to _trigger_process()

Should be a bit more intuitive to understand what it will do.
This commit is contained in:
Wim Taymans 2021-08-06 15:32:21 +02:00
parent 47fe5b550d
commit 3c97090ba0
6 changed files with 14 additions and 13 deletions

View file

@ -284,7 +284,7 @@ on_stream_io_changed(void *_data, uint32_t id, void *area, uint32_t size)
static void on_timeout(void *userdata, uint64_t expirations)
{
struct data *data = userdata;
pw_stream_drive(data->stream);
pw_stream_trigger_process(data->stream);
}
/* Be notified when the stream param changes. We're only looking at the

View file

@ -181,7 +181,7 @@ static void on_timeout(void *userdata, uint64_t expirations)
{
struct data *data = userdata;
pw_log_trace("timeout");
pw_stream_drive(data->stream);
pw_stream_trigger_process(data->stream);
}
/* when the stream is STREAMING, start the timer at 40ms intervals

View file

@ -185,7 +185,7 @@ static void on_timeout(void *userdata, uint64_t expirations)
{
struct data *data = userdata;
pw_log_trace("timeout");
pw_stream_drive(data->stream);
pw_stream_trigger_process(data->stream);
}
/* when the stream is STREAMING, start the timer at 40ms intervals

View file

@ -178,7 +178,7 @@ static void on_timeout(void *userdata, uint64_t expirations)
{
struct data *data = userdata;
pw_log_trace("timeout");
pw_stream_drive(data->stream);
pw_stream_trigger_process(data->stream);
}
static void on_stream_state_changed(void *_data, enum pw_stream_state old, enum pw_stream_state state,

View file

@ -2005,7 +2005,7 @@ int pw_stream_get_time(struct pw_stream *stream, struct pw_time *time)
}
static int
do_trigger(struct spa_loop *loop,
do_trigger_deprecated(struct spa_loop *loop,
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
{
struct stream *impl = user_data;
@ -2058,7 +2058,7 @@ int pw_stream_queue_buffer(struct pw_stream *stream, struct pw_buffer *buffer)
impl->driving && !impl->using_drive) {
pw_log_debug("use pw_stream_drive() to drive the stream.");
res = pw_loop_invoke(impl->context->data_loop,
do_trigger, 1, NULL, 0, false, impl);
do_trigger_deprecated, 1, NULL, 0, false, impl);
}
return res;
}
@ -2107,7 +2107,7 @@ int pw_stream_flush(struct pw_stream *stream, bool drain)
}
static int
do_drive(struct spa_loop *loop,
do_trigger_process(struct spa_loop *loop,
bool async, uint32_t seq, const void *data, size_t size, void *user_data)
{
struct stream *impl = user_data;
@ -2123,14 +2123,16 @@ do_drive(struct spa_loop *loop,
}
SPA_EXPORT
int pw_stream_drive(struct pw_stream *stream)
int pw_stream_trigger_process(struct pw_stream *stream)
{
struct stream *impl = SPA_CONTAINER_OF(stream, struct stream, this);
int res = 0;
pw_log_trace(NAME" %p", impl);
/* flag to check for old or new behaviour */
impl->using_drive = true;
if (impl->driving) {
if (impl->direction == SPA_DIRECTION_OUTPUT &&
!impl->process_rt) {
@ -2138,7 +2140,7 @@ int pw_stream_drive(struct pw_stream *stream)
do_call_process, 1, NULL, 0, false, impl);
}
res = pw_loop_invoke(impl->context->data_loop,
do_drive, 1, NULL, 0, false, impl);
do_trigger_process, 1, NULL, 0, false, impl);
}
return res;
}

View file

@ -238,7 +238,6 @@ struct pw_stream_events {
/** The stream is drained */
void (*drained) (void *data);
};
/** Convert a stream state to a readable string */
@ -363,9 +362,9 @@ int pw_stream_set_active(struct pw_stream *stream, bool active);
* be called when all data is played or recorded */
int pw_stream_flush(struct pw_stream *stream, bool drain);
/** Start a push/pull on the stream. The graph will be started and
* process will be called. Since 0.3.34 */
int pw_stream_drive(struct pw_stream *stream);
/** Trigger a push/pull on the stream. One iteration of the graph will
* scheduled and process() will be called. Since 0.3.34 */
int pw_stream_trigger_process(struct pw_stream *stream);
/**
* \}