-
-/**
- * Init the openGL context
- * p_thread: projectm thread object
- * @return VLC_SUCCESS or vlc error codes
- */
-static int initOpenGL( filter_t *p_filter )
-{
- filter_sys_t *p_sys = p_filter->p_sys;
-
- p_sys->p_opengl =
- (vout_thread_t *)vlc_object_create( p_filter, sizeof(vout_thread_t) );
- if( !p_sys->p_opengl )
- return VLC_ENOMEM;
-
- vlc_object_attach( p_sys->p_opengl, p_filter );
-
- /* Initialize the opengl object */
- video_format_Setup( &p_sys->p_opengl->fmt_in, VLC_CODEC_RGB32,
- p_sys->i_width, p_sys->i_height, 1 );
- p_sys->p_opengl->i_window_width = p_sys->i_width;
- p_sys->p_opengl->i_window_height = p_sys->i_height;
- p_sys->p_opengl->render.i_width = p_sys->i_width;
- p_sys->p_opengl->render.i_height = p_sys->i_height;
- p_sys->p_opengl->render.i_aspect = VOUT_ASPECT_FACTOR;
- p_sys->p_opengl->b_fullscreen = false;
- p_sys->p_opengl->b_autoscale = true;
- p_sys->p_opengl->i_alignment = 0;
- p_sys->p_opengl->fmt_in.i_sar_num = 1;
- p_sys->p_opengl->fmt_in.i_sar_den = 1;
- p_sys->p_opengl->fmt_render = p_sys->p_opengl->fmt_in;
-
- /* Ask for the opengl provider */
- p_sys->p_module = module_need( p_sys->p_opengl, "opengl provider",
- NULL, false );
- if( !p_sys->p_module )
- {
- msg_Err( p_filter, "unable to initialize OpenGL" );
- vlc_object_detach( p_sys->p_opengl );
- vlc_object_release( p_sys->p_opengl );
- return VLC_EGENERIC;
- }
-
- return VLC_SUCCESS;
-}
-
-