]> git.sesse.net Git - vlc/blobdiff - modules/visualization/projectm.cpp
New sub-filter support add new "sub filter" capability for processing subpictures...
[vlc] / modules / visualization / projectm.cpp
index 8ab159ed67e8537cedb865de728b1d9ad79c6ab0..e76e9dd8303fbb9d21029546111f164136a1f45a 100644 (file)
@@ -33,6 +33,7 @@
 #include <vlc_aout.h>
 #include <vlc_vout.h>
 #include <vlc_vout_wrapper.h>
+#include <vlc_opengl.h>
 #include <vlc_filter.h>
 #include <vlc_rand.h>
 
@@ -82,8 +83,12 @@ vlc_module_begin ()
 #ifndef HAVE_PROJECTM2
     add_loadfile( "projectm-config", "/usr/share/projectM/config.inp",
                   CONFIG_TEXT, CONFIG_LONGTEXT, true )
+#else
+#ifdef WIN32
+    add_directory( "projectm-preset-path", NULL,
 #else
     add_directory( "projectm-preset-path", "/usr/share/projectM/presets",
+#endif
                   PRESET_PATH_TXT, PRESET_PATH_LONGTXT, true )
     add_font( "projectm-title-font", "/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf",
                   TITLE_FONT_TXT, TITLE_FONT_LONGTXT, true )
@@ -281,7 +286,7 @@ static void *Thread( void *p_data )
     filter_sys_t *p_sys = p_filter->p_sys;
     int cancel = vlc_savecancel();
     video_format_t fmt;
-    vout_opengl_t *gl;
+    vlc_gl_t *gl;
     int i_last_width  = 0;
     int i_last_height = 0;
     locale_t loc;
@@ -349,6 +354,14 @@ static void *Thread( void *p_data )
     free( psz_config );
 #else
     psz_preset_path = var_InheritString( p_filter, "projectm-preset-path" );
+#ifdef WIN32
+    if ( psz_preset_path == NULL )
+    {
+        char *psz_data_path = config_GetDataDir( p_filter );
+        asprintf( &psz_preset_path, "%s" DIR_SEP "visualization", psz_data_path );
+        free( psz_data_path );
+    }
+#endif
     psz_title_font = var_InheritString( p_filter, "projectm-title-font" );
     psz_menu_font = var_InheritString( p_filter, "projectm-menu-font" );
 
@@ -430,10 +443,10 @@ static void *Thread( void *p_data )
         /* */
         mwait( i_deadline );
 
-        if( !vout_opengl_Lock(gl) )
+        if( !vlc_gl_Lock(gl) )
         {
-            vout_opengl_Swap( gl );
-            vout_opengl_Unlock( gl );
+            vlc_gl_Swap( gl );
+            vlc_gl_Unlock( gl );
         }
     }
     abort();