int main(int argc, char* argv[]) { if (argc != 3) { printf("Usage: vpxcams <cam_id> <port>\n"); return -1; } int cam_id = atoi(argv[1]); int port = atoi(argv[2]); int width = CAM_WIDTH; int height = CAM_HEIGHT; if (!cam_open(cam_id, width, height, true)) { printf("Could not open camera: %d\n", cam_id); return -1; } vpx_init(width, height); server* s = new server(width, height, port); boost::thread server_thread(&server::run, s); cam_loop(width, height, s); vpx_cleanup(); server_thread.join(); return 0; }
static int vp9_init(AVCodecContext *avctx) { const struct vpx_codec_iface *iface = dlsym(RTLD_DEFAULT, "vpx_codec_vp9_dx_algo"); return iface ? vpx_init(avctx, iface) : AVERROR_DECODER_NOT_FOUND; }
static int vp8_init(AVCodecContext *avctx) { return vpx_init(avctx, &vpx_codec_vp8_dx_algo); }