change the way v4l_multi_buffer is loaded. Since t's a bool, it theoretically is 1 byte, so can't use atoi
This commit is contained in:
parent
9385471392
commit
99a3684fb5
|
@ -781,13 +781,16 @@ void LocalCamera::Initialise()
|
||||||
Debug( 3, "Setting up request buffers" );
|
Debug( 3, "Setting up request buffers" );
|
||||||
|
|
||||||
memset( &v4l2_data.reqbufs, 0, sizeof(v4l2_data.reqbufs) );
|
memset( &v4l2_data.reqbufs, 0, sizeof(v4l2_data.reqbufs) );
|
||||||
if ( channel_count > 1 )
|
if ( channel_count > 1 ) {
|
||||||
if ( v4l_multi_buffer )
|
if ( v4l_multi_buffer ){
|
||||||
v4l2_data.reqbufs.count = 2*channel_count;
|
v4l2_data.reqbufs.count = 2*channel_count;
|
||||||
else
|
} else {
|
||||||
v4l2_data.reqbufs.count = 1;
|
v4l2_data.reqbufs.count = 1;
|
||||||
else
|
}
|
||||||
|
} else {
|
||||||
v4l2_data.reqbufs.count = 8;
|
v4l2_data.reqbufs.count = 8;
|
||||||
|
}
|
||||||
|
|
||||||
v4l2_data.reqbufs.type = v4l2_data.fmt.type;
|
v4l2_data.reqbufs.type = v4l2_data.fmt.type;
|
||||||
v4l2_data.reqbufs.memory = V4L2_MEMORY_MMAP;
|
v4l2_data.reqbufs.memory = V4L2_MEMORY_MMAP;
|
||||||
|
|
||||||
|
@ -806,7 +809,7 @@ void LocalCamera::Initialise()
|
||||||
if ( v4l2_data.reqbufs.count < (v4l_multi_buffer?2:1) )
|
if ( v4l2_data.reqbufs.count < (v4l_multi_buffer?2:1) )
|
||||||
Fatal( "Insufficient buffer memory %d on video device", v4l2_data.reqbufs.count );
|
Fatal( "Insufficient buffer memory %d on video device", v4l2_data.reqbufs.count );
|
||||||
|
|
||||||
Debug( 3, "Setting up %d data buffers", v4l2_data.reqbufs.count );
|
Debug( 3, "Setting up data buffers: Channels %d MultiBuffer %d Buffers: %s", channel_count, v4l_multi_buffer, v4l2_data.reqbufs.count );
|
||||||
|
|
||||||
v4l2_data.buffers = new V4L2MappedBuffer[v4l2_data.reqbufs.count];
|
v4l2_data.buffers = new V4L2MappedBuffer[v4l2_data.reqbufs.count];
|
||||||
#if HAVE_LIBSWSCALE
|
#if HAVE_LIBSWSCALE
|
||||||
|
|
|
@ -1862,7 +1862,7 @@ int Monitor::LoadLocalMonitors( const char *device, Monitor **&monitors, Purpose
|
||||||
const char *device = dbrow[col]; col++;
|
const char *device = dbrow[col]; col++;
|
||||||
int channel = atoi(dbrow[col]); col++;
|
int channel = atoi(dbrow[col]); col++;
|
||||||
int format = atoi(dbrow[col]); col++;
|
int format = atoi(dbrow[col]); col++;
|
||||||
bool v4l_multi_buffer = atoi(dbrow[col]); col++;
|
bool v4l_multi_buffer = (*dbrow[col] == 48 ? false : true); col++;
|
||||||
int v4l_captures_per_frame = atoi(dbrow[col]); col++;
|
int v4l_captures_per_frame = atoi(dbrow[col]); col++;
|
||||||
const char *method = dbrow[col]; col++;
|
const char *method = dbrow[col]; col++;
|
||||||
|
|
||||||
|
@ -2464,7 +2464,7 @@ Monitor *Monitor::Load( int id, bool load_zones, Purpose purpose )
|
||||||
std::string device = dbrow[col]; col++;
|
std::string device = dbrow[col]; col++;
|
||||||
int channel = atoi(dbrow[col]); col++;
|
int channel = atoi(dbrow[col]); col++;
|
||||||
int format = atoi(dbrow[col]); col++;
|
int format = atoi(dbrow[col]); col++;
|
||||||
bool v4l_multi_buffer = atoi(dbrow[col]); col++;
|
bool v4l_multi_buffer = (*dbrow[col] == 48 ? false : true); col++;
|
||||||
int v4l_captures_per_frame = atoi(dbrow[col]); col++;
|
int v4l_captures_per_frame = atoi(dbrow[col]); col++;
|
||||||
|
|
||||||
std::string protocol = dbrow[col]; col++;
|
std::string protocol = dbrow[col]; col++;
|
||||||
|
|
Loading…
Reference in New Issue