{"action":"created","issue":{"url":"https://api.github.com/repos/openpnp/libuvc4j/issues/8","repository_url":"https://api.github.com/repos/openpnp/libuvc4j","labels_url":"https://api.github.com/repos/openpnp/libuvc4j/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/openpnp/libuvc4j/issues/8/comments","events_url":"https://api.github.com/repos/openpnp/libuvc4j/issues/8/events","html_url":"https://github.com/openpnp/libuvc4j/issues/8","id":140405996,"number":8,"title":"get specific Format and FrameDescriptors","user":{"login":"lobsteroh","id":12769871,"avatar_url":"https://avatars.githubusercontent.com/u/12769871?v=3","gravatar_id":"","url":"https://api.github.com/users/lobsteroh","html_url":"https://github.com/lobsteroh","followers_url":"https://api.github.com/users/lobsteroh/followers","following_url":"https://api.github.com/users/lobsteroh/following{/other_user}","gists_url":"https://api.github.com/users/lobsteroh/gists{/gist_id}","starred_url":"https://api.github.com/users/lobsteroh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lobsteroh/subscriptions","organizations_url":"https://api.github.com/users/lobsteroh/orgs","repos_url":"https://api.github.com/users/lobsteroh/repos","events_url":"https://api.github.com/users/lobsteroh/events{/privacy}","received_events_url":"https://api.github.com/users/lobsteroh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-12T18:43:28Z","updated_at":"2016-03-13T18:13:25Z","closed_at":null,"body":"Hi, I am trying to iterate through all available streamformats and all frameformats inside, similar to what happens in uvc_print_diag, but i only seem to get the first instance of each with ... \r\n\r\n    public static void listAllFrameDescriptors(Pointer<uvc_device_handle> devh, int formatIndex, int frameIndex) throws Exception {\r\n        Pointer<uvc_format_desc> fmtDescPtr = UvcLibrary.uvc_get_format_descs(devh);\r\n        uvc_format_desc fmtDesc = fmtDescPtr.get(formatIndex);\r\n        System.out.println(fmtDesc.bDescriptorSubtype());\r\n        uvc_frame_desc frameDesc = fmtDesc.frame_descs().get(frameIndex);\r\n        System.out.println(frameDesc.bDescriptorSubtype() + \"; w: \" + frameDesc.wWidth() + \"; h: \" + frameDesc.wHeight() + \" \");\r\n    }\r\n\r\ni am only managing to get the first instance of each by calling\r\n\r\n    listFrameDescriptor(devh,0,0)\r\n\r\nany index other than 0 fetches trouble.\r\n\r\nany suggestions or examples on how to do this correctly are greatly welcome"},"comment":{"url":"https://api.github.com/repos/openpnp/libuvc4j/issues/comments/196015108","html_url":"https://github.com/openpnp/libuvc4j/issues/8#issuecomment-196015108","issue_url":"https://api.github.com/repos/openpnp/libuvc4j/issues/8","id":196015108,"user":{"login":"vonnieda","id":1182323,"avatar_url":"https://avatars.githubusercontent.com/u/1182323?v=3","gravatar_id":"","url":"https://api.github.com/users/vonnieda","html_url":"https://github.com/vonnieda","followers_url":"https://api.github.com/users/vonnieda/followers","following_url":"https://api.github.com/users/vonnieda/following{/other_user}","gists_url":"https://api.github.com/users/vonnieda/gists{/gist_id}","starred_url":"https://api.github.com/users/vonnieda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vonnieda/subscriptions","organizations_url":"https://api.github.com/users/vonnieda/orgs","repos_url":"https://api.github.com/users/vonnieda/repos","events_url":"https://api.github.com/users/vonnieda/events{/privacy}","received_events_url":"https://api.github.com/users/vonnieda/received_events","type":"User","site_admin":false},"created_at":"2016-03-13T18:13:25Z","updated_at":"2016-03-13T18:13:25Z","body":"Sorry Robert, I don't have a good answer for you. I have not tried to do\nwhat you are doing yet.\n\nMake sure you are checking for null in your fmtDescPtr.get(formatIndex), as\nthis will return null at the end of the list. Same for the\nfmtDesc.frame_descs().get(frameIndex); call.\n\nJason\n\n\nOn Sat, Mar 12, 2016 at 10:43 AM Robert Huber <notifications@github.com>\nwrote:\n\n> Hi, I am trying to iterate through all available streamformats and all\n> frameformats inside, similar to what happens in uvc_print_diag, but i only\n> seem to get the first instance of each with ...\n>\n> public static void listAllFrameDescriptors(Pointer<uvc_device_handle> devh, int formatIndex, int frameIndex) throws Exception {\n>     Pointer<uvc_format_desc> fmtDescPtr = UvcLibrary.uvc_get_format_descs(devh);\n>     uvc_format_desc fmtDesc = fmtDescPtr.get(formatIndex);\n>     System.out.println(fmtDesc.bDescriptorSubtype());\n>     uvc_frame_desc frameDesc = fmtDesc.frame_descs().get(frameIndex);\n>     System.out.println(frameDesc.bDescriptorSubtype() + \"; w: \" + frameDesc.wWidth() + \"; h: \" + frameDesc.wHeight() + \" \");\n> }\n>\n> i am only managing to get the first instance of each by calling\n>\n> listFrameDescriptor(devh,0,0)\n>\n> any index other than 0 fetches trouble.\n>\n> any suggestions or examples on how to do this correctly are greatly welcome\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/openpnp/libuvc4j/issues/8>.\n>\n"}}