From patchwork Fri Jun 4 07:40:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huzaifa Sidhpurwala X-Patchwork-Id: 104229 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o547gG5r019330 for ; Fri, 4 Jun 2010 07:42:16 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752609Ab0FDHmP (ORCPT ); Fri, 4 Jun 2010 03:42:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41691 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751952Ab0FDHmP (ORCPT ); Fri, 4 Jun 2010 03:42:15 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o547gEqj006455 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 4 Jun 2010 03:42:14 -0400 Received: from localhost.localdomain (dhcp1-186.pnq.redhat.com [10.65.193.186]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o547gBaV028070; Fri, 4 Jun 2010 03:42:12 -0400 From: huzaifas@redhat.com To: linux-media@vger.kernel.org Cc: hdegoede@redhat.com, Huzaifa Sidhpurwala Subject: [PATCH] libv4l1: move VIDIOCCAPTURE to libv4l1 Date: Fri, 4 Jun 2010 13:10:14 +0530 Message-Id: <1275637214-22089-1-git-send-email-huzaifas@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 04 Jun 2010 07:42:16 +0000 (UTC) diff --git a/lib/libv4l1/libv4l1.c b/lib/libv4l1/libv4l1.c index 579f13b..2981c40 100644 --- a/lib/libv4l1/libv4l1.c +++ b/lib/libv4l1/libv4l1.c @@ -967,6 +967,22 @@ int v4l1_ioctl(int fd, unsigned long int request, ...) break; } + + case VIDIOCCAPTURE: { + int *on = arg; + enum v4l2_buf_type captype = V4L2_BUF_TYPE_VIDEO_CAPTURE; + + if (0 == *on) { + /* dirty hack time. But v4l1 has no STREAMOFF + * equivalent in the API, and this one at + * least comes close ... */ + v4l2_ioctl(fd, VIDIOC_STREAMOFF, &captype); + } + + result = v4l2_ioctl(fd, VIDIOC_OVERLAY, on); + + break; + } default: /* Pass through libv4l2 for applications which are using v4l2 through libv4l1 (this can happen with the v4l1compat.so wrapper preloaded */