[Android] Stubbed Media and LibVLC classes

Shivansh Saini git at videolan.org
Mon Dec 16 17:52:35 CET 2019


vlc-android | branch: master | Shivansh Saini <shivanshs9 at gmail.com> | Fri May 31 12:24:21 2019 +0530| [a2896d2b4bfc92d27bbfc05ad1c8f25f78fa2305] | committer: Geoffrey Métais

Stubbed Media and LibVLC classes

Used Abstract Factory Manager design pattern for LibVLC components

Tests done: StreamsModel, SubtitlesModel, HistoryModel, FilePickerModel,
       BrowserModel, StorageModel, FileBrowserModel, NetworkModel,
       VideosViewModel

Used CoroutineContextProvider to replace context on-demand.
Added extension function for the child of SingletonHolder used in ExternalSubRepository.
Replaced OpenSubtitleRepository.getInstance to use lazy value, so it can be replaced in tests.
Added Dependency Provider for BrowserProvider
Updated StubDataSource to configure data set to provide
LibVLC: Refactored interfaces

Signed-off-by: Shivansh Saini <shivanshs9 at gmail.com>

> https://code.videolan.org/videolan/vlc-android/commit/a2896d2b4bfc92d27bbfc05ad1c8f25f78fa2305
---

 build.gradle                                       |   1 +
 libvlc/src/org/videolan/libvlc/AWindow.java        |   2 +
 libvlc/src/org/videolan/libvlc/Dialog.java         |  12 +-
 libvlc/src/org/videolan/libvlc/FactoryManager.java |  18 +
 libvlc/src/org/videolan/libvlc/LibVLC.java         |  30 +-
 libvlc/src/org/videolan/libvlc/LibVLCFactory.java  |  24 ++
 libvlc/src/org/videolan/libvlc/Media.java          | 359 ++-----------------
 .../src/org/videolan/libvlc/MediaDiscoverer.java   |  23 +-
 libvlc/src/org/videolan/libvlc/MediaFactory.java   |  36 ++
 libvlc/src/org/videolan/libvlc/MediaList.java      | 117 +++----
 libvlc/src/org/videolan/libvlc/MediaPlayer.java    |  60 ++--
 .../org/videolan/libvlc/RendererDiscoverer.java    |  25 +-
 libvlc/src/org/videolan/libvlc/RendererItem.java   |   4 +-
 libvlc/src/org/videolan/libvlc/VLCObject.java      |  39 ++-
 libvlc/src/org/videolan/libvlc/VideoHelper.java    |   8 +-
 .../AbstractVLCEvent.java}                         |  20 +-
 .../libvlc/interfaces/IComponentFactory.java       |   5 +
 .../org/videolan/libvlc/interfaces/ILibVLC.java    |  13 +
 .../videolan/libvlc/interfaces/ILibVLCFactory.java |  13 +
 .../src/org/videolan/libvlc/interfaces/IMedia.java | 385 +++++++++++++++++++++
 .../videolan/libvlc/interfaces/IMediaFactory.java  |  15 +
 .../org/videolan/libvlc/interfaces/IMediaList.java |  57 +++
 .../org/videolan/libvlc/interfaces/IVLCObject.java |  11 +
 .../videolan/libvlc/{ => interfaces}/IVLCVout.java |   2 +-
 .../src/org/videolan/libvlc/media/MediaPlayer.java |  21 +-
 .../src/org/videolan/libvlc/media/VideoView.java   |  10 +-
 .../src/org/videolan/libvlc/stubs/StubLibVLC.java  |  24 ++
 .../videolan/libvlc/stubs/StubLibVLCFactory.java   |  20 ++
 .../src/org/videolan/libvlc/stubs/StubMedia.java   | 183 ++++++++++
 .../videolan/libvlc/stubs/StubMediaFactory.java    |  32 ++
 .../org/videolan/libvlc/stubs/StubMediaList.java   |  28 ++
 .../org/videolan/libvlc/stubs/StubVLCObject.java   |  27 ++
 libvlc/src/org/videolan/libvlc/util/Dumper.java    |  10 +-
 .../src/org/videolan/libvlc/util/MediaBrowser.java |  49 +--
 libvlc/src/org/videolan/libvlc/util/VLCUtil.java   |   5 +-
 .../videolan/medialibrary/MLServiceLocator.java    |   3 +-
 .../org/videolan/medialibrary/Medialibrary.java    |   8 +-
 .../interfaces/media/AbstractMediaWrapper.java     |  25 +-
 .../videolan/medialibrary/media/MediaWrapper.java  |   3 +-
 .../medialibrary/stubs/StubDataSource.java         | 168 +++++++--
 .../medialibrary/stubs/StubMediaWrapper.java       |   3 +-
 .../medialibrary/stubs/StubMedialibrary.java       |  27 +-
 .../java/org/videolan/tools/SingletonHolder.kt     |   2 +-
 vlc-android/build.gradle                           |  10 +-
 .../src/org/videolan/vlc/PlaybackService.kt        |  18 +-
 .../org/videolan/vlc/PreviewVideoInputService.kt   |   7 +-
 vlc-android/src/org/videolan/vlc/VLCApplication.kt |   8 +
 .../src/org/videolan/vlc/gui/InfoActivity.kt       |  13 +-
 .../org/videolan/vlc/gui/video/MediaInfoAdapter.kt |  21 +-
 .../src/org/videolan/vlc/gui/video/PopupManager.kt |   5 +-
 .../videolan/vlc/gui/video/VideoPlayerActivity.kt  |  25 +-
 .../vlc/gui/video/benchmark/BenchActivity.kt       |  18 +-
 .../src/org/videolan/vlc/gui/view/PopupLayout.kt   |   2 +-
 .../src/org/videolan/vlc/media/PlayerController.kt |  25 +-
 .../src/org/videolan/vlc/media/PlaylistManager.kt  |  18 +-
 .../org/videolan/vlc/providers/BrowserProvider.kt  |  37 +-
 .../videolan/vlc/providers/FilePickerProvider.kt   |   3 +-
 .../org/videolan/vlc/providers/StorageProvider.kt  |   6 +-
 .../vlc/repository/ExternalSubRepository.kt        |   5 +-
 .../vlc/repository/OpenSubtitleRepository.kt       |   6 +-
 .../org/videolan/vlc/repository/SlaveRepository.kt |   5 +-
 .../videolan/vlc/util/CoroutineContextProvider.kt  |  10 +
 .../org/videolan/vlc/util/DependencyProvider.kt    |  31 ++
 .../src/org/videolan/vlc/util/Kextensions.kt       |   3 +-
 .../src/org/videolan/vlc/util/ModelsHelper.kt      |   4 +-
 vlc-android/src/org/videolan/vlc/util/Settings.kt  |   5 +-
 .../src/org/videolan/vlc/util/VLCInstance.kt       |  17 +-
 .../src/org/videolan/vlc/util/VLCOptions.kt        |   3 +-
 .../org/videolan/vlc/util/KExtensions.kt           |  19 +
 .../org/videolan/vlc/util/RoboLiteTestRunner.kt    |   0
 .../vlc/util/TestCoroutineContextProvider.kt       |   9 +
 .../test-common/org/videolan/vlc/util/TestUtil.kt  |  53 ++-
 vlc-android/test/org/videolan/vlc/BaseTest.kt      |  60 ++++
 .../test/org/videolan/vlc/VLCTestApplication.kt    |  21 ++
 .../vlc/repository/ExternalSubRepositoryTest.kt    |   8 +-
 .../videolan/vlc/viewmodels/HistoryModelTest.kt    |  78 +++++
 .../videolan/vlc/viewmodels/StreamsModelTest.kt    | 149 ++++----
 .../videolan/vlc/viewmodels/SubtitlesModelTest.kt  | 256 ++++++++++++++
 .../vlc/viewmodels/browser/FileBrowserModelTest.kt | 173 +++++++++
 .../vlc/viewmodels/browser/FilePickerModelTest.kt  | 125 +++++++
 .../vlc/viewmodels/browser/NetworkModelTest.kt     | 110 ++++++
 .../vlc/viewmodels/browser/StorageModelTest.kt     | 180 ++++++++++
 .../vlc/viewmodels/mobile/VideosViewModelTest.kt   | 117 +++++++
 83 files changed, 2777 insertions(+), 813 deletions(-)

Diff:   https://code.videolan.org/videolan/vlc-android/commit/a2896d2b4bfc92d27bbfc05ad1c8f25f78fa2305


More information about the Android mailing list