mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
filter: add event to notify command
All commands send to the filter are emited in the command event.
This commit is contained in:
parent
dfa3f631ec
commit
34609389e3
3 changed files with 8 additions and 3 deletions
|
|
@ -506,6 +506,7 @@ static int impl_send_command(void *object, const struct spa_command *command)
|
|||
|
||||
switch (SPA_NODE_COMMAND_ID(command)) {
|
||||
case SPA_NODE_COMMAND_Suspend:
|
||||
case SPA_NODE_COMMAND_Flush:
|
||||
case SPA_NODE_COMMAND_Pause:
|
||||
pw_loop_invoke(impl->context->main_loop,
|
||||
NULL, 0, NULL, 0, false, impl);
|
||||
|
|
@ -521,10 +522,9 @@ static int impl_send_command(void *object, const struct spa_command *command)
|
|||
}
|
||||
break;
|
||||
default:
|
||||
pw_log_warn("%p: unhandled node command %d", filter,
|
||||
SPA_NODE_COMMAND_ID(command));
|
||||
break;
|
||||
}
|
||||
pw_filter_emit_command(filter, command);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ struct pw_buffer {
|
|||
/** Events for a filter. These events are always called from the mainloop
|
||||
* unless explicitly documented otherwise. */
|
||||
struct pw_filter_events {
|
||||
#define PW_VERSION_FILTER_EVENTS 0
|
||||
#define PW_VERSION_FILTER_EVENTS 1
|
||||
uint32_t version;
|
||||
|
||||
void (*destroy) (void *data);
|
||||
|
|
@ -103,6 +103,9 @@ struct pw_filter_events {
|
|||
|
||||
/** The filter is drained */
|
||||
void (*drained) (void *data);
|
||||
|
||||
/** A command notify, Since 0.3.39:1 */
|
||||
void (*command) (void *data, const struct spa_command *command);
|
||||
};
|
||||
|
||||
/** Convert a filter state to a readable string */
|
||||
|
|
|
|||
|
|
@ -1003,6 +1003,7 @@ struct pw_core {
|
|||
#define pw_stream_emit_process(s) pw_stream_emit(s, process, 0)
|
||||
#define pw_stream_emit_drained(s) pw_stream_emit(s, drained,0)
|
||||
#define pw_stream_emit_control_info(s,i,c) pw_stream_emit(s, control_info, 0, i, c)
|
||||
#define pw_stream_emit_command(s,c) pw_stream_emit(s, command,1,c)
|
||||
|
||||
|
||||
struct pw_stream {
|
||||
|
|
@ -1038,6 +1039,7 @@ struct pw_stream {
|
|||
#define pw_filter_emit_remove_buffer(s,p,b) pw_filter_emit(s, remove_buffer, 0, p, b)
|
||||
#define pw_filter_emit_process(s,p) pw_filter_emit(s, process, 0, p)
|
||||
#define pw_filter_emit_drained(s) pw_filter_emit(s, drained, 0)
|
||||
#define pw_filter_emit_command(s,c) pw_filter_emit(s, command, 1, c)
|
||||
|
||||
|
||||
struct pw_filter {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue