|
|
|
|
@ -395,7 +395,7 @@ int VideoDev_V4L2::CaptureStart() {
|
|
|
|
|
return VDEV_STATUS_ERROR;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ConvertStart(&cdata, fmt.fmt.pix.pixelformat);
|
|
|
|
|
pixelformat = fmt.fmt.pix.pixelformat;
|
|
|
|
|
|
|
|
|
|
return VDEV_STATUS_OK;
|
|
|
|
|
};
|
|
|
|
|
@ -405,8 +405,6 @@ int VideoDev_V4L2::CaptureStop() {
|
|
|
|
|
enum v4l2_buf_type type;
|
|
|
|
|
printf ("%s:%d %s\n", __FILE__, __LINE__, __FUNCTION__);
|
|
|
|
|
|
|
|
|
|
ConvertStop(&cdata, fmt.fmt.pix.pixelformat);
|
|
|
|
|
|
|
|
|
|
switch (io) {
|
|
|
|
|
case IOMODE_READ:
|
|
|
|
|
/* Nothing to do. */
|
|
|
|
|
@ -431,7 +429,7 @@ int VideoDev_V4L2::CaptureStop() {
|
|
|
|
|
* If something goes wrong return an error code.
|
|
|
|
|
* Return code VDEV_STATUS_AGAIN is not an error. There was no video image ready to read.
|
|
|
|
|
*/
|
|
|
|
|
int VideoDev_V4L2::Grab(VideoFrame *vf) {
|
|
|
|
|
int VideoDev_V4L2::Grab(VideoFrameRaw *vf) {
|
|
|
|
|
struct v4l2_buffer buf;
|
|
|
|
|
int len;
|
|
|
|
|
|
|
|
|
|
@ -451,7 +449,7 @@ int VideoDev_V4L2::Grab(VideoFrame *vf) {
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
LockMutex();
|
|
|
|
|
Convert(&cdata, vf, inbuffer[0].data, len, fmt.fmt.pix.pixelformat, fmt.fmt.pix.width, fmt.fmt.pix.height);
|
|
|
|
|
|
|
|
|
|
UnLockMutex();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
@ -477,7 +475,7 @@ int VideoDev_V4L2::Grab(VideoFrame *vf) {
|
|
|
|
|
|
|
|
|
|
if (buf.index >= 0 && buf.index < VDEV_INBUFFERS) {
|
|
|
|
|
LockMutex();
|
|
|
|
|
Convert(&cdata, vf, inbuffer[buf.index].data, buf.bytesused, fmt.fmt.pix.pixelformat, fmt.fmt.pix.width, fmt.fmt.pix.height);
|
|
|
|
|
vf->CopyFrom(fmt.fmt.pix.pixelformat, fmt.fmt.pix.width, fmt.fmt.pix.height, buf.bytesused, inbuffer[buf.index].data);
|
|
|
|
|
UnLockMutex();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|