/** * Create the capture */ static void *xshm_create(obs_data_t settings, obs_source_t source) { UNUSED_PARAMETER(source); struct xshm_data *data = bzalloc(sizeof(struct xshm_data)); data->dpy = XOpenDisplay(NULL); if (!data->dpy) { blog(LOG_ERROR, "xshm-input: Unable to open X display !"); goto fail; } if (!XShmQueryExtension(data->dpy)) { blog(LOG_ERROR, "xshm-input: XShm extension not found !"); goto fail; } data->use_xinerama = xinerama_is_active(data->dpy) ? true : false; obs_enter_graphics(); data->cursor = xcursor_init(data->dpy); obs_leave_graphics(); xshm_update(data, settings); return data; fail: xshm_destroy(data); return NULL; }
/** * Create the capture */ static void *xshm_create(obs_data_t *settings, obs_source_t *source) { struct xshm_data *data = bzalloc(sizeof(struct xshm_data)); data->source = source; xshm_update(data, settings); return data; }