stream: add event to notify commands

This commit is contained in:
Wim Taymans 2021-10-19 15:23:20 +02:00
parent 1cacb64b19
commit dfa3f631ec
2 changed files with 5 additions and 6 deletions

View file

@ -557,14 +557,10 @@ static int impl_send_command(void *object, const struct spa_command *command)
stream_set_state(stream, PW_STREAM_STATE_STREAMING, NULL); stream_set_state(stream, PW_STREAM_STATE_STREAMING, NULL);
} }
break; break;
case SPA_NODE_COMMAND_ParamBegin:
case SPA_NODE_COMMAND_ParamEnd:
break;
default: default:
pw_log_warn("%p: unhandled node command %d", stream,
SPA_NODE_COMMAND_ID(command));
break; break;
} }
pw_stream_emit_command(stream, command);
return 0; return 0;
} }

View file

@ -209,7 +209,7 @@ struct pw_time {
/** Events for a stream. These events are always called from the mainloop /** Events for a stream. These events are always called from the mainloop
* unless explicitly documented otherwise. */ * unless explicitly documented otherwise. */
struct pw_stream_events { struct pw_stream_events {
#define PW_VERSION_STREAM_EVENTS 0 #define PW_VERSION_STREAM_EVENTS 1
uint32_t version; uint32_t version;
void (*destroy) (void *data); void (*destroy) (void *data);
@ -238,6 +238,9 @@ struct pw_stream_events {
/** The stream is drained */ /** The stream is drained */
void (*drained) (void *data); void (*drained) (void *data);
/** A command notify, Since 0.3.39:1 */
void (*command) (void *data, const struct spa_command *command);
}; };
/** Convert a stream state to a readable string */ /** Convert a stream state to a readable string */