From owner-freebsd-multimedia@freebsd.org Tue Nov 24 09:45:57 2015 Return-Path: Delivered-To: freebsd-multimedia@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 4D33EA35722 for ; Tue, 24 Nov 2015 09:45:57 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: from mail-qg0-x22e.google.com (mail-qg0-x22e.google.com [IPv6:2607:f8b0:400d:c04::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 0AFF91C4A for ; Tue, 24 Nov 2015 09:45:56 +0000 (UTC) (envelope-from otacilio.neto@bsd.com.br) Received: by qgec40 with SMTP id c40so6562280qge.2 for ; Tue, 24 Nov 2015 01:45:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsd.com.br; s=capeta; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=KmolLFOGagHxvu7PgRppV2BPzfexV3lUjfkFZ3sOlSc=; b=GJh4jf2y4xL9DsfhvQDXD/7ttwHBJx4mMWBJNBIjfK17aJLwt0r6+Rytt7vn/c4jJ4 zT60DFBBQhuSBoIlVXaMXkPUR43ODPbeKTazI0HsytKrqcqV8gryk7e4qReWtH1xnJEm OG9Y21z1BXZA9IMaCRt0T21NCZ557IUOMti+0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=KmolLFOGagHxvu7PgRppV2BPzfexV3lUjfkFZ3sOlSc=; b=k1t6wo/N+5B5bRwguLU00L0do0jiXB1HnsYVQ7wm5XLOSixAcWKlN2zmtojAY6a327 e7tAn9XqIJEbOAUoSBMzMoEMOWKF8jON9XS0x0UnXx8HxxR88Qij1GbUCUFs58B+/VtU T7dqDXfu4ESPxb1zacBR4W/XQMrRv5XcRWApbSxDpKJTsL7+EGbhNcQvWOM3QfukdV67 5+8YeM7220dXINW2LClOj/PXWB4pWlrzp+7w9nblSFDJ6nUYzhqi7e4ZP7LFP4p6Nmh8 l9sUKXiGtcE0wBDmc+J/5/k84fwUOMSxefAOwcQGJBH3t31GFAMxqyoMEbMsV2Jxf6jh W4tg== X-Gm-Message-State: ALoCoQkzAT7EUc3sad2/qZTFqMjvKGOTTjnXQrCzlVqgQd6QUyDrJRnRKIE0h2iu6f8qnZgGHSzS X-Received: by 10.140.239.87 with SMTP id k84mr34799526qhc.87.1448358355838; Tue, 24 Nov 2015 01:45:55 -0800 (PST) Received: from [192.168.25.11] ([187.115.184.23]) by smtp.googlemail.com with ESMTPSA id f7sm3992017qhf.7.2015.11.24.01.45.54 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 24 Nov 2015 01:45:55 -0800 (PST) Subject: Re: linux/uvcvideo.h To: Hans Petter Selasky , freebsd-multimedia@freebsd.org References: <5653D36B.5040906@bsd.com.br> <56541D9A.3090703@selasky.org> Cc: otaciliodearaujo@gmail.com From: =?UTF-8?B?T3RhY8OtbGlv?= Message-ID: <565431C8.10309@bsd.com.br> Date: Tue, 24 Nov 2015 06:45:44 -0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <56541D9A.3090703@selasky.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Nov 2015 09:45:57 -0000 Em 24/11/2015 05:19, Hans Petter Selasky escreveu: > On 11/24/15 04:03, Otacílio wrote: >> Dears >> >> I'm compiling a program that uses the header file linux/uvcvideo.h >> >> I think that this file must be on v4l_compat but this file is not in >> v4l_compat-1.6.3*. This file must be add to v4l_compat or this file is >> not necessary on FreeBSD? >> > > Hi, > > Currently the v4l_compat only contains V4L1/2 IOCTLs only. > > What API's do you need? > > --HPS > Hello Sr. Selasky I'm using a Qualitech C920 camera to get a video stream codified using the hardware of the camera (H264). The default bitrate of the camera is about 3500Mbps, so I need change this value to a smaller. Googling I found a example for Linux that changes the bitrate and I'm using the example on my software on FreeBSD. The code that I need is this below: static void setBitrate(int bmin, int bmax){ int res; struct uvc_xu_control_query ctrl; uvcx_bitrate_layers_t conf; ctrl.unit = 12; ctrl.size = 10; ctrl.selector = UVCX_BITRATE_LAYERS; ctrl.data = &conf; ctrl.query = UVC_GET_CUR; conf.wLayerID = 0; conf.dwPeakBitrate = conf.dwAverageBitrate = 0; res = xioctl(fd, UVCIOC_CTRL_QUERY, &ctrl); if (res) { perror("ctrl_query"); return; } fprintf(stderr, "Bitrate was %d [%d]\n", conf.dwPeakBitrate * 8, conf.dwAverageBitrate * 8); conf.dwPeakBitrate = bmax; conf.dwAverageBitrate = bmin; ctrl.query = UVC_SET_CUR; res = xioctl(fd, UVCIOC_CTRL_QUERY, &ctrl); if (res) { perror("ctrl_query"); return; } fprintf(stderr, "Bitrate request %d [%d]\n", conf.dwPeakBitrate * 8, conf.dwAverageBitrate * 8); ctrl.query = UVC_GET_CUR; res = xioctl(fd, UVCIOC_CTRL_QUERY, &ctrl); if (res) { perror("ctrl_query"); return; } fprintf(stderr, "Bitrate now %d [%d]\n", conf.dwPeakBitrate * 8, conf.dwAverageBitrate * 8); } static void setRCMode(int mode){ int res; struct uvc_xu_control_query ctrl; uvcx_rate_control_mode_t conf; ctrl.selector = UVCX_RATE_CONTROL_MODE; ctrl.size = 3; ctrl.unit = 12; ctrl.data = &conf; ctrl.query = UVC_GET_CUR; conf.wLayerID = 0; res = xioctl(fd, UVCIOC_CTRL_QUERY, &ctrl); if (res) { perror("query"); return;} fprintf(stderr, "RC mode was %d\n", (int)conf.bRateControlMode); conf.bRateControlMode = mode; ctrl.query = UVC_SET_CUR; res = xioctl(fd, UVCIOC_CTRL_QUERY, &ctrl); if (res) { perror("query"); return;} fprintf(stderr, "RC mode request %d\n", (int)conf.bRateControlMode); ctrl.query = UVC_GET_CUR; res = xioctl(fd, UVCIOC_CTRL_QUERY, &ctrl); if (res) { perror("query"); return;} fprintf(stderr, "RC mode now %d\n", (int)conf.bRateControlMode); } So, when I try compile this software I got this errors: cc -I/usr/local/include -I../Capture\ H264 -I../lib -c -o capture.o capture.c capture.c:463:31: error: variable has incomplete type 'struct uvc_xu_control_query' struct uvc_xu_control_query ctrl; ^ capture.c:463:10: note: forward declaration of 'struct uvc_xu_control_query' struct uvc_xu_control_query ctrl; ^ capture.c:472:20: error: use of undeclared identifier 'UVCIOC_CTRL_QUERY' res = xioctl(fd, UVCIOC_CTRL_QUERY, &ctrl); ^ capture.c:482:20: error: use of undeclared identifier 'UVCIOC_CTRL_QUERY' res = xioctl(fd, UVCIOC_CTRL_QUERY, &ctrl); ^ capture.c:490:20: error: use of undeclared identifier 'UVCIOC_CTRL_QUERY' res = xioctl(fd, UVCIOC_CTRL_QUERY, &ctrl); ^ capture.c:501:31: error: variable has incomplete type 'struct uvc_xu_control_query' struct uvc_xu_control_query ctrl; ^ capture.c:501:10: note: forward declaration of 'struct uvc_xu_control_query' struct uvc_xu_control_query ctrl; ^ capture.c:509:20: error: use of undeclared identifier 'UVCIOC_CTRL_QUERY' res = xioctl(fd, UVCIOC_CTRL_QUERY, &ctrl); ^ capture.c:514:20: error: use of undeclared identifier 'UVCIOC_CTRL_QUERY' res = xioctl(fd, UVCIOC_CTRL_QUERY, &ctrl); ^ capture.c:518:20: error: use of undeclared identifier 'UVCIOC_CTRL_QUERY' res = xioctl(fd, UVCIOC_CTRL_QUERY, &ctrl); ^ 8 errors generated. Makefile:6: recipe for target 'capture.o' failed gmake: *** [capture.o] Error 1 What is the best solution to this problem? I need add the header file #include ? Thanks a lot! -Otacílio