Skip to content

Instantly share code, notes, and snippets.

@dbtdsilva
Last active January 21, 2018 15:24
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbtdsilva/74f5ae9663cb7bec7ac10ddf9969ab83 to your computer and use it in GitHub Desktop.
Save dbtdsilva/74f5ae9663cb7bec7ac10ddf9969ab83 to your computer and use it in GitHub Desktop.
VideoLAN libcloudstorage integration (GSoC'17)

Project: libcloudstorage integration in VLC

Official Project Description: https://summerofcode.withgoogle.com/archive/2017/projects/6570146898378752/

Description and Milestones Overview

The idea of this project was to add direct support inside VLC allowing the user to manipulate cloud storages (e.g. Google Drive). Several milestones had to be set up in order to achieve the final product:

  1. Access and services discovery module
  2. Add support for multiple users
  3. Replace microhttpd from libcloudstorage with VLC internal httpd module
  4. Replace libcurl from libcloudstorage with VLC internal http module
  5. Add VLC functionality to spawn an external browser
  6. Support the HTTP handle

The numbers from this enumeration are used through this document.

Repositories

The repositories below are the ones that I have been working on. You will notice that there will not be any commits from me in the branch master, because it is the branch that I always rebase from the original repository. All the others branches were managed by me.

Patches submitted

These patches were the ones sent to the VideoLan mailing list. It includes the majority of the work that was done until the last 2 weeks. After that, I have done more improvements based on the comments in the patches and also some problems that I have found (that latest work can be found at branch cloud-integration-master in my VLC clone).

  1. keystore: add the possibility to delete credentials - was necessary in order to remove already logged in users;
  2. http: resource is now able to invoke other methods rather than only GETs - the original VLC http module only allowed to perform GET operations and the others are also necessary to fulfil milestone 4;
  3. http: the connection will now sent a payload if requested - this patch is the continuation from the previous one;
  4. dialog: add new dialog that spawns a browser if the user allows it - this is the implementation of milestone 5 giving the possibility to spawn the default browser through VLC functions;
  5. cloudstorage: add access module integrating libcloudstorage - implements milestone 1 and 2;
  6. qt: add cloudstorage integration and improved sidebar sub-trees logic - allows to create sub-trees in the sidebar in a more cleaner way. It also has the modifications that spawns dialogs necessary for the integration;
  7. cloudstorage: sd: add services discovery module - implements milestone 1;
  8. cloudstorage: access: custom-made html pages to the http server responses - this patch is simply a question of aesthetics allowing to have more user-friendly responses from the http server;
  9. cloudstorage: replaced microhttpd dependency by using vlc_httpd - implements milestone 3;
  10. cloudstorage: replaced curl dependency by using functions from http module - completes the implementation for milestone 4.

The milestone 6 was left out because it could be easily achieved by using LUA playlist scripts that already exist in VLC.

Work done under repositories

Under vlc repository [branches]

This repository contains several branches that were used during this project.
The branch cloud-integration-master is the main one, where the latest code is always located.

The code under this repository was already described under the patches submitted, since it contains all the work rebased. There is some work that is not considered in the patches, such as:

  • fix in the keystore under the tag secret-sem-fix, that basically corrects a deadlock;
  • some commits for the services discovery, because it was not user-friendly at the beggining;
  • httpd interface modification to support MegaNz needs (this provider was discarded);
  • the most recent changes in the branch cloud-integration-master that contain minor fixes to problems that I had been finding and some user-friendly improvements.

Under libcloudstorage repository [branches]

This repository has several branches: gsoc-master, gsoc-master2, gsoc-merged, gsoc-merged-2, gosc-merged-3.

The branch gsoc-master-2 should be the one used for testing purposes with VLC. It contains the commit that modify the keys for each API with the configurations used in VLC (redirect URIs mainly).

The branch gsoc-master was initially used to create an HTTPD interface in order to get rid of the microhttpd server and use httpd server from VLC (to be possible to implement the 3rd milestone). However it was later supported by libcloudstorage recent modifications.

The branches that start with gsoc-merged* were only used to create pull requests to the original libcloudstorage repository:

  • Pull Request 7 - Added URL class, Auth can now have a prefix, improved JS responses and other fixes/improvements contains some modifications that make the HTTP interface independent from the URL class that encodes/decodes URLs. It also contains modifications that allow the specification of a path where the auth server will be listening and some minor improvements;
  • Pull Request 8 contains the same modifications as the pull request 7, with consideration on the comments and rebase with the newest modifications on libcloudstorage;
  • Pull Request 10 contains minor fixups for bugs or functionalities that I have found necessary (even though it was not merged, it was considered in several commits in the master branch).

Work left to be done

  • Add VLC functionality to spawn the default browser under MacOS GUI (since I had no MacOS device to create such a functionality). Nevertheless, It was done for the QT interface.
    The only thing that is required is to fill a callback created to spawn the default browser using MacOS tools. The logic under the core is already done.

How to check the work done

  1. Clone libcloudstorage repository and checkout to the branch gsoc-master-2;
  2. Compile and install the library (advisable to use --prefix on "configure" to install it in a custom location);
  3. Clone my VLC repository and checkout to the branch cloud-integration-master
  4. Compile the code and run it. You may need to specify the location of libcloudstorage if the Cloud Storage does not appear on the sidebar. Use CXXFLAGS="-I/usr/include/cloudstorage/" (with the prefix that you have specified) during the "configure".
  5. You will be able to see the Cloud Storage in the sidebar or even access it through a MRL ./vlc cloudstorage://[user_label@]<provider_name>/[path] (user_label and path are optional)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment