Add support for trace logging in lockfree ringbuffer

Fix some crashes when the connection is dead.
Small cleanups in the audio mixer
Only propose alloc_buffer when we are using export_buf in v4l2
This commit is contained in:
Wim Taymans 2017-04-27 17:17:47 +02:00
parent b51d3e4862
commit 214a0e27d8
10 changed files with 248 additions and 83 deletions

View file

@ -897,7 +897,7 @@ spa_v4l2_set_format (SpaV4l2Source *this, SpaVideoInfo *format, bool try_only)
framerate->denom = streamparm.parm.capture.timeperframe.numerator;
state->fmt = fmt;
state->info.flags = SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS |
state->info.flags = (state->export_buf ? SPA_PORT_INFO_FLAG_CAN_ALLOC_BUFFERS : 0) |
SPA_PORT_INFO_FLAG_CAN_USE_BUFFERS |
SPA_PORT_INFO_FLAG_LIVE;
state->info.maxbuffering = -1;
@ -1052,7 +1052,7 @@ spa_v4l2_use_buffers (SpaV4l2Source *this, SpaBuffer **buffers, uint32_t n_buffe
if (buffers[i]->n_datas < 1) {
spa_log_error (state->log, "v4l2: invalid memory on buffer %p", buffers[i]);
continue;
return SPA_RESULT_ERROR;
}
d = buffers[i]->datas;
@ -1243,6 +1243,8 @@ spa_v4l2_stream_off (SpaV4l2Source *this)
if (!state->started)
return SPA_RESULT_OK;
spa_v4l2_port_set_enabled (this, false);
type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
if (xioctl (state->fd, VIDIOC_STREAMOFF, &type) < 0) {
spa_log_error (this->log, "VIDIOC_STREAMOFF: %s", strerror (errno));