mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-01 22:58:50 -04:00
Make new USE_BUFFERS command
Make a new USE_BUFFERS command to atomically send a buffer array to the remote client. We can use this to then clean up an old array and go to the PAUSED state if possible. Work on formats. Make one structure that can hold all video formats. Work on pipeline suspend and resume. Add jpeg support to v4l2. Work on enum_formats with a filter in v4l2.
This commit is contained in:
parent
7e858ff694
commit
b67c216a04
24 changed files with 688 additions and 514 deletions
|
|
@ -224,25 +224,32 @@ setup_node (PinosSpaV4l2Source *this)
|
|||
}
|
||||
|
||||
static void
|
||||
stop_pipeline (PinosSpaV4l2Source *this)
|
||||
pause_pipeline (PinosSpaV4l2Source *this)
|
||||
{
|
||||
PinosSpaV4l2SourcePrivate *priv = this->priv;
|
||||
PinosNode *node = PINOS_NODE (this);
|
||||
SpaResult res;
|
||||
SpaCommand cmd;
|
||||
|
||||
g_debug ("spa-v4l2-source %p: stopping pipeline", this);
|
||||
|
||||
if (priv->running) {
|
||||
priv->running = false;
|
||||
pthread_join (priv->thread, NULL);
|
||||
}
|
||||
g_debug ("spa-v4l2-source %p: pause pipeline", this);
|
||||
|
||||
cmd.type = SPA_COMMAND_PAUSE;
|
||||
if ((res = spa_node_send_command (node->node, &cmd)) < 0)
|
||||
g_debug ("got error %d", res);
|
||||
}
|
||||
|
||||
static void
|
||||
suspend_pipeline (PinosSpaV4l2Source *this)
|
||||
{
|
||||
PinosNode *node = PINOS_NODE (this);
|
||||
SpaResult res;
|
||||
|
||||
g_debug ("spa-v4l2-source %p: suspend pipeline", this);
|
||||
|
||||
if ((res = spa_node_port_set_format (node->node, 0, 0, NULL)) < 0) {
|
||||
g_warning ("error unset format output: %d", res);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
destroy_pipeline (PinosSpaV4l2Source *this)
|
||||
{
|
||||
|
|
@ -259,13 +266,14 @@ set_state (PinosNode *node,
|
|||
|
||||
switch (state) {
|
||||
case PINOS_NODE_STATE_SUSPENDED:
|
||||
suspend_pipeline (this);
|
||||
break;
|
||||
|
||||
case PINOS_NODE_STATE_INITIALIZING:
|
||||
break;
|
||||
|
||||
case PINOS_NODE_STATE_IDLE:
|
||||
stop_pipeline (this);
|
||||
pause_pipeline (this);
|
||||
break;
|
||||
|
||||
case PINOS_NODE_STATE_RUNNING:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue