[Android] [WIP PATCH 00/11] Browse via LibVLC

Thomas Guillem thomas at gllm.fr
Tue Dec 23 18:38:21 CET 2014


Hello,

This set of patches (that I'm still working on) starts a heavy
rework/refactoring of libvlc that I needed to enable browsing via LibVlc.

You will be able to discoverer samba shares, browse samba directories, browse
inside archive or playlist via the MediaBrowser utility class.

I added a VlcObject abstract class that should be inherited by all LibVlc
objects.

LibVlc objects are Media, MediaList, MediaDiscoverer, and later
MediaListPlayer, MediaLibrary, MediaPlayer.

These new classes reflect the libvlc native struct/functions.

An example:

When you first call MediaList.getMediaAt(index), it will return a Media
created via libvlc_media_list_item_at_index(ml, index) and put it in a array in
order to not always end up in native calls (for next calls).

The MediaList object will also listen to libvlc events, in order to modify the
array when a Media is removed/added. That way, the Java object will always
reflect the native struct.

When you first call Media.getMrl() (created via a String or returned via a
MediaList), it will return the String created from the native function
libvlc_media_get_mrl() and put it in a Java String (for next calls).
I plan to do the same for Media Metadatas.


I removed old MediaList.loadPlaylist, but I plan to add it back via theses new
objects. I also plan to merge libvlcjni-track.c into libvlcjni-media.c and have
only one way to get tracks infos.

Any comments are welcome.

Best regards,
Thomas Guillem.

Thomas Guillem (11):
  jni/Android.mk: add libdsm
  jni/Android.mk: clearer SRC_FILES
  remove MediaList.loadPlaylist
  libvlc: remove unused readTracksInfoInternal
  libvlc: move MediaList to CustomMediaList
  move Media to CustomMedia
  utils: add throw_exception
  libvlc: add VlcObject
  libvlc: add Media, MediaList, MediaDiscoverer
  libvlc/util: add MediaBrowser
  TEST

 compile.sh                                         |   3 +-
 libvlc/jni/Android.mk                              |   8 +-
 libvlc/jni/libvlcjni-media.c                       | 124 +++++
 libvlc/jni/libvlcjni-mediadiscoverer.c             |  96 ++++
 libvlc/jni/libvlcjni-medialist.c                   | 191 ++++----
 libvlc/jni/libvlcjni-track.c                       |  16 -
 libvlc/jni/libvlcjni-vlcobject.c                   | 199 ++++++++
 libvlc/jni/libvlcjni-vlcobject.h                   |  63 +++
 libvlc/jni/libvlcjni.c                             |  46 +-
 libvlc/jni/utils.h                                 |   7 +
 libvlc/src/org/videolan/libvlc/CustomMedia.java    | 510 +++++++++++++++++++++
 .../src/org/videolan/libvlc/CustomMediaList.java   | 222 +++++++++
 libvlc/src/org/videolan/libvlc/LibVLC.java         |  16 +-
 libvlc/src/org/videolan/libvlc/Media.java          | 502 ++------------------
 .../src/org/videolan/libvlc/MediaDiscoverer.java   |  68 +++
 libvlc/src/org/videolan/libvlc/MediaList.java      | 274 ++++-------
 libvlc/src/org/videolan/libvlc/VlcObject.java      | 166 +++++++
 .../src/org/videolan/libvlc/util/MediaBrowser.java | 151 ++++++
 .../src/org/videolan/vlc/MediaDatabase.java        |  22 +-
 vlc-android/src/org/videolan/vlc/MediaGroup.java   |  28 +-
 vlc-android/src/org/videolan/vlc/MediaLibrary.java |  56 +--
 vlc-android/src/org/videolan/vlc/Thumbnailer.java  |   8 +-
 .../src/org/videolan/vlc/audio/AudioService.java   |  24 +-
 .../src/org/videolan/vlc/gui/BrowserActivity.java  |   4 +-
 .../src/org/videolan/vlc/gui/DirectoryAdapter.java |   6 +-
 .../src/org/videolan/vlc/gui/HistoryAdapter.java   |   4 +-
 .../src/org/videolan/vlc/gui/MainActivity.java     |  52 +++
 .../src/org/videolan/vlc/gui/SearchFragment.java   |  14 +-
 .../org/videolan/vlc/gui/SearchResultAdapter.java  |  10 +-
 .../vlc/gui/audio/AudioAlbumsSongsFragment.java    |  10 +-
 .../vlc/gui/audio/AudioBrowserFragment.java        |  10 +-
 .../vlc/gui/audio/AudioBrowserListAdapter.java     |  32 +-
 .../org/videolan/vlc/gui/audio/AudioPlayer.java    |   6 +-
 .../vlc/gui/audio/AudioPlaylistAdapter.java        |  14 +-
 .../src/org/videolan/vlc/gui/audio/AudioUtil.java  |  12 +-
 .../videolan/vlc/gui/audio/MediaComparators.java   |  30 +-
 .../videolan/vlc/gui/video/MediaInfoFragment.java  |   4 +-
 .../vlc/gui/video/VideoBrowserInterface.java       |   4 +-
 .../videolan/vlc/gui/video/VideoGridFragment.java  |  26 +-
 .../videolan/vlc/gui/video/VideoListAdapter.java   |  18 +-
 .../vlc/gui/video/VideoPlayerActivity.java         |   8 +-
 .../src/org/videolan/vlc/util/BitmapUtil.java      |   4 +-
 vlc-android/src/org/videolan/vlc/util/Util.java    |   8 +-
 43 files changed, 2117 insertions(+), 959 deletions(-)
 create mode 100644 libvlc/jni/libvlcjni-media.c
 create mode 100644 libvlc/jni/libvlcjni-mediadiscoverer.c
 create mode 100644 libvlc/jni/libvlcjni-vlcobject.c
 create mode 100644 libvlc/jni/libvlcjni-vlcobject.h
 create mode 100644 libvlc/src/org/videolan/libvlc/CustomMedia.java
 create mode 100644 libvlc/src/org/videolan/libvlc/CustomMediaList.java
 create mode 100644 libvlc/src/org/videolan/libvlc/MediaDiscoverer.java
 create mode 100644 libvlc/src/org/videolan/libvlc/VlcObject.java
 create mode 100644 libvlc/src/org/videolan/libvlc/util/MediaBrowser.java

-- 
2.1.3



More information about the Android mailing list