int main(int argc, char *argv[]) { app_t a = app_create(0); v4l2_dev_t v = v4l2_create(a, "/dev/video2", 0, 0); v4l2_set_img_proc(v, img_proc, v); v4l2_start_capture(v); app_exec(a); v4l2_stop_capture(v); v4l2_free(v); app_free(a); return 0; }
int main(int argc, char *argv[]) { app_t a = app_create(0); jpg_dec_t d = jpg_dec_create(); v4l2_dev_t v = v4l2_create(a, NULL, 0, 0); v4l2_set_img_proc(v, img_proc, d); v4l2_start_capture(v); app_exec(a); v4l2_stop_capture(v); v4l2_free(v); jpg_dec_free(d); app_free(a); return 0; }
static void hndlkey(int key, int kstate) { int i = 0, k; APPLINFO *appl; int title; /* DjV 019 110103 rsc index of current menu title */ if ( (unsigned int)key == HELP ) showhelp(); /* DjV 007 251202 */ k = key & ~XD_CTRL; if ((((unsigned int) k >= 0x803B) && ((unsigned int) k <= 0x8044)) || (((unsigned int) k >= 0x8154) && ((unsigned int) k <= 0x815D))) { k &= 0xFF; k = (k >= 0x54) ? (k - 0x54 + 11) : (k - 0x3B + 1); if ((appl = find_fkey(k)) != NULL) app_exec(NULL, appl, NULL, NULL, 0, kstate, FALSE); } else { /* k = key & ~XD_ALT; DjV 019 100103 */ k = scansh ( key, kstate ); /* DjV 019 100103 */ /* DjV 019 110103 ---vvv--- */ /* while ((keys[i].scancode != k) && (i < (NKEYS - 1))) i++; if (keys[i].scancode == k) */ title = TFIRST; while ( (options.V2_2.kbshort[i] != k) && (i <= ( MLAST - MFIRST)) ) { if ( (options.V2_2.kbshort[i] & XD_ALT) != 0 ) title++; i++; } if ( options.V2_2.kbshort[i] == k ) { /* menu_tnormal(menu, keys[i].title, 0); hndlmenu(keys[i].title, keys[i].item, kstate); */ menu_tnormal(menu, title, 0 ); hndlmenu( title, i + MFIRST, kstate ); } /* DjV 019 110103 ---^^^--- */ else { i = 0; if ((key >= ALT_A) && (key <= ALT_Z)) { i = key - (XD_ALT | 'A'); if (check_drive(i)) { char *path; if ((path = strdup("A:\\")) != NULL) { path[0] = (char) i + 'A'; /* dir_add_window(path); DjV 017 280103 */ dir_add_window(path, NULL); /* DjV 017 280103 */ itm_set_menu(xw_top()); /* DjV 029 160203 */ } else xform_error(ENSMEM); } } } } }
int wcs_run(wcs_t wcs) { struct wcamsrv *ws = wcs; return app_exec(ws->app); }