×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    59

    Video4Linux API: Trying to access User and Extended Controls on MeeGo

    PROBLEM SOLVED!!!

    Hello all,

    While reading through the MeeGo documentation , I noticed that the v4l2 API is supported on MeeGo.

    I am working on porting Maemo application to MeeGo, but got stuck at the v4l2 implementation. I am trying to read a camera control variable V4L2_CID_FOCUS_ABSOLUTE, but end up with an error argument not supported. When I try to enumerate through all of the supported control arguments I do not retrieve any, while the same code return 24 user controls on a maemo device.

    Question:
    1.) Is it possible to use http://v4l2spec.bytesex.org/spec/x542.htm and Extended Controls of v4l2 API on MeeGo.

    2.) If so, do you have any idea why the code bellow returns 24 controls of Maemo device and 0 on Meego.
    Code:
    void InitV4l2Driver(){
    	const char *device = "/dev/video0"; //tried video 1, 2, 3 and 4
    	fd = open(device, O_RDWR, 0);
    	
    	if(fd < 0) {
    		fprintf(stderr, "Unable to open %s: %s\n", device, strerror(errno));
    		printf("Unable to open %s: %s\n", device, strerror(errno));
    	}
    
            int count=0;
            struct v4l2_queryctrl qctrl;
            qctrl.id = V4L2_CTRL_FLAG_NEXT_CTRL;
       
            while (0 == ioctl (fd, VIDIOC_QUERYCTRL, &qctrl)) {
    	       count++;
                   qctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;
            }
            printf("Number of controls: %d\n",count);
    }
    Thx for your help.

    Klen
    Last edited by Klen; 2011-11-15 at 22:59.

  2. #2
    Super Contributor
    Join Date
    Mar 2009
    Posts
    1,024

    Re: Video4Linux API: Trying to access User and Extended Controls on MeeGo

    Hi,
    I guess you could get 0 if the security policy doesn't allow you that operation.
    Have you defined an aegis file for your app?

    I suppose you need a manifest file like this:
    <aegis>
    <request>
    <credential name="GRP::video " />
    <for path="/opt/MY_APP_NAME/bin/MY_APP_NAME" />
    </request>
    </aegis>

    Even if "user" unix user belongs to "video" unix group sometime it's necessary to request for that capability explicitly.

  3. #3
    Regular Contributor
    Join Date
    Jun 2008
    Posts
    59

    Re: Video4Linux API: Trying to access User and Extended Controls on MeeGo

    Thanks Gnuton for your addvice.

    I managed to solve the problem. The solution can be found on this MeeGoo forum thread. I am running applications logged in as developer and get video privilidges. I know this becaus I can create a gstreamer pipleine and I can do that only when logged in as developer.

    Will need to add the manifest when I get to release stage of the application dev.

    Thanks again,
    Klen

Similar Threads

  1. Replies: 2
    Last Post: 2010-10-22, 23:35
  2. Symbian user interface controls
    By lokesh_kumar_s in forum Symbian
    Replies: 2
    Last Post: 2010-05-11, 11:37
  3. Mixing native controls from UI Design Editor with custom controls
    By elviin in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-05-12, 07:39
  4. User interface controls
    By devservices in forum Symbian
    Replies: 2
    Last Post: 1970-01-01, 02:00

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×