Compare commits

...

2 commits

Author SHA1 Message Date
Robert-André Mauchin bff678c48a
Add compatibility with FFMPEG 7.0 (#16499)
channel_layout has been replaced with ch_layout

Fix: #16437
2024-05-09 11:31:17 -07:00
Eric Warmenhoven a2a7c666fb
iOS/tvOS: some updates for packaging for app store (#16508) 2024-05-09 09:54:28 -07:00
20 changed files with 203 additions and 96 deletions

View file

@ -1552,6 +1552,15 @@ static bool core_info_get_file_id(const char *core_filename,
/* > Remove extension */
strlcpy(core_file_id, core_filename, len);
path_remove_extension(core_file_id);
#if IOS
/* iOS framework names, to quote Apple:
* "must contain only alphanumerics, dots, hyphens and must not end with a dot."
*
* Since core names include underscore, which is not allowed, but not dot,
* which is, we change underscore to dot. Here, we need to change it back.
*/
string_replace_all_chars(core_file_id, '.', '_');
#endif
/* > Remove suffix */
last_underscore = (char*)strrchr(core_file_id, '_');

View file

@ -65,6 +65,8 @@ extern "C" {
s ##_version() >> 8 & 0xFF, \
s ##_version() & 0xFF);
#define HAVE_CH_LAYOUT (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100))
static bool reset_triggered;
static bool libretro_supports_bitmasks = false;
@ -1726,8 +1728,14 @@ static void decode_thread(void *data)
{
swr[i] = swr_alloc();
#if HAVE_CH_LAYOUT
AVChannelLayout out_chlayout = AV_CHANNEL_LAYOUT_STEREO;
av_opt_set_chlayout(swr[i], "in_chlayout", &actx[i]->ch_layout, 0);
av_opt_set_chlayout(swr[i], "out_chlayout", &out_chlayout, 0);
#else
av_opt_set_int(swr[i], "in_channel_layout", actx[i]->channel_layout, 0);
av_opt_set_int(swr[i], "out_channel_layout", AV_CH_LAYOUT_STEREO, 0);
#endif
av_opt_set_int(swr[i], "in_sample_rate", actx[i]->sample_rate, 0);
av_opt_set_int(swr[i], "out_sample_rate", media.sample_rate, 0);
av_opt_set_int(swr[i], "in_sample_fmt", actx[i]->sample_fmt, 0);

View file

@ -9,16 +9,18 @@
<key>INIntentDefinitionNamespace</key>
<string>88xZPY</string>
<key>INIntentDefinitionSystemVersion</key>
<string>20A294</string>
<string>23E224</string>
<key>INIntentDefinitionToolsBuildVersion</key>
<string>12A6144</string>
<string>15E204a</string>
<key>INIntentDefinitionToolsVersion</key>
<string>12.0</string>
<string>15.3</string>
<key>INIntents</key>
<array>
<dict>
<key>INIntentCategory</key>
<string>information</string>
<key>INIntentDescription</key>
<string>RetroArch Launch Widget</string>
<key>INIntentDescriptionID</key>
<string>tVvJ9c</string>
<key>INIntentEligibleForWidgets</key>

View file

@ -120,7 +120,6 @@
92CC05B921FE3C1700FF79F0 /* GCDWebServerDataRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 92CC059B21FE3C1700FF79F0 /* GCDWebServerDataRequest.m */; };
92CC05BA21FE3C1700FF79F0 /* GCDWebServerFileRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 92CC059C21FE3C1700FF79F0 /* GCDWebServerFileRequest.m */; };
92CC05BB21FE3C1700FF79F0 /* GCDWebServerFileRequest.m in Sources */ = {isa = PBXBuildFile; fileRef = 92CC059C21FE3C1700FF79F0 /* GCDWebServerFileRequest.m */; };
92CC05BC21FE3C1700FF79F0 /* GCDWebUploader.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 92CC059F21FE3C1700FF79F0 /* GCDWebUploader.bundle */; };
92CC05BD21FE3C1700FF79F0 /* GCDWebUploader.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 92CC059F21FE3C1700FF79F0 /* GCDWebUploader.bundle */; };
92CC05BE21FE3C1700FF79F0 /* GCDWebUploader.m in Sources */ = {isa = PBXBuildFile; fileRef = 92CC05A121FE3C1700FF79F0 /* GCDWebUploader.m */; };
92CC05BF21FE3C1700FF79F0 /* GCDWebUploader.m in Sources */ = {isa = PBXBuildFile; fileRef = 92CC05A121FE3C1700FF79F0 /* GCDWebUploader.m */; };
@ -1467,7 +1466,6 @@
07F7FB022A2DA8B800037C04 /* filters in Resources */,
9222F2092315DAD50097C0FD /* Launch Screen.storyboard in Resources */,
9204BE231D319EF300BD49DB /* InfoPlist.strings in Resources */,
92CC05BC21FE3C1700FF79F0 /* GCDWebUploader.bundle in Resources */,
9222F20B2315DD3D0097C0FD /* retroarch_logo.png in Resources */,
929784502200EEE400989A60 /* iOS/Resources/Icons.xcassets in Resources */,
9222F1FF2314BA7C0097C0FD /* assets.zip in Resources */,
@ -1755,7 +1753,9 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = RetroArchTopShelfExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = RetroArchTopShelfExtension;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 RetroArch. All rights reserved.";
INFOPLIST_KEY_UIRequiredDeviceCapabilities = arm64;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
@ -1822,7 +1822,9 @@
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = RetroArchTopShelfExtension/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = RetroArchTopShelfExtension;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.games";
INFOPLIST_KEY_NSHumanReadableCopyright = "Copyright © 2024 RetroArch. All rights reserved.";
INFOPLIST_KEY_UIRequiredDeviceCapabilities = arm64;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",

View file

@ -2377,7 +2377,7 @@ input[type="button"].btn-block {
font-family: 'Glyphicons Halflings';
src: url('../fonts/glyphicons-halflings-regular.eot');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.woff') format('woff'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
src: url('../fonts/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'), url('../fonts/glyphicons-halflings-regular.ttf') format('truetype'), url('../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
.glyphicon {
position: relative;

View file

@ -15,6 +15,8 @@
<dict>
<key>CFBundleTypeName</key>
<string>ROM</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.libretro.rom</string>
@ -23,6 +25,8 @@
<dict>
<key>CFBundleTypeName</key>
<string>All Files</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>public.data</string>
@ -48,6 +52,25 @@
<string>$(MARKETING_VERSION)</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>GCSupportedGameControllers</key>
<array>
<dict>
<key>ProfileName</key>
<string>ExtendedGamepad</string>
</dict>
<dict>
<key>ProfileName</key>
<string>DirectionalGamepad</string>
</dict>
<dict>
<key>ProfileName</key>
<string>MicroGamepad</string>
</dict>
</array>
<key>GCSupportsControllerUserInteraction</key>
<true/>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>LSRequiresIPhoneOS</key>
@ -61,8 +84,10 @@
</array>
<key>NSLocalNetworkUsageDescription</key>
<string>RetroArch uses the local network to find local Netplay participants.</string>
<key>UIApplicationExitsOnSuspend</key>
<false/>
<key>NSUserActivityTypes</key>
<array>
<string>ConfigurationIntent</string>
</array>
<key>UIFileSharingEnabled</key>
<true/>
<key>UILaunchStoryboardName</key>
@ -91,23 +116,6 @@
</array>
<key>UIViewControllerBasedStatusBarAppearance</key>
<false/>
<key>GCSupportedGameControllers</key>
<array>
<dict>
<key>ProfileName</key>
<string>ExtendedGamepad</string>
</dict>
<dict>
<key>ProfileName</key>
<string>DirectionalGamepad</string>
</dict>
<dict>
<key>ProfileName</key>
<string>MicroGamepad</string>
</dict>
</array>
<key>GCSupportsControllerUserInteraction</key>
<true/>
<key>UTImportedTypeDeclarations</key>
<array>
<dict>

View file

@ -5,7 +5,7 @@
<key>CFBundleExecutable</key>
<string>%CORE%</string>
<key>CFBundleName</key>
<string>%CORE%</string>
<string>%BUNDLE%</string>
<key>CFBundleIdentifier</key>
<string>%IDENTIFIER%</string>
<key>CFBundleShortVersionString</key>
@ -13,7 +13,7 @@
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>MinimumOSVersion</key>
<string>1.0</string>
<string>14.2</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleInfoDictionaryVersion</key>

View file

@ -29,15 +29,14 @@ mkdir -p "$OUTDIR"
for dylib in $(find "$BASE_DIR"/modules -maxdepth 1 -type f -regex '.*libretro.*\.dylib$') ; do
intermediate=$(basename "$dylib")
intermediate="${intermediate/%.dylib/}"
identifier="${intermediate/%$SUFFIX/}"
intermediate="${identifier/%_libretro/}"
fwName="${intermediate}_libretro"
intermediate="${intermediate/%$SUFFIX/}"
fwName="${intermediate//_/.}"
echo Making framework $fwName from $dylib
fwDir="${OUTDIR}/${fwName}.framework"
mkdir -p "$fwDir"
lipo -create "$dylib" -output "$fwDir/$fwName"
sed -e "s,%CORE%,$fwName," -e "s,%IDENTIFIER%,$identifier," iOS/fw.tmpl > "$fwDir/Info.plist"
sed -e "s,%CORE%,$fwName," -e "s,%BUNDLE%,$fwName," -e "s,%IDENTIFIER%,$fwName," iOS/fw.tmpl > "$fwDir/Info.plist"
echo "signing $fwName"
codesign --force --verbose --sign "${CODE_SIGN_IDENTITY_FOR_ITEMS}" --timestamp=none --preserve-metadata=identifier,entitlements,flags --generate-entitlement-der "$fwDir"
codesign --force --verbose --sign "${CODE_SIGN_IDENTITY_FOR_ITEMS}" "$fwDir"
done

View file

@ -2,36 +2,53 @@
WD=$(realpath $(dirname $0))
include_autoconfig=""
include_cheats=""
include_databases=""
include_overlays=""
include_shaders=""
include_xmb=""
assets_zip="$WD/assets.zip"
args=`getopt achmos $*`
args=`getopt acdhimosx $*`
set -- $args
while :; do
case "$1" in
-a)
include_autoconfig=1
include_cheats=1
include_databases=1
include_overlays=1
include_shaders=1
include_xmb=1
shift
;;
-c)
include_cheats=1
shift
;;
-d)
include_databases=1
shift
;;
-h)
echo "$(basename $0) -- Rebuild assets.zip"
echo "Meant to be used when building RetroArch yourself. The buildbot does not use this."
echo
echo " -a Include all assets, cheats, databases, input autoconfig, overlays, and shaders"
echo " -c Include cheats"
echo " -d Include databases"
echo " -i Include input autoconfig"
echo " -o Include overlays"
echo " -s Include shaders"
echo " -a Include cheats, overlays, and shaders"
echo " -m Build for macOS (places in OSX directory"
echo " -x Include XMB assets"
echo " -m Build for macOS (places in OSX directory)"
exit 0
;;
-i)
include_autoconfig=1
shift
;;
-m)
assets_zip="$WD/OSX/assets.zip"
shift
@ -44,6 +61,10 @@ while :; do
include_shaders=1
shift
;;
-x)
include_xmb=1
shift
;;
--)
shift
break
@ -64,8 +85,12 @@ pushd "$WD" &>/dev/null
rm -rf .media
fetch_zip retroarch-assets
fetch_zip retroarch-joypad-autoconfig
fetch_zip libretro-database
if [ -n "$include_autoconfig" ] ; then
fetch_zip retroarch-joypad-autoconfig
fi
if [ -n "$include_cheats" -o -n "$include_databases" ] ; then
fetch_zip libretro-database
fi
fetch_zip libretro-super
if [ -n "$include_overlays" ] ; then
fetch_zip common-overlays
@ -78,19 +103,28 @@ fi
pushd .media &>/dev/null
echo "Packaging assets"
mkdir assets ; mv retroarch-assets/{COPYING,glui,menu_widgets,ozone,pkg,rgui,sounds,xmb} assets ; rm -rf retroarch-assets
mkdir assets ; mv retroarch-assets/{COPYING,glui,menu_widgets,ozone,pkg,rgui,sounds} assets
if [ -n "$include_xmb" ] ; then
mv retroarch-assets/xmb assets
fi
rm -rf retroarch-assets
rm -rf assets/pkg/wiiu
echo "Packaging autoconfig"
mv retroarch-joypad-autoconfig autoconfig
rm -rf autoconfig/{android,dinput,linuxraw,parport,qnx,sdl2,udev,x,xinput}
if [ -n "$include_autoconfig" ] ; then
echo "Packaging autoconfig"
mv retroarch-joypad-autoconfig autoconfig
rm -rf autoconfig/{android,dinput,linuxraw,parport,qnx,sdl2,udev,x,xinput}
fi
if [ -n "$include_cheats" ] ; then
echo "Packaging cheats"
mv libretro-database/cht cht
fi
echo "Packaging database"
mkdir database ; mv libretro-database/{cursors,rdb} database ; rm -rf libretro-database
if [ -n "$include_databases" ] ; then
echo "Packaging database"
mkdir database ; mv libretro-database/{cursors,rdb} database
fi
rm -rf libretro-database
echo "Packaging info"
mv libretro-super/info info ; rmdir libretro-super
@ -106,9 +140,9 @@ if [ -n "$include_shaders" ] ; then
mkdir shaders ; mv glsl-shaders shaders/shaders_glsl ; mv slang-shaders shaders/shaders_slang
fi
rm -f ../assets.zip
rm -f $assets_zip
echo "Zipping final assets bundle..."
zip -qr ../assets.zip *
zip -qr $assets_zip *
popd &>/dev/null

View file

@ -1,11 +1,12 @@
{
"images" : [
{
"filename" : "retroarch_logo_back-1.png",
"idiom" : "tv"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

View file

@ -1,11 +1,12 @@
{
"images" : [
{
"filename" : "retroarch_logo_front-1.png",
"idiom" : "tv"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

View file

@ -1,11 +1,12 @@
{
"images" : [
{
"filename" : "retroarch_logo_middle-1.png",
"idiom" : "tv"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}

View file

@ -2,17 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>RetroArch URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>retroarch</string>
</array>
</dict>
</array>
<key>ALTBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>ALTDeviceID</key>
@ -21,6 +10,30 @@
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
<string>RetroArch</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>ROM</string>
<key>LSHandlerRank</key>
<string>Owner</string>
<key>LSItemContentTypes</key>
<array>
<string>com.libretro.rom</string>
</array>
</dict>
<dict>
<key>CFBundleTypeName</key>
<string>All Files</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
<key>LSItemContentTypes</key>
<array>
<string>public.data</string>
<string>public.content</string>
</array>
</dict>
</array>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
@ -33,16 +46,19 @@
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>$(MARKETING_VERSION)</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>RetroArch URL</string>
<key>CFBundleURLSchemes</key>
<array>
<string>retroarch</string>
</array>
</dict>
</array>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>arm64</string>
</array>
<key>GCSupportedGameControllers</key>
<array>
<dict>
@ -60,25 +76,15 @@
</array>
<key>GCSupportsControllerUserInteraction</key>
<true/>
<key>CFBundleDocumentTypes</key>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationCategoryType</key>
<string>public.app-category.games</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UIRequiredDeviceCapabilities</key>
<array>
<dict>
<key>CFBundleTypeName</key>
<string>ROM</string>
<key>LSItemContentTypes</key>
<array>
<string>com.libretro.rom</string>
</array>
</dict>
<dict>
<key>CFBundleTypeName</key>
<string>All Files</string>
<key>LSItemContentTypes</key>
<array>
<string>public.data</string>
<string>public.content</string>
</array>
</dict>
<string>arm64</string>
</array>
<key>UTImportedTypeDeclarations</key>
<array>

View file

@ -154,7 +154,7 @@ else
race
quicknes
smsplus
blastem
#blastem
vice_x128
vice_x64
vice_x64sc
@ -202,7 +202,8 @@ else
virtualxt
geolith
vircon32
melondsds
#melondsds
2048
)
for dylib in "${exports[@]}" ; do
find_dylib $dylib

View file

@ -1131,11 +1131,23 @@ void playlist_resolve_path(enum playlist_file_mode mode,
string_starts_with(path, ":/modules/") &&
string_ends_with(path, ".dylib"))
{
/* iOS cores used to be packaged as .dylib files in the modules
* directory; App Store rules require turning them into Frameworks and
* putting them in the Frameworks directory. Because some playlists
* include the old core path, we'll translate it here.
*/
path[string_index_last_occurance(path, '.')] = '\0';
if (string_ends_with(path, "_ios"))
path[string_index_last_occurance(path, '_')] = '\0';
strlcpy(tmp, ":/Frameworks/", STRLEN_CONST(":/Frameworks/") + 1);
strlcpy(tmp + STRLEN_CONST(":/Frameworks/"), path + STRLEN_CONST(":/modules/"), sizeof(tmp) - STRLEN_CONST(":/Frameworks/"));
/* iOS framework names, to quote Apple:
* "must contain only alphanumerics, dots, hyphens and must not end with a dot."
*
* Since core names include underscore, which is not allowed, but not dot,
* which is, we change underscore to dot.
*/
string_replace_all_chars(tmp, '_', '.');
strlcat(tmp, ".framework", sizeof(tmp));
fill_pathname_expand_special(path, tmp, len);
}

View file

@ -70,6 +70,7 @@ extern "C" {
#include "../../verbosity.h"
#define FFMPEG3 (LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100))
#define HAVE_CH_LAYOUT (LIBAVUTIL_VERSION_INT >= AV_VERSION_INT(57, 28, 100))
struct ff_video_info
{
@ -301,9 +302,15 @@ static bool ffmpeg_init_audio(ffmpeg_t *handle, const char *audio_resampler)
audio->codec = avcodec_alloc_context3(codec);
audio->codec->codec_type = AVMEDIA_TYPE_AUDIO;
#if HAVE_CH_LAYOUT
audio->codec->ch_layout = (param->channels > 1)
? (AVChannelLayout)AV_CHANNEL_LAYOUT_STEREO
: (AVChannelLayout)AV_CHANNEL_LAYOUT_MONO;
#else
audio->codec->channels = param->channels;
audio->codec->channel_layout = (param->channels > 1)
? AV_CH_LAYOUT_STEREO : AV_CH_LAYOUT_MONO;
#endif
ffmpeg_audio_resolve_format(audio, codec);
ffmpeg_audio_resolve_sample_rate(handle, codec);
@ -351,9 +358,15 @@ static bool ffmpeg_init_audio(ffmpeg_t *handle, const char *audio_resampler)
if (!audio->codec->frame_size)
audio->codec->frame_size = 1024;
#if HAVE_CH_LAYOUT
int nb_channels = audio->codec->ch_layout.nb_channels;
#else
int nb_channels = audio->codec->channels;
#endif
audio->buffer = (uint8_t*)av_malloc(
audio->codec->frame_size *
audio->codec->channels *
nb_channels *
audio->sample_size);
if (!audio->buffer)
@ -1342,20 +1355,30 @@ static bool encode_audio(ffmpeg_t *handle, bool dry)
frame->nb_samples = handle->audio.frames_in_buffer;
frame->format = handle->audio.codec->sample_fmt;
#if HAVE_CH_LAYOUT
av_channel_layout_copy(&frame->ch_layout, &handle->audio.codec->ch_layout);
#else
frame->channel_layout = handle->audio.codec->channel_layout;
#endif
frame->pts = handle->audio.frame_cnt;
planarize_audio(handle);
#if HAVE_CH_LAYOUT
int nb_channels = handle->audio.codec->ch_layout.nb_channels;
#else
int nb_channels = handle->audio.codec->channels;
#endif
samples_size = av_samples_get_buffer_size(
NULL,
handle->audio.codec->channels,
nb_channels,
handle->audio.frames_in_buffer,
handle->audio.codec->sample_fmt, 0);
av_frame_get_buffer(frame, 0);
avcodec_fill_audio_frame(frame,
handle->audio.codec->channels,
nb_channels,
handle->audio.codec->sample_fmt,
handle->audio.is_planar
? (uint8_t*)handle->audio.planar_buf :