work on sink

This commit is contained in:
Wim Taymans 2016-08-18 12:43:25 +02:00
parent bdbddaf75b
commit a03352353f
9 changed files with 180 additions and 306 deletions

View file

@ -66,6 +66,24 @@ spa_v4l2_open (SpaV4l2Source *this)
return 0;
}
static int
spa_v4l2_close (SpaV4l2Source *this)
{
SpaV4l2State *state = &this->state[0];
if (!state->opened)
return 0;
fprintf (stderr, "close\n");
if (close(state->fd))
perror ("close");
state->fd = -1;
state->opened = false;
return 0;
}
typedef struct {
uint32_t fourcc;
SpaVideoFormat format;
@ -418,24 +436,6 @@ spa_v4l2_set_format (SpaV4l2Source *this, V4l2Format *f, bool try_only)
return 0;
}
static int
spa_v4l2_close (SpaV4l2Source *this)
{
SpaV4l2State *state = &this->state[0];
if (!state->opened)
return 0;
fprintf (stderr, "close\n");
if (close(state->fd))
perror ("close");
state->fd = -1;
state->opened = false;
return 0;
}
static SpaResult
mmap_read (SpaV4l2Source *this)
{