Skip to content

Commit

Permalink
Proton-tkg: Add mediaconverter for RE8
Browse files Browse the repository at this point in the history
- Builds against system gstreamer and loaded dynamically
- 64-bit only for now
- Imported some proton patches for gstreamer as they seem to be needed for mediaconverter to actually work
  • Loading branch information
Tk-Glitch committed May 6, 2021
1 parent 7fa7301 commit ef4f7a6
Show file tree
Hide file tree
Showing 4 changed files with 367 additions and 0 deletions.
31 changes: 31 additions & 0 deletions proton-tkg/proton-tkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# You can run the vrclient building alone with : ./proton-tkg.sh build_vrclient
# You can run the lsteamclient building alone with : ./proton-tkg.sh build_lsteamclient
# You can run the steamhelper building alone with : ./proton-tkg.sh build_steamhelper
# You can run the mediaconverter building alone with : ./proton-tkg.sh build_mediaconv

set -e

Expand Down Expand Up @@ -235,6 +236,27 @@ function build_dxvk {
cd "$_nowhere"
}

function build_mediaconverter {

mkdir -p "$_nowhere/gst/lib64/gstreamer-1.0"

if [ -d "$_nowhere"/Proton/media-converter ]; then
cd "$_nowhere"/Proton/media-converter
#mkdir -p "$_nowhere"/Proton/build/mediaconv32
mkdir -p "$_nowhere"/Proton/build/mediaconv64
#rm -rf "$_nowhere"/Proton/build/mediaconv32/*
rm -rf "$_nowhere"/Proton/build/mediaconv64/*

#( PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH=/usr/lib32/pkgconfig cargo build --target i686-unknown-linux-gnu --target-dir "$_nowhere"/Proton/build/mediaconv32 --release )
( cargo build --target x86_64-unknown-linux-gnu --target-dir "$_nowhere"/Proton/build/mediaconv64 --release )

#cp -a "$_nowhere"/Proton/build/mediaconv32/i686-unknown-linux-gnu/release/libprotonmediaconverter.so "$_nowhere"/gst/lib/gstreamer-1.0/
cp -a "$_nowhere"/Proton/build/mediaconv64/x86_64-unknown-linux-gnu/release/libprotonmediaconverter.so "$_nowhere"/gst/lib64/gstreamer-1.0/

cd "$_nowhere"
fi
}

function build_steamhelper {
# disable openvr support for now since we don't support it
if [ "$_proton_branch" = "proton_6.3" ]; then
Expand Down Expand Up @@ -449,6 +471,8 @@ elif [ "$1" = "build_vkd3d" ]; then
build_vkd3d
elif [ "$1" = "build_dxvk" ]; then
build_dxvk
elif [ "$1" = "build_mediaconv" ]; then
build_mediaconverter
elif [ "$1" = "build_steamhelper" ]; then
build_steamhelper
else
Expand All @@ -471,6 +495,9 @@ else

echo -e "Proton-tkg - $(date +"%m-%d-%Y %H:%M:%S")" > "$_logdir"/proton-tkg.log

# Build GST/mediaconverter
build_mediaconverter

# Now let's build
cd "$_wine_tkg_git_path"
if [ -e "/usr/bin/makepkg" ] && [ "$_nomakepkg" = "false" ]; then
Expand Down Expand Up @@ -581,6 +608,10 @@ else
# Build steam helper
build_steamhelper

# gst/mediaconverter
mv "$_nowhere"/gst/lib64/* proton_dist_tmp/lib64/
rm -rf "$_nowhere/gst"

# vkd3d
# Build vkd3d-proton when vkd3dlib is disabled - Requires MinGW-w64-gcc or it won't be built
if [ "$_build_vkd3d" = "true" ]; then
Expand Down
23 changes: 23 additions & 0 deletions proton-tkg/proton_template/conf/proton
Original file line number Diff line number Diff line change
Expand Up @@ -640,6 +640,17 @@ class Session:
self.compat_config.discard(config_name)
return True

self.env["GST_PLUGIN_PATH_1_0"] = g_proton.lib64_dir + "gstreamer-1.0" + ":" + g_proton.lib_dir + "gstreamer-1.0"
self.env["WINE_GST_REGISTRY_DIR"] = g_compatdata.path("gstreamer-1.0/")

if "STEAM_COMPAT_MEDIA_PATH" in os.environ:
self.env["MEDIACONV_AUDIO_DUMP_FILE"] = os.environ["STEAM_COMPAT_MEDIA_PATH"] + "/audio.foz"
self.env["MEDIACONV_VIDEO_DUMP_FILE"] = os.environ["STEAM_COMPAT_MEDIA_PATH"] + "/video.foz"

if "STEAM_COMPAT_TRANSCODED_MEDIA_PATH" in os.environ:
self.env["MEDIACONV_AUDIO_TRANSCODED_FILE"] = os.environ["STEAM_COMPAT_TRANSCODED_MEDIA_PATH"] + "/transcoded_audio.foz"
self.env["MEDIACONV_VIDEO_TRANSCODED_FILE"] = os.environ["STEAM_COMPAT_TRANSCODED_MEDIA_PATH"] + "/transcoded_video.foz"

def try_log_slr_versions(self):
try:
if "PRESSURE_VESSEL_RUNTIME_BASE" in self.env:
Expand Down Expand Up @@ -854,6 +865,18 @@ class Session:
f.write("\tSTEAM_COMPAT_CLIENT_INSTALL_PATH=\"" + self.env["STEAM_COMPAT_CLIENT_INSTALL_PATH"] + "\" \\\n")
if "WINE_LARGE_ADDRESS_AWARE" in self.env:
f.write("\tWINE_LARGE_ADDRESS_AWARE=\"" + self.env["WINE_LARGE_ADDRESS_AWARE"] + "\" \\\n")
if "GST_PLUGIN_PATH_1_0" in self.env:
f.write("\tGST_PLUGIN_SYSTEM_PATH_1_0=\"" + self.env["GST_PLUGIN_PATH_1_0"] + "\" \\\n")
if "WINE_GST_REGISTRY_DIR" in self.env:
f.write("\tWINE_GST_REGISTRY_DIR=\"" + self.env["WINE_GST_REGISTRY_DIR"] + "\" \\\n")
if "MEDIACONV_AUDIO_DUMP_FILE" in self.env:
f.write("\tMEDIACONV_AUDIO_DUMP_FILE=\"" + self.env["MEDIACONV_AUDIO_DUMP_FILE"] + "\" \\\n")
if "MEDIACONV_AUDIO_TRANSCODED_FILE" in self.env:
f.write("\tMEDIACONV_AUDIO_TRANSCODED_FILE=\"" + self.env["MEDIACONV_AUDIO_TRANSCODED_FILE"] + "\" \\\n")
if "MEDIACONV_VIDEO_DUMP_FILE" in self.env:
f.write("\tMEDIACONV_VIDEO_DUMP_FILE=\"" + self.env["MEDIACONV_VIDEO_DUMP_FILE"] + "\" \\\n")
if "MEDIACONV_VIDEO_TRANSCODED_FILE" in self.env:
f.write("\tMEDIACONV_VIDEO_TRANSCODED_FILE=\"" + self.env["MEDIACONV_VIDEO_TRANSCODED_FILE"] + "\" \\\n")

def dump_dbg_scripts(self):
exe_name = os.path.basename(sys.argv[2])
Expand Down
Loading

0 comments on commit ef4f7a6

Please sign in to comment.