|
From: | Vadim Lebedev |
Subject: | Re: [Linphone-developers] H264 Support |
Date: | Thu, 16 Jul 2009 15:00:35 +0200 |
User-agent: | Thunderbird 2.0.0.22 (X11/20090608) |
Hello, As i wrote in my previous email i had problem to activate video capture on my platform. I've nailed it down. V4L2 Api says that VIDIOC_STREAMON ioctl should return EINVAL if there is now enqueued buffers... This was EXACTLY what happened in my case... (It seems that some camera drivers does not respect this requirement and because of this the actual code in v4l2.c sometimes works). Si i've uncommented and modified a little bit a loop which is just before ioctl(..VIDIOC_STREAMON) in msv4l2.c And oopsla it works.... The patch is attached.... Thanks Vadim Vadim Lebedev wrote: Hello, |
--- /home/vadim/linphone-svn/mediastreamer2/src/msv4l2.c 2009-06-09 18:47:01.000000000 +0200 +++ ./msv4l2.c 2009-07-16 12:18:27.000000000 +0200 @@ -197,7 +197,7 @@ memset(&req,0,sizeof(req)); - req.count = 4; + req.count = 4; /* V.L. original value of 4 does not work on GIP */ req.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; req.memory = V4L2_MEMORY_MMAP; @@ -235,7 +235,7 @@ s->frames[i]=msg; } s->frame_max=req.count; - /* + for (i = 0; i < s->frame_max; ++i) { struct v4l2_buffer buf; @@ -246,9 +246,13 @@ if (-1==ioctl (s->fd, VIDIOC_QBUF, &buf)){ ms_error("VIDIOC_QBUF failed: %s",strerror(errno)); } + else { + s->frames[i]->b_datap->db_ref++; + s->queued++; + } } - */ - /*start capture immediately*/ + + /* start capture immediately */ type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if (-1 ==ioctl (s->fd, VIDIOC_STREAMON, &type)){ ms_error("VIDIOC_STREAMON failed: %s",strerror(errno));
[Prev in Thread] | Current Thread | [Next in Thread] |