This commit is contained in:
Wim Taymans 2016-09-20 11:20:43 +02:00
parent 49cfe41c94
commit 77f93e37ed
12 changed files with 1458 additions and 39 deletions

View file

@ -783,7 +783,7 @@ spa_v4l2_source_clock_get_time (SpaClock *clock,
state = &this->state[0];
if (rate)
*rate = 1000000;
*rate = SPA_USEC_PER_SEC;
if (ticks)
*ticks = state->last_ticks;
if (monotonic_time)
@ -856,12 +856,12 @@ v4l2_source_init (const SpaHandleFactory *factory,
this->props[1].props.prop_info = prop_info;
reset_v4l2_source_props (&this->props[1]);
this->state[0].info.flags = SPA_PORT_INFO_FLAG_NONE;
this->state[0].info.flags = SPA_PORT_INFO_FLAG_LIVE;
this->state[0].status.flags = SPA_PORT_STATUS_FLAG_NONE;
this->state[0].export_buf = true;
for (i = 0; info && i < info->n_items; i ++) {
for (i = 0; info && i < info->n_items; i++) {
if (!strcmp (info->items[i].key, "device.path")) {
strncpy (this->props[1].device, info->items[i].value, 63);
this->props[1].props.unset_mask &= ~1;

View file

@ -785,9 +785,10 @@ spa_v4l2_set_format (SpaV4l2Source *this, V4l2Format *f, bool try_only)
state->fmt = fmt;
state->info.flags = SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS |
SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS;
SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS |
SPA_PORT_INFO_FLAG_LIVE;
state->info.maxbuffering = -1;
state->info.latency = (streamparm.parm.capture.timeperframe.numerator * 1000000000LL) /
state->info.latency = (streamparm.parm.capture.timeperframe.numerator * SPA_NSEC_PER_SEC) /
streamparm.parm.capture.timeperframe.denominator;
state->info.n_params = 1;
@ -833,7 +834,7 @@ mmap_read (SpaV4l2Source *this)
if (buf.flags & V4L2_BUF_FLAG_ERROR)
b->header.flags |= SPA_BUFFER_FLAG_CORRUPTED;
state->last_ticks = (int64_t)buf.timestamp.tv_sec * 1000000 + (uint64_t)buf.timestamp.tv_usec;
state->last_ticks = (int64_t)buf.timestamp.tv_sec * SPA_USEC_PER_SEC + (uint64_t)buf.timestamp.tv_usec;
b->header.seq = buf.sequence;
b->header.pts = state->last_ticks * 1000;