mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
v4l2: continue work on the capture device
Remove activate and deactivate commands. Add STEP property range type for v4l2 frame sizes later v4l2: implement negotiation and data capture
This commit is contained in:
parent
beedb65f00
commit
a1a27328e2
17 changed files with 976 additions and 308 deletions
|
|
@ -310,6 +310,9 @@ spa_alsa_open (SpaALSASink *this)
|
|||
SpaALSAState *state = &this->state;
|
||||
int err;
|
||||
|
||||
if (state->opened)
|
||||
return 0;
|
||||
|
||||
CHECK (snd_output_stdio_attach (&state->output, stdout, 0), "attach failed");
|
||||
|
||||
printf ("Playback device is '%s'\n", this->props.device);
|
||||
|
|
@ -321,15 +324,36 @@ spa_alsa_open (SpaALSASink *this)
|
|||
SND_PCM_NO_AUTO_CHANNELS |
|
||||
SND_PCM_NO_AUTO_FORMAT), "open failed");
|
||||
|
||||
state->opened = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
spa_alsa_close (SpaALSASink *this)
|
||||
{
|
||||
SpaALSAState *state = &this->state;
|
||||
int err = 0;
|
||||
|
||||
if (!state->opened)
|
||||
return 0;
|
||||
|
||||
CHECK (snd_pcm_close (state->handle), "close failed");
|
||||
|
||||
state->opened = false;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int
|
||||
spa_alsa_start (SpaALSASink *this)
|
||||
{
|
||||
SpaALSAState *state = &this->state;
|
||||
int err;
|
||||
|
||||
if (spa_alsa_open (this) < 0)
|
||||
return -1;
|
||||
|
||||
CHECK (set_hwparams (this), "hwparams");
|
||||
CHECK (set_swparams (this), "swparams");
|
||||
|
||||
|
|
@ -352,16 +376,7 @@ spa_alsa_stop (SpaALSASink *this)
|
|||
state->running = false;
|
||||
pthread_join (state->thread, NULL);
|
||||
}
|
||||
spa_alsa_close (this);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
spa_alsa_close (SpaALSASink *this)
|
||||
{
|
||||
SpaALSAState *state = &this->state;
|
||||
int err = 0;
|
||||
|
||||
CHECK (snd_pcm_close (state->handle), "close failed");
|
||||
|
||||
return err;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue