[vlc-commits] [Git][videolan/vlc][master] 2 commits: Introduce VLC_SNAPSHOTS_DIR for consistent default snapshots folder.

Steve Lhomme (@robUx4) gitlab at videolan.org
Sat Nov 18 07:03:04 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
dce86501 by Vikram Kangotra at 2023-11-18T06:18:57+00:00
Introduce VLC_SNAPSHOTS_DIR for consistent default snapshots folder.

Standardize default snapshots folder across platforms with the
introduction of VLC_SNAPSHOTS_DIR. Users can still customize this
directory in Preferences.

Resolves: #27424.

- - - - -
33f7d18b by Vikram Kangotra at 2023-11-18T06:18:57+00:00
Utilize VLC_SNAPSHOTS_DIR for core snapshots and scene detection.

Modify core snapshot and scene detection functionalities to use
VLC_SNAPSHOTS_DIR, ensuring a standardized default snapshots folder.
Users can customize this directory in Preferences.

- - - - -


9 changed files:

- include/vlc_configuration.h
- modules/video_filter/scene.c
- src/android/specific.c
- src/darwin/dirs.m
- src/os2/dirs.c
- src/posix/dirs.c
- src/video_output/snapshot.c
- src/win32/dirs-uap.c
- src/win32/dirs.c


Changes:

=====================================
include/vlc_configuration.h
=====================================
@@ -303,6 +303,7 @@ typedef enum vlc_user_dir
     VLC_MUSIC_DIR,
     VLC_PICTURES_DIR,
     VLC_VIDEOS_DIR,
+    VLC_SNAPSHOTS_DIR,
 } vlc_userdir_t;
 
 VLC_API char * config_GetUserDir( vlc_userdir_t ) VLC_USED VLC_MALLOC;


=====================================
modules/video_filter/scene.c
=====================================
@@ -194,7 +194,7 @@ static int Create( filter_t *p_filter )
     p_sys->psz_prefix = var_CreateGetString( p_filter, CFG_PREFIX "prefix" );
     p_sys->psz_path = var_GetNonEmptyString( p_filter, CFG_PREFIX "path" );
     if( p_sys->psz_path == NULL )
-        p_sys->psz_path = config_GetUserDir( VLC_PICTURES_DIR );
+        p_sys->psz_path = config_GetUserDir( VLC_SNAPSHOTS_DIR );
 
     if (unlikely(p_sys->psz_path == NULL))
     {


=====================================
src/android/specific.c
=====================================
@@ -35,7 +35,7 @@
 #include <jni.h>
 
 static JavaVM *s_jvm = NULL;
-#define GENERIC_DIR_COUNT (VLC_VIDEOS_DIR - VLC_DESKTOP_DIR + 1)
+#define GENERIC_DIR_COUNT (VLC_SNAPSHOTS_DIR - VLC_DESKTOP_DIR + 1)
 static char *ppsz_generic_names[GENERIC_DIR_COUNT] = {};
 static struct {
     struct {
@@ -120,6 +120,7 @@ JNI_OnLoad(JavaVM *vm, void *reserved)
         "DIRECTORY_MUSIC",      /* VLC_MUSIC_DIR */
         "DIRECTORY_PICTURES",   /* VLC_PICTURES_DIR */
         "DIRECTORY_MOVIES",     /* VLC_VIDEOS_DIR */
+        "DIRECTORY_SCREENSHOTS",/* VLC_SNAPSHOTS_DIR */
     };
     for (size_t i = 0; i < GENERIC_DIR_COUNT; ++i)
     {
@@ -291,6 +292,7 @@ char *platform_GetUserDir (vlc_userdir_t type)
         case VLC_PUBLICSHARE_DIR:
         case VLC_DOCUMENTS_DIR:
         case VLC_MUSIC_DIR:
+        case VLC_SNAPSHOTS_DIR:
         case VLC_PICTURES_DIR:
         case VLC_VIDEOS_DIR:
         {


=====================================
src/darwin/dirs.m
=====================================
@@ -221,6 +221,7 @@ char *platform_GetUserDir (vlc_userdir_t type)
         case VLC_MUSIC_DIR:
             psz_path = "%s/Music";
             break;
+        case VLC_SNAPSHOTS_DIR:
         case VLC_PICTURES_DIR:
             psz_path = "%s/Pictures";
             break;


=====================================
src/os2/dirs.c
=====================================
@@ -172,6 +172,7 @@ char *platform_GetUserDir (vlc_userdir_t type)
         case VLC_PUBLICSHARE_DIR:
         case VLC_DOCUMENTS_DIR:
         case VLC_MUSIC_DIR:
+        case VLC_SNAPSHOTS_DIR:
         case VLC_PICTURES_DIR:
         case VLC_VIDEOS_DIR:
             break;


=====================================
src/posix/dirs.c
=====================================
@@ -290,6 +290,7 @@ char *platform_GetUserDir (vlc_userdir_t type)
             return config_GetTypeDir ("DOCUMENTS");
         case VLC_MUSIC_DIR:
             return config_GetTypeDir ("MUSIC");
+        case VLC_SNAPSHOTS_DIR:
         case VLC_PICTURES_DIR:
             return config_GetTypeDir ("PICTURES");
         case VLC_VIDEOS_DIR:


=====================================
src/video_output/snapshot.c
=====================================
@@ -157,7 +157,7 @@ void vout_snapshot_Set(vout_snapshot_t *snap,
 /* */
 char *vout_snapshot_GetDirectory(void)
 {
-    return config_GetUserDir(VLC_PICTURES_DIR);
+    return config_GetUserDir(VLC_SNAPSHOTS_DIR);
 }
 /* */
 int vout_snapshot_SaveImage(char **name, int *sequential,


=====================================
src/win32/dirs-uap.c
=====================================
@@ -338,6 +338,7 @@ char *platform_GetUserDir (vlc_userdir_t type)
             return config_GetCacheDir ();
         case VLC_MUSIC_DIR:
             return config_GetShellDir (VLC_MUSIC_DIR);
+        case VLC_SNAPSHOTS_DIR: // FIXME GetFolderForUserAsync / UserDataPath
         case VLC_PICTURES_DIR:
             return config_GetShellDir (VLC_PICTURES_DIR);
         case VLC_VIDEOS_DIR:


=====================================
src/win32/dirs.c
=====================================
@@ -164,6 +164,8 @@ char *platform_GetUserDir (vlc_userdir_t type)
             return config_GetUserDir(VLC_HOME_DIR);
         case VLC_MUSIC_DIR:
             return config_GetKnownFolder (FOLDERID_Music);
+        case VLC_SNAPSHOTS_DIR:
+            return config_GetKnownFolder (FOLDERID_Screenshots);
         case VLC_PICTURES_DIR:
             return config_GetKnownFolder (FOLDERID_Pictures);
         case VLC_VIDEOS_DIR:



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6481dd9b71a2f9e08b1f36277b85324947cf48a6...33f7d18b54ad8a77b67609921c8fac518c8693ee

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/6481dd9b71a2f9e08b1f36277b85324947cf48a6...33f7d18b54ad8a77b67609921c8fac518c8693ee
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list