[vlc-commits] android: add libvlc specific file

Rafaël Carré git at videolan.org
Thu Oct 4 19:29:26 CEST 2012


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Thu Oct  4 19:13:06 2012 +0200| [c0a2390f67f156dc0caad806143492433d94d04d] | committer: Rafaël Carré

android: add libvlc specific file

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c0a2390f67f156dc0caad806143492433d94d04d
---

 src/Makefile.am    |   17 ++++++++++++++++
 src/android/dirs.c |   57 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+)

diff --git a/src/Makefile.am b/src/Makefile.am
index 96923f9..9d1d87d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -203,6 +203,7 @@ libvlc_win32_rc.$(OBJEXT): libvlc_win32_rc.rc
 
 EXTRA_libvlccore_la_SOURCES = \
 	$(SOURCES_libvlc_darwin) \
+	$(SOURCES_libvlc_android) \
 	$(SOURCES_libvlc_linux) \
 	$(SOURCES_libvlc_win32) \
 	$(SOURCES_libvlc_os2) \
@@ -214,6 +215,9 @@ EXTRA_libvlccore_la_SOURCES = \
 if HAVE_DARWIN
 libvlccore_la_SOURCES += $(SOURCES_libvlc_darwin)
 else
+if HAVE_ANDROID
+libvlccore_la_SOURCES += $(SOURCES_libvlc_android)
+else
 if HAVE_LINUX
 libvlccore_la_SOURCES += $(SOURCES_libvlc_linux)
 else
@@ -232,6 +236,7 @@ endif
 endif
 endif
 endif
+endif
 if BUILD_HTTPD
 libvlccore_la_SOURCES += $(SOURCES_libvlc_httpd)
 endif
@@ -252,6 +257,18 @@ SOURCES_libvlc_darwin = \
 	posix/rand.c \
 	$(NULL)
 
+SOURCES_libvlc_android = \
+	android/dirs.c \
+	posix/filesystem.c \
+	posix/plugin.c \
+	posix/thread.c \
+	posix/timer.c \
+	posix/linux_cpu.c \
+	posix/linux_specific.c \
+	posix/specific.c \
+	posix/rand.c \
+	$(NULL)
+
 SOURCES_libvlc_linux = \
 	posix/dirs.c \
 	posix/filesystem.c \
diff --git a/src/android/dirs.c b/src/android/dirs.c
new file mode 100644
index 0000000..9b65dc4
--- /dev/null
+++ b/src/android/dirs.c
@@ -0,0 +1,57 @@
+/*****************************************************************************
+ * dirs.c: Android directories configuration
+ *****************************************************************************
+ * Copyright © 2012 Rafaël Carré
+ *
+ * Authors: Rafaël Carré <funman at videolanorg>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as published by
+ * the Free Software Foundation; either version 2.1 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
+ *****************************************************************************/
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+
+#include "config/configuration.h"
+
+#include <string.h>
+
+char *config_GetUserDir (vlc_userdir_t type)
+{
+    switch (type)
+    {
+        case VLC_DATA_DIR:
+            return strdup("/sdcard/Android/data/org.videolan.vlc");
+        case VLC_CACHE_DIR:
+            return strdup("/sdcard/Android/data/org.videolan.vlc/cache");
+
+        case VLC_HOME_DIR:
+        case VLC_CONFIG_DIR:
+            return NULL;
+
+        case VLC_DESKTOP_DIR:
+        case VLC_DOWNLOAD_DIR:
+        case VLC_TEMPLATES_DIR:
+        case VLC_PUBLICSHARE_DIR:
+        case VLC_DOCUMENTS_DIR:
+        case VLC_MUSIC_DIR:
+        case VLC_PICTURES_DIR:
+        case VLC_VIDEOS_DIR:
+            return NULL;
+    }
+    return NULL;
+}



More information about the vlc-commits mailing list