Fix managed iOS native media linking
This commit is contained in:
@@ -98,6 +98,11 @@ internal sealed class AppModel
|
||||
Status = restoring ? "Reconnecting…" : "Connecting…"; Notify();
|
||||
lifetime?.Cancel(); lifetime?.Dispose(); lifetime = new();
|
||||
VoiceCatClient next = new("VoiceCat-iOS", "0.0.1", storage.TofuPath);
|
||||
next.ConnectionStateChanged += state =>
|
||||
{
|
||||
if (state == ClientConnectionState.Disconnected && next.ConnectionFailure is { } failure)
|
||||
Console.Error.WriteLine($"VoiceCat control connection failed: {failure}");
|
||||
};
|
||||
client = next;
|
||||
try
|
||||
{
|
||||
@@ -118,8 +123,10 @@ internal sealed class AppModel
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
IsConnecting = false; Status = exception.Message; Notify();
|
||||
System.Diagnostics.Debug.WriteLine($"Connection failed: {exception}");
|
||||
IsConnecting = false; Status = exception.Message;
|
||||
await next.DisposeAsync(); if (ReferenceEquals(client, next)) client = null;
|
||||
Notify();
|
||||
if (restoring && !explicitDisconnect) ScheduleReconnect();
|
||||
else throw;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,10 @@
|
||||
<Kind>Static</Kind>
|
||||
<ForceLoad>true</ForceLoad>
|
||||
</NativeReference>
|
||||
<LinkerArgument Include="-Wl,-force_load,$(VoiceCatNativeMediaPath)" Condition="Exists('$(VoiceCatNativeMediaPath)')" />
|
||||
<ReferenceNativeSymbol Include="vcm_opus_version;vcm_opus_error;vcm_encoder_create;vcm_encoder_destroy;vcm_encoder_set;vcm_encoder_get_dred;vcm_encode;vcm_decoder_create;vcm_decoder_destroy;vcm_decode;vcm_dred_decoder_create;vcm_dred_decoder_destroy;vcm_dred_create;vcm_dred_destroy;vcm_dred_parse;vcm_dred_decode;vcm_rnnoise_create;vcm_rnnoise_destroy;vcm_rnnoise_process">
|
||||
<SymbolType>Function</SymbolType>
|
||||
</ReferenceNativeSymbol>
|
||||
<NativeReference Include="$(VoiceCatIosCaptureOutput)/libvoicecat_ios_capture.a">
|
||||
<Kind>Static</Kind>
|
||||
<ForceLoad>true</ForceLoad>
|
||||
|
||||
@@ -30,6 +30,18 @@ if [ -n "${VOICECAT_CODESIGN_PROVISION:-}" ]; then set -- "$@" -p:CodesignProvis
|
||||
|
||||
app="$root/clients/apple/dotnet/VoiceCat.iOS/bin/$configuration/net10.0-ios27.0/ios-arm64/VoiceCat.iOS.app"
|
||||
[ -d "$app" ] || { echo "device app was not produced at $app" >&2; exit 1; }
|
||||
/usr/bin/strings "$app/VoiceCat.Codec.dll" | /usr/bin/grep -q GetMainProgramHandle || {
|
||||
echo "device codec does not contain the iOS static-library resolver" >&2
|
||||
exit 1
|
||||
}
|
||||
/usr/bin/nm -gU "$app/VoiceCat.iOS" | /usr/bin/grep -q _vcm_decoder_create || {
|
||||
echo "device executable does not export the statically linked media codec" >&2
|
||||
exit 1
|
||||
}
|
||||
/usr/bin/nm -gU "$app/VoiceCat.iOS" | /usr/bin/grep -q _vcm_rnnoise_create || {
|
||||
echo "device executable does not export the statically linked RNNoise processor" >&2
|
||||
exit 1
|
||||
}
|
||||
mkdir -p "$output"
|
||||
/usr/bin/ditto "$app" "$output/VoiceCat.iOS.app"
|
||||
/usr/bin/codesign --verify --deep --strict "$output/VoiceCat.iOS.app"
|
||||
|
||||
Reference in New Issue
Block a user