Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ FFMPEG_CONFIG := --enable-asm \
--disable-muxers \
--target-os=horizon --enable-cross-compile \
--cross-prefix=aarch64-none-elf- --arch=aarch64 --cpu=cortex-a57 --enable-neon \
--enable-mbedtls --enable-version3 \
--enable-pic --disable-autodetect --disable-runtime-cpudetect --disable-debug

MPV_CONFIG := --enable-libmpv-static --disable-libmpv-shared --disable-manpage-build \
Expand All @@ -37,7 +38,7 @@ BUILD := build
ROMFS := $(BUILD)/romfs
INSTALL := $(TOPDIR)/$(BUILD)/install
PACKAGES := mpv libavcodec libavformat libavfilter libavutil libswscale libswresample \
uam libsmb2 libnfs libssh2 freetype2 libarchive
uam libsmb2 libnfs libssh2 libcurl freetype2 libarchive
LIBDIRS := $(INSTALL)

DEFINES := __SWITCH__ _GNU_SOURCE _POSIX_VERSION=200809L timegm=mktime \
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ A hardware-accelerated media player for the Nintendo Switch, built on mpv and FF
- Direct rendering (faster software decoding)
- Custom post-processing shaders
- Custom audio backend for mpv using native Nintendo APIs, supporting layouts up to 5.1 surround
- Network playback through Samba, NFS or SFTP
- Network playback through HTTP/S, Samba, NFS or SFTP
- External drive support using [libusbhsfs](https://github.com/DarkMatterCore/libusbhsfs)
- Rich and responsive user interface, even under load

Expand Down Expand Up @@ -47,7 +47,7 @@ GIMP_VERSION=3 ./build-docker.sh

### Manual
- Set up a [devkitpro](https://devkitpro.org/wiki/devkitPro_pacman) environment for Switch homebrew development.
- Install the following packages: `switch-bzip2`, `switch-dav1d`, `switch-freetype`, `switch-glm`, `switch-harfbuzz`, `switch-libarchive`, `switch-libass`, `switch-libfribidi`, `switch-libjpeg-turbo`, `switch-libpng`, `switch-libwebp`, `switch-libssh2`, `switch-mbedtls`, `switch-ntfs-3g` and `switch-lwext4`. In addition, the following build dependencies are required: `switch-pkg-config`, `dkp-meson-scripts`, `dkp-toolchain-vars`, and [GIMP](https://www.gimp.org/) (2 or 3).
- Install the following packages: `switch-bzip2`, `switch-dav1d`, `switch-freetype`, `switch-glm`, `switch-harfbuzz`, `switch-libarchive`, `switch-libass`, `switch-libfribidi`, `switch-libjpeg-turbo`, `switch-libpng`, `switch-libwebp`, `switch-curl`, `switch-libssh2`, `switch-mbedtls`, `switch-ntfs-3g` and `switch-lwext4`. In addition, the following build dependencies are required: `switch-pkg-config`, `dkp-meson-scripts`, `dkp-toolchain-vars`, and [GIMP](https://www.gimp.org/) (2 or 3).
- Compile and install a GPL build of [libusbhsfs](https://github.com/DarkMatterCore/libusbhsfs).
- Compile and install [libsmb2](misc/libsmb2/) and [libnfs](misc/libnfs/).
- Configure, compile and install FFmpeg: `make configure-ffmpeg && make build-ffmpeg -j$(nproc)`.
Expand Down
11 changes: 10 additions & 1 deletion src/context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "fs/fs_smb.hpp"
#include "fs/fs_nfs.hpp"
#include "fs/fs_sftp.hpp"
#include "fs/fs_http.hpp"

#include "context.hpp"

Expand Down Expand Up @@ -70,7 +71,9 @@ int Context::read_from_file() {

if (n == "protocol")
info->protocol = (v == "smb" ? fs::NetworkFilesystem::Protocol::Smb :
(v == "nfs" ? fs::NetworkFilesystem::Protocol::Nfs : fs::NetworkFilesystem::Protocol::Sftp));
(v == "nfs" ? fs::NetworkFilesystem::Protocol::Nfs :
(v == "http" ? fs::NetworkFilesystem::Protocol::Http :
(v == "https" ? fs::NetworkFilesystem::Protocol::Https : fs::NetworkFilesystem::Protocol::Sftp))));
else if (n == "connect")
info->want_connect = v != "no";
else if (n == "share")
Expand Down Expand Up @@ -152,10 +155,16 @@ int Context::register_network_fs(NetworkFsInfo &info) {
case fs::NetworkFilesystem::Protocol::Sftp:
fs = std::make_shared<fs::SftpFs>(*this, info.fs_name, info.mountpoint);
break;
case fs::NetworkFilesystem::Protocol::Http:
case fs::NetworkFilesystem::Protocol::Https:
fs = std::make_shared<fs::HttpFs>(*this, info.fs_name, info.mountpoint);
break;
default:
return -1;
}

fs->protocol = info.protocol;

if (auto rc = fs->initialize(); rc)
return rc;

Expand Down
9 changes: 9 additions & 0 deletions src/fs/fs_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@ class NetworkFilesystem: public Filesystem {
Smb,
Nfs,
Sftp,
Http,
Https,
ProtocolMax,
};

Expand All @@ -201,9 +203,16 @@ class NetworkFilesystem: public Filesystem {
return "nfs";
case Protocol::Sftp:
return "sftp";
case Protocol::Http:
return "http";
case Protocol::Https:
return "https";
}
}

public:
Protocol protocol = Protocol::Smb;

protected:
bool is_connected = false;
};
Expand Down
Loading