GF_Err gf_filter_request_opengl(GF_Filter *filter)
{
#ifndef GPAC_DISABLE_3D
	GF_Err e;
	if (filter->finalized || filter->removed) return GF_OK;

	filter->session->nb_gl_filters++;
	e = gf_fs_check_gl_provider(filter->session);
	if (e) {
		filter->session->nb_gl_filters--;
		filter->main_thread_forced = GF_FALSE;
		return e;
	}
	if (!(filter->freg->flags & GF_FS_REG_CONFIGURE_MAIN_THREAD))
		filter->main_thread_forced = GF_TRUE;
	return GF_OK;
#else
	return GF_NOT_SUPPORTED;
#endif
}
GF_Err gf_filter_request_opengl(GF_Filter *filter)
{
#ifndef GPAC_DISABLE_3D
	GF_Err e;
	if (filter->finalized || filter->removed) return GF_OK;

	filter->session->nb_gl_filters++;
	e = gf_fs_check_gl_provider(filter->session);
	if (e) {
		filter->session->nb_gl_filters--;
		filter->main_thread_forced = GF_FALSE;
		return e;
	}
	if (!(filter->freg->flags & GF_FS_REG_CONFIGURE_MAIN_THREAD))
		filter->main_thread_forced = GF_TRUE;
	return GF_OK;
#else
	return GF_NOT_SUPPORTED;
#endif
}