mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
examples: update video-src examples
So that hey use pw_stream_drive() to start the graph.
This commit is contained in:
parent
9831f62927
commit
23d3b10be4
3 changed files with 31 additions and 9 deletions
|
|
@ -79,7 +79,7 @@ static void draw_elipse(uint32_t *dst, int width, int height, uint32_t color)
|
|||
}
|
||||
}
|
||||
|
||||
static void on_timeout(void *userdata, uint64_t expirations)
|
||||
static void on_process(void *userdata)
|
||||
{
|
||||
struct data *data = userdata;
|
||||
struct pw_buffer *b;
|
||||
|
|
@ -91,8 +91,6 @@ static void on_timeout(void *userdata, uint64_t expirations)
|
|||
struct spa_meta_region *mc;
|
||||
struct spa_meta_cursor *mcs;
|
||||
|
||||
pw_log_trace("timeout");
|
||||
|
||||
if ((b = pw_stream_dequeue_buffer(data->stream)) == NULL) {
|
||||
pw_log_warn("out of buffers: %m");
|
||||
return;
|
||||
|
|
@ -176,6 +174,13 @@ static void on_timeout(void *userdata, uint64_t expirations)
|
|||
pw_stream_queue_buffer(data->stream, b);
|
||||
}
|
||||
|
||||
static void on_timeout(void *userdata, uint64_t expirations)
|
||||
{
|
||||
struct data *data = userdata;
|
||||
pw_log_trace("timeout");
|
||||
pw_stream_drive(data->stream);
|
||||
}
|
||||
|
||||
static void on_stream_state_changed(void *_data, enum pw_stream_state old, enum pw_stream_state state,
|
||||
const char *error)
|
||||
{
|
||||
|
|
@ -265,6 +270,7 @@ on_stream_param_changed(void *_data, uint32_t id, const struct spa_pod *param)
|
|||
|
||||
static const struct pw_stream_events stream_events = {
|
||||
PW_VERSION_STREAM_EVENTS,
|
||||
.process = on_process,
|
||||
.state_changed = on_stream_state_changed,
|
||||
.param_changed = on_stream_param_changed,
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue