diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/android/app/src/main/AndroidManifest.xml | 1 | ||||
| -rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt | 13 | ||||
| -rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt | 17 | ||||
| -rw-r--r-- | src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt | 48 | ||||
| -rw-r--r-- | src/audio_core/renderer/system.cpp | 2 | ||||
| -rw-r--r-- | src/audio_core/sink/cubeb_sink.cpp | 7 | ||||
| -rw-r--r-- | src/audio_core/sink/sink_details.cpp | 4 | ||||
| -rw-r--r-- | src/core/hle/service/audio/hwopus.cpp | 49 | ||||
| -rw-r--r-- | src/core/hle/service/audio/hwopus.h | 5 | ||||
| -rw-r--r-- | src/core/hle/service/sockets/nsd.cpp | 11 | ||||
| -rw-r--r-- | src/core/hle/service/sockets/sfdnsres.cpp | 12 | ||||
| -rw-r--r-- | src/video_core/host1x/codecs/codec.cpp | 3 |
12 files changed, 111 insertions, 61 deletions
diff --git a/src/android/app/src/main/AndroidManifest.xml b/src/android/app/src/main/AndroidManifest.xml index 36e2dac98..933244140 100644 --- a/src/android/app/src/main/AndroidManifest.xml +++ b/src/android/app/src/main/AndroidManifest.xml | |||
| @@ -56,7 +56,6 @@ SPDX-License-Identifier: GPL-3.0-or-later | |||
| 56 | android:name="org.yuzu.yuzu_emu.activities.EmulationActivity" | 56 | android:name="org.yuzu.yuzu_emu.activities.EmulationActivity" |
| 57 | android:theme="@style/Theme.Yuzu.Main" | 57 | android:theme="@style/Theme.Yuzu.Main" |
| 58 | android:launchMode="singleTop" | 58 | android:launchMode="singleTop" |
| 59 | android:screenOrientation="userLandscape" | ||
| 60 | android:supportsPictureInPicture="true" | 59 | android:supportsPictureInPicture="true" |
| 61 | android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|uiMode" | 60 | android:configChanges="orientation|screenSize|smallestScreenSize|screenLayout|uiMode" |
| 62 | android:exported="true"> | 61 | android:exported="true"> |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt index a5af5a7ae..e6fffc832 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/features/settings/ui/SettingsActivity.kt | |||
| @@ -11,7 +11,6 @@ import android.view.View | |||
| 11 | import android.view.ViewGroup.MarginLayoutParams | 11 | import android.view.ViewGroup.MarginLayoutParams |
| 12 | import android.widget.Toast | 12 | import android.widget.Toast |
| 13 | import androidx.activity.OnBackPressedCallback | 13 | import androidx.activity.OnBackPressedCallback |
| 14 | import androidx.activity.result.ActivityResultLauncher | ||
| 15 | import androidx.activity.viewModels | 14 | import androidx.activity.viewModels |
| 16 | import androidx.appcompat.app.AppCompatActivity | 15 | import androidx.appcompat.app.AppCompatActivity |
| 17 | import androidx.core.view.ViewCompat | 16 | import androidx.core.view.ViewCompat |
| @@ -246,17 +245,5 @@ class SettingsActivity : AppCompatActivity(), SettingsActivityView { | |||
| 246 | settings.putExtra(ARG_GAME_ID, gameId) | 245 | settings.putExtra(ARG_GAME_ID, gameId) |
| 247 | context.startActivity(settings) | 246 | context.startActivity(settings) |
| 248 | } | 247 | } |
| 249 | |||
| 250 | fun launch( | ||
| 251 | context: Context, | ||
| 252 | launcher: ActivityResultLauncher<Intent>, | ||
| 253 | menuTag: String?, | ||
| 254 | gameId: String? | ||
| 255 | ) { | ||
| 256 | val settings = Intent(context, SettingsActivity::class.java) | ||
| 257 | settings.putExtra(ARG_MENU_TAG, menuTag) | ||
| 258 | settings.putExtra(ARG_GAME_ID, gameId) | ||
| 259 | launcher.launch(settings) | ||
| 260 | } | ||
| 261 | } | 248 | } |
| 262 | } | 249 | } |
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt index 25b9d4018..09e93a017 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/fragments/EmulationFragment.kt | |||
| @@ -7,7 +7,6 @@ import android.annotation.SuppressLint | |||
| 7 | import android.app.AlertDialog | 7 | import android.app.AlertDialog |
| 8 | import android.content.Context | 8 | import android.content.Context |
| 9 | import android.content.DialogInterface | 9 | import android.content.DialogInterface |
| 10 | import android.content.Intent | ||
| 11 | import android.content.SharedPreferences | 10 | import android.content.SharedPreferences |
| 12 | import android.content.pm.ActivityInfo | 11 | import android.content.pm.ActivityInfo |
| 13 | import android.content.res.Configuration | 12 | import android.content.res.Configuration |
| @@ -19,8 +18,6 @@ import android.util.Rational | |||
| 19 | import android.view.* | 18 | import android.view.* |
| 20 | import android.widget.TextView | 19 | import android.widget.TextView |
| 21 | import androidx.activity.OnBackPressedCallback | 20 | import androidx.activity.OnBackPressedCallback |
| 22 | import androidx.activity.result.ActivityResultLauncher | ||
| 23 | import androidx.activity.result.contract.ActivityResultContracts | ||
| 24 | import androidx.appcompat.widget.PopupMenu | 21 | import androidx.appcompat.widget.PopupMenu |
| 25 | import androidx.core.content.res.ResourcesCompat | 22 | import androidx.core.content.res.ResourcesCompat |
| 26 | import androidx.core.graphics.Insets | 23 | import androidx.core.graphics.Insets |
| @@ -66,8 +63,6 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { | |||
| 66 | 63 | ||
| 67 | private var isInFoldableLayout = false | 64 | private var isInFoldableLayout = false |
| 68 | 65 | ||
| 69 | private lateinit var onReturnFromSettings: ActivityResultLauncher<Intent> | ||
| 70 | |||
| 71 | override fun onAttach(context: Context) { | 66 | override fun onAttach(context: Context) { |
| 72 | super.onAttach(context) | 67 | super.onAttach(context) |
| 73 | if (context is EmulationActivity) { | 68 | if (context is EmulationActivity) { |
| @@ -81,11 +76,6 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { | |||
| 81 | .collect { updateFoldableLayout(context, it) } | 76 | .collect { updateFoldableLayout(context, it) } |
| 82 | } | 77 | } |
| 83 | } | 78 | } |
| 84 | |||
| 85 | onReturnFromSettings = context.activityResultRegistry.register( | ||
| 86 | "SettingsResult", | ||
| 87 | ActivityResultContracts.StartActivityForResult() | ||
| 88 | ) { updateScreenLayout() } | ||
| 89 | } else { | 79 | } else { |
| 90 | throw IllegalStateException("EmulationFragment must have EmulationActivity parent") | 80 | throw IllegalStateException("EmulationFragment must have EmulationActivity parent") |
| 91 | } | 81 | } |
| @@ -149,12 +139,7 @@ class EmulationFragment : Fragment(), SurfaceHolder.Callback { | |||
| 149 | } | 139 | } |
| 150 | 140 | ||
| 151 | R.id.menu_settings -> { | 141 | R.id.menu_settings -> { |
| 152 | SettingsActivity.launch( | 142 | SettingsActivity.launch(requireContext(), SettingsFile.FILE_NAME_CONFIG, "") |
| 153 | requireContext(), | ||
| 154 | onReturnFromSettings, | ||
| 155 | SettingsFile.FILE_NAME_CONFIG, | ||
| 156 | "" | ||
| 157 | ) | ||
| 158 | true | 143 | true |
| 159 | } | 144 | } |
| 160 | 145 | ||
diff --git a/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt b/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt index 685ccaa76..2f0868c63 100644 --- a/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt +++ b/src/android/app/src/main/java/org/yuzu/yuzu_emu/views/FixedRatioSurfaceView.kt | |||
| @@ -7,7 +7,6 @@ import android.content.Context | |||
| 7 | import android.util.AttributeSet | 7 | import android.util.AttributeSet |
| 8 | import android.util.Rational | 8 | import android.util.Rational |
| 9 | import android.view.SurfaceView | 9 | import android.view.SurfaceView |
| 10 | import kotlin.math.roundToInt | ||
| 11 | 10 | ||
| 12 | class FixedRatioSurfaceView @JvmOverloads constructor( | 11 | class FixedRatioSurfaceView @JvmOverloads constructor( |
| 13 | context: Context, | 12 | context: Context, |
| @@ -22,27 +21,44 @@ class FixedRatioSurfaceView @JvmOverloads constructor( | |||
| 22 | */ | 21 | */ |
| 23 | fun setAspectRatio(ratio: Rational?) { | 22 | fun setAspectRatio(ratio: Rational?) { |
| 24 | aspectRatio = ratio?.toFloat() ?: 0f | 23 | aspectRatio = ratio?.toFloat() ?: 0f |
| 24 | requestLayout() | ||
| 25 | } | 25 | } |
| 26 | 26 | ||
| 27 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { | 27 | override fun onMeasure(widthMeasureSpec: Int, heightMeasureSpec: Int) { |
| 28 | super.onMeasure(widthMeasureSpec, heightMeasureSpec) | 28 | val displayWidth: Float = MeasureSpec.getSize(widthMeasureSpec).toFloat() |
| 29 | val width = MeasureSpec.getSize(widthMeasureSpec) | 29 | val displayHeight: Float = MeasureSpec.getSize(heightMeasureSpec).toFloat() |
| 30 | val height = MeasureSpec.getSize(heightMeasureSpec) | ||
| 31 | if (aspectRatio != 0f) { | 30 | if (aspectRatio != 0f) { |
| 32 | val newWidth: Int | 31 | val displayAspect = displayWidth / displayHeight |
| 33 | val newHeight: Int | 32 | if (displayAspect < aspectRatio) { |
| 34 | if (height * aspectRatio < width) { | 33 | // Max out width |
| 35 | newWidth = (height * aspectRatio).roundToInt() | 34 | val halfHeight = displayHeight / 2 |
| 36 | newHeight = height | 35 | val surfaceHeight = displayWidth / aspectRatio |
| 36 | val newTop: Float = halfHeight - (surfaceHeight / 2) | ||
| 37 | val newBottom: Float = halfHeight + (surfaceHeight / 2) | ||
| 38 | super.onMeasure( | ||
| 39 | widthMeasureSpec, | ||
| 40 | MeasureSpec.makeMeasureSpec( | ||
| 41 | newBottom.toInt() - newTop.toInt(), | ||
| 42 | MeasureSpec.EXACTLY | ||
| 43 | ) | ||
| 44 | ) | ||
| 45 | return | ||
| 37 | } else { | 46 | } else { |
| 38 | newWidth = width | 47 | // Max out height |
| 39 | newHeight = (width / aspectRatio).roundToInt() | 48 | val halfWidth = displayWidth / 2 |
| 49 | val surfaceWidth = displayHeight * aspectRatio | ||
| 50 | val newLeft: Float = halfWidth - (surfaceWidth / 2) | ||
| 51 | val newRight: Float = halfWidth + (surfaceWidth / 2) | ||
| 52 | super.onMeasure( | ||
| 53 | MeasureSpec.makeMeasureSpec( | ||
| 54 | newRight.toInt() - newLeft.toInt(), | ||
| 55 | MeasureSpec.EXACTLY | ||
| 56 | ), | ||
| 57 | heightMeasureSpec | ||
| 58 | ) | ||
| 59 | return | ||
| 40 | } | 60 | } |
| 41 | val left = (width - newWidth) / 2 | ||
| 42 | val top = (height - newHeight) / 2 | ||
| 43 | setLeftTopRightBottom(left, top, left + newWidth, top + newHeight) | ||
| 44 | } else { | ||
| 45 | setLeftTopRightBottom(0, 0, width, height) | ||
| 46 | } | 61 | } |
| 62 | super.onMeasure(widthMeasureSpec, heightMeasureSpec) | ||
| 47 | } | 63 | } |
| 48 | } | 64 | } |
diff --git a/src/audio_core/renderer/system.cpp b/src/audio_core/renderer/system.cpp index a23627472..6e07baa54 100644 --- a/src/audio_core/renderer/system.cpp +++ b/src/audio_core/renderer/system.cpp | |||
| @@ -778,7 +778,7 @@ u32 System::DropVoices(CommandBuffer& command_buffer, u32 estimated_process_time | |||
| 778 | while (i < command_buffer.count) { | 778 | while (i < command_buffer.count) { |
| 779 | const auto node_id{cmd->node_id}; | 779 | const auto node_id{cmd->node_id}; |
| 780 | const auto node_id_type{cmd->node_id >> 28}; | 780 | const auto node_id_type{cmd->node_id >> 28}; |
| 781 | const auto node_id_base{cmd->node_id & 0xFFF}; | 781 | const auto node_id_base{(cmd->node_id >> 16) & 0xFFF}; |
| 782 | 782 | ||
| 783 | // If the new estimated process time falls below the limit, we're done dropping. | 783 | // If the new estimated process time falls below the limit, we're done dropping. |
| 784 | if (estimated_process_time <= time_limit) { | 784 | if (estimated_process_time <= time_limit) { |
diff --git a/src/audio_core/sink/cubeb_sink.cpp b/src/audio_core/sink/cubeb_sink.cpp index 04d98a865..bbb598bc5 100644 --- a/src/audio_core/sink/cubeb_sink.cpp +++ b/src/audio_core/sink/cubeb_sink.cpp | |||
| @@ -364,7 +364,7 @@ bool IsCubebSuitable() { | |||
| 364 | } | 364 | } |
| 365 | #endif | 365 | #endif |
| 366 | 366 | ||
| 367 | // Test min latency | 367 | // Get min latency |
| 368 | cubeb_stream_params params{}; | 368 | cubeb_stream_params params{}; |
| 369 | params.rate = TargetSampleRate; | 369 | params.rate = TargetSampleRate; |
| 370 | params.channels = 2; | 370 | params.channels = 2; |
| @@ -380,11 +380,6 @@ bool IsCubebSuitable() { | |||
| 380 | } | 380 | } |
| 381 | latency = std::max(latency, TargetSampleCount * 2); | 381 | latency = std::max(latency, TargetSampleCount * 2); |
| 382 | 382 | ||
| 383 | if (latency > TargetSampleCount * 3) { | ||
| 384 | LOG_ERROR(Audio_Sink, "Cubeb latency is too high, it is not suitable."); | ||
| 385 | return false; | ||
| 386 | } | ||
| 387 | |||
| 388 | // Test opening a device with standard parameters | 383 | // Test opening a device with standard parameters |
| 389 | cubeb_devid output_device{0}; | 384 | cubeb_devid output_device{0}; |
| 390 | cubeb_devid input_device{0}; | 385 | cubeb_devid input_device{0}; |
diff --git a/src/audio_core/sink/sink_details.cpp b/src/audio_core/sink/sink_details.cpp index 6bec8ee7c..7c9a4e3ac 100644 --- a/src/audio_core/sink/sink_details.cpp +++ b/src/audio_core/sink/sink_details.cpp | |||
| @@ -83,8 +83,8 @@ const SinkDetails& GetOutputSinkDetails(Settings::AudioEngine sink_id) { | |||
| 83 | break; | 83 | break; |
| 84 | } | 84 | } |
| 85 | } | 85 | } |
| 86 | LOG_ERROR(Service_Audio, "Auto-selecting the {} backend", | 86 | LOG_INFO(Service_Audio, "Auto-selecting the {} backend", |
| 87 | Settings::CanonicalizeEnum(iter->id)); | 87 | Settings::CanonicalizeEnum(iter->id)); |
| 88 | } else { | 88 | } else { |
| 89 | if (iter != std::end(sink_details) && !iter->is_suitable()) { | 89 | if (iter != std::end(sink_details) && !iter->is_suitable()) { |
| 90 | LOG_ERROR(Service_Audio, "Selected backend {} is not suitable, falling back to null", | 90 | LOG_ERROR(Service_Audio, "Selected backend {} is not suitable, falling back to null", |
diff --git a/src/core/hle/service/audio/hwopus.cpp b/src/core/hle/service/audio/hwopus.cpp index fa77007f3..4a8276ed1 100644 --- a/src/core/hle/service/audio/hwopus.cpp +++ b/src/core/hle/service/audio/hwopus.cpp | |||
| @@ -174,7 +174,7 @@ public: | |||
| 174 | {6, &IHardwareOpusDecoderManager::DecodeInterleaved, "DecodeInterleavedWithPerfAndResetOld"}, | 174 | {6, &IHardwareOpusDecoderManager::DecodeInterleaved, "DecodeInterleavedWithPerfAndResetOld"}, |
| 175 | {7, nullptr, "DecodeInterleavedForMultiStreamWithPerfAndResetOld"}, | 175 | {7, nullptr, "DecodeInterleavedForMultiStreamWithPerfAndResetOld"}, |
| 176 | {8, &IHardwareOpusDecoderManager::DecodeInterleaved, "DecodeInterleaved"}, | 176 | {8, &IHardwareOpusDecoderManager::DecodeInterleaved, "DecodeInterleaved"}, |
| 177 | {9, nullptr, "DecodeInterleavedForMultiStream"}, | 177 | {9, &IHardwareOpusDecoderManager::DecodeInterleavedForMultiStream, "DecodeInterleavedForMultiStream"}, |
| 178 | }; | 178 | }; |
| 179 | // clang-format on | 179 | // clang-format on |
| 180 | 180 | ||
| @@ -206,6 +206,16 @@ private: | |||
| 206 | decoder_state.DecodeInterleaved(ctx, OpusDecoderState::PerfTime::Enabled, extra_behavior); | 206 | decoder_state.DecodeInterleaved(ctx, OpusDecoderState::PerfTime::Enabled, extra_behavior); |
| 207 | } | 207 | } |
| 208 | 208 | ||
| 209 | void DecodeInterleavedForMultiStream(HLERequestContext& ctx) { | ||
| 210 | LOG_DEBUG(Audio, "called"); | ||
| 211 | |||
| 212 | IPC::RequestParser rp{ctx}; | ||
| 213 | const auto extra_behavior = rp.Pop<bool>() ? OpusDecoderState::ExtraBehavior::ResetContext | ||
| 214 | : OpusDecoderState::ExtraBehavior::None; | ||
| 215 | |||
| 216 | decoder_state.DecodeInterleaved(ctx, OpusDecoderState::PerfTime::Enabled, extra_behavior); | ||
| 217 | } | ||
| 218 | |||
| 209 | OpusDecoderState decoder_state; | 219 | OpusDecoderState decoder_state; |
| 210 | }; | 220 | }; |
| 211 | 221 | ||
| @@ -354,6 +364,40 @@ void HwOpus::OpenHardwareOpusDecoderEx(HLERequestContext& ctx) { | |||
| 354 | system, OpusDecoderState{std::move(decoder), sample_rate, channel_count}); | 364 | system, OpusDecoderState{std::move(decoder), sample_rate, channel_count}); |
| 355 | } | 365 | } |
| 356 | 366 | ||
| 367 | void HwOpus::OpenHardwareOpusDecoderForMultiStreamEx(HLERequestContext& ctx) { | ||
| 368 | OpusMultiStreamParametersEx params; | ||
| 369 | std::memcpy(¶ms, ctx.ReadBuffer().data(), ctx.GetReadBufferSize()); | ||
| 370 | |||
| 371 | const auto& sample_rate = params.sample_rate; | ||
| 372 | const auto& channel_count = params.channel_count; | ||
| 373 | |||
| 374 | LOG_INFO( | ||
| 375 | Audio, | ||
| 376 | "called with sample_rate={}, channel_count={}, number_streams={}, number_stereo_streams={}", | ||
| 377 | sample_rate, channel_count, params.number_streams, params.number_stereo_streams); | ||
| 378 | |||
| 379 | ASSERT_MSG(sample_rate == 48000 || sample_rate == 24000 || sample_rate == 16000 || | ||
| 380 | sample_rate == 12000 || sample_rate == 8000, | ||
| 381 | "Invalid sample rate"); | ||
| 382 | |||
| 383 | int error = 0; | ||
| 384 | OpusDecoderPtr decoder{opus_multistream_decoder_create( | ||
| 385 | sample_rate, static_cast<int>(channel_count), params.number_streams, | ||
| 386 | params.number_stereo_streams, params.channel_mappings.data(), &error)}; | ||
| 387 | if (error != OPUS_OK || decoder == nullptr) { | ||
| 388 | LOG_ERROR(Audio, "Failed to create Opus decoder (error={}).", error); | ||
| 389 | IPC::ResponseBuilder rb{ctx, 2}; | ||
| 390 | // TODO(ogniK): Use correct error code | ||
| 391 | rb.Push(ResultUnknown); | ||
| 392 | return; | ||
| 393 | } | ||
| 394 | |||
| 395 | IPC::ResponseBuilder rb{ctx, 2, 0, 1}; | ||
| 396 | rb.Push(ResultSuccess); | ||
| 397 | rb.PushIpcInterface<IHardwareOpusDecoderManager>( | ||
| 398 | system, OpusDecoderState{std::move(decoder), sample_rate, channel_count}); | ||
| 399 | } | ||
| 400 | |||
| 357 | HwOpus::HwOpus(Core::System& system_) : ServiceFramework{system_, "hwopus"} { | 401 | HwOpus::HwOpus(Core::System& system_) : ServiceFramework{system_, "hwopus"} { |
| 358 | static const FunctionInfo functions[] = { | 402 | static const FunctionInfo functions[] = { |
| 359 | {0, &HwOpus::OpenHardwareOpusDecoder, "OpenHardwareOpusDecoder"}, | 403 | {0, &HwOpus::OpenHardwareOpusDecoder, "OpenHardwareOpusDecoder"}, |
| @@ -362,7 +406,8 @@ HwOpus::HwOpus(Core::System& system_) : ServiceFramework{system_, "hwopus"} { | |||
| 362 | {3, nullptr, "GetWorkBufferSizeForMultiStream"}, | 406 | {3, nullptr, "GetWorkBufferSizeForMultiStream"}, |
| 363 | {4, &HwOpus::OpenHardwareOpusDecoderEx, "OpenHardwareOpusDecoderEx"}, | 407 | {4, &HwOpus::OpenHardwareOpusDecoderEx, "OpenHardwareOpusDecoderEx"}, |
| 364 | {5, &HwOpus::GetWorkBufferSizeEx, "GetWorkBufferSizeEx"}, | 408 | {5, &HwOpus::GetWorkBufferSizeEx, "GetWorkBufferSizeEx"}, |
| 365 | {6, nullptr, "OpenHardwareOpusDecoderForMultiStreamEx"}, | 409 | {6, &HwOpus::OpenHardwareOpusDecoderForMultiStreamEx, |
| 410 | "OpenHardwareOpusDecoderForMultiStreamEx"}, | ||
| 366 | {7, &HwOpus::GetWorkBufferSizeForMultiStreamEx, "GetWorkBufferSizeForMultiStreamEx"}, | 411 | {7, &HwOpus::GetWorkBufferSizeForMultiStreamEx, "GetWorkBufferSizeForMultiStreamEx"}, |
| 367 | {8, nullptr, "GetWorkBufferSizeExEx"}, | 412 | {8, nullptr, "GetWorkBufferSizeExEx"}, |
| 368 | {9, nullptr, "GetWorkBufferSizeForMultiStreamExEx"}, | 413 | {9, nullptr, "GetWorkBufferSizeForMultiStreamExEx"}, |
diff --git a/src/core/hle/service/audio/hwopus.h b/src/core/hle/service/audio/hwopus.h index ece65c02c..91d9998ac 100644 --- a/src/core/hle/service/audio/hwopus.h +++ b/src/core/hle/service/audio/hwopus.h | |||
| @@ -18,8 +18,10 @@ struct OpusMultiStreamParametersEx { | |||
| 18 | u32 number_stereo_streams; | 18 | u32 number_stereo_streams; |
| 19 | u32 use_large_frame_size; | 19 | u32 use_large_frame_size; |
| 20 | u32 padding; | 20 | u32 padding; |
| 21 | std::array<u32, 64> channel_mappings; | 21 | std::array<u8, 0x100> channel_mappings; |
| 22 | }; | 22 | }; |
| 23 | static_assert(sizeof(OpusMultiStreamParametersEx) == 0x118, | ||
| 24 | "OpusMultiStreamParametersEx has incorrect size"); | ||
| 23 | 25 | ||
| 24 | class HwOpus final : public ServiceFramework<HwOpus> { | 26 | class HwOpus final : public ServiceFramework<HwOpus> { |
| 25 | public: | 27 | public: |
| @@ -29,6 +31,7 @@ public: | |||
| 29 | private: | 31 | private: |
| 30 | void OpenHardwareOpusDecoder(HLERequestContext& ctx); | 32 | void OpenHardwareOpusDecoder(HLERequestContext& ctx); |
| 31 | void OpenHardwareOpusDecoderEx(HLERequestContext& ctx); | 33 | void OpenHardwareOpusDecoderEx(HLERequestContext& ctx); |
| 34 | void OpenHardwareOpusDecoderForMultiStreamEx(HLERequestContext& ctx); | ||
| 32 | void GetWorkBufferSize(HLERequestContext& ctx); | 35 | void GetWorkBufferSize(HLERequestContext& ctx); |
| 33 | void GetWorkBufferSizeEx(HLERequestContext& ctx); | 36 | void GetWorkBufferSizeEx(HLERequestContext& ctx); |
| 34 | void GetWorkBufferSizeForMultiStreamEx(HLERequestContext& ctx); | 37 | void GetWorkBufferSizeForMultiStreamEx(HLERequestContext& ctx); |
diff --git a/src/core/hle/service/sockets/nsd.cpp b/src/core/hle/service/sockets/nsd.cpp index bac21752a..491b76d48 100644 --- a/src/core/hle/service/sockets/nsd.cpp +++ b/src/core/hle/service/sockets/nsd.cpp | |||
| @@ -19,6 +19,12 @@ enum class ServerEnvironmentType : u8 { | |||
| 19 | Dp, | 19 | Dp, |
| 20 | }; | 20 | }; |
| 21 | 21 | ||
| 22 | // This is nn::nsd::EnvironmentIdentifier | ||
| 23 | struct EnvironmentIdentifier { | ||
| 24 | std::array<u8, 8> identifier; | ||
| 25 | }; | ||
| 26 | static_assert(sizeof(EnvironmentIdentifier) == 0x8); | ||
| 27 | |||
| 22 | NSD::NSD(Core::System& system_, const char* name) : ServiceFramework{system_, name} { | 28 | NSD::NSD(Core::System& system_, const char* name) : ServiceFramework{system_, name} { |
| 23 | // clang-format off | 29 | // clang-format off |
| 24 | static const FunctionInfo functions[] = { | 30 | static const FunctionInfo functions[] = { |
| @@ -101,8 +107,9 @@ void NSD::ResolveEx(HLERequestContext& ctx) { | |||
| 101 | } | 107 | } |
| 102 | 108 | ||
| 103 | void NSD::GetEnvironmentIdentifier(HLERequestContext& ctx) { | 109 | void NSD::GetEnvironmentIdentifier(HLERequestContext& ctx) { |
| 104 | const std::string environment_identifier = "lp1"; | 110 | constexpr EnvironmentIdentifier lp1 = { |
| 105 | ctx.WriteBuffer(environment_identifier); | 111 | .identifier = {'l', 'p', '1', '\0', '\0', '\0', '\0', '\0'}}; |
| 112 | ctx.WriteBuffer(lp1); | ||
| 106 | 113 | ||
| 107 | IPC::ResponseBuilder rb{ctx, 2}; | 114 | IPC::ResponseBuilder rb{ctx, 2}; |
| 108 | rb.Push(ResultSuccess); | 115 | rb.Push(ResultSuccess); |
diff --git a/src/core/hle/service/sockets/sfdnsres.cpp b/src/core/hle/service/sockets/sfdnsres.cpp index 22e4a6f49..c657c4efd 100644 --- a/src/core/hle/service/sockets/sfdnsres.cpp +++ b/src/core/hle/service/sockets/sfdnsres.cpp | |||
| @@ -150,6 +150,12 @@ static std::pair<u32, GetAddrInfoError> GetHostByNameRequestImpl(HLERequestConte | |||
| 150 | const std::string host = Common::StringFromBuffer(host_buffer); | 150 | const std::string host = Common::StringFromBuffer(host_buffer); |
| 151 | // For now, ignore options, which are in input buffer 1 for GetHostByNameRequestWithOptions. | 151 | // For now, ignore options, which are in input buffer 1 for GetHostByNameRequestWithOptions. |
| 152 | 152 | ||
| 153 | // Prevent resolution of Nintendo servers | ||
| 154 | if (host.find("srv.nintendo.net") != std::string::npos) { | ||
| 155 | LOG_WARNING(Network, "Resolution of hostname {} requested, returning EAI_AGAIN", host); | ||
| 156 | return {0, GetAddrInfoError::AGAIN}; | ||
| 157 | } | ||
| 158 | |||
| 153 | auto res = Network::GetAddressInfo(host, /*service*/ std::nullopt); | 159 | auto res = Network::GetAddressInfo(host, /*service*/ std::nullopt); |
| 154 | if (!res.has_value()) { | 160 | if (!res.has_value()) { |
| 155 | return {0, Translate(res.error())}; | 161 | return {0, Translate(res.error())}; |
| @@ -261,6 +267,12 @@ static std::pair<u32, GetAddrInfoError> GetAddrInfoRequestImpl(HLERequestContext | |||
| 261 | const auto host_buffer = ctx.ReadBuffer(0); | 267 | const auto host_buffer = ctx.ReadBuffer(0); |
| 262 | const std::string host = Common::StringFromBuffer(host_buffer); | 268 | const std::string host = Common::StringFromBuffer(host_buffer); |
| 263 | 269 | ||
| 270 | // Prevent resolution of Nintendo servers | ||
| 271 | if (host.find("srv.nintendo.net") != std::string::npos) { | ||
| 272 | LOG_WARNING(Network, "Resolution of hostname {} requested, returning EAI_AGAIN", host); | ||
| 273 | return {0, GetAddrInfoError::AGAIN}; | ||
| 274 | } | ||
| 275 | |||
| 264 | std::optional<std::string> service = std::nullopt; | 276 | std::optional<std::string> service = std::nullopt; |
| 265 | if (ctx.CanReadBuffer(1)) { | 277 | if (ctx.CanReadBuffer(1)) { |
| 266 | const std::span<const u8> service_buffer = ctx.ReadBuffer(1); | 278 | const std::span<const u8> service_buffer = ctx.ReadBuffer(1); |
diff --git a/src/video_core/host1x/codecs/codec.cpp b/src/video_core/host1x/codecs/codec.cpp index 220cce28a..8d7da50fc 100644 --- a/src/video_core/host1x/codecs/codec.cpp +++ b/src/video_core/host1x/codecs/codec.cpp | |||
| @@ -319,6 +319,7 @@ void Codec::Decode() { | |||
| 319 | LOG_WARNING(Service_NVDRV, "Zero width or height in frame"); | 319 | LOG_WARNING(Service_NVDRV, "Zero width or height in frame"); |
| 320 | return; | 320 | return; |
| 321 | } | 321 | } |
| 322 | bool is_interlaced = initial_frame->interlaced_frame != 0; | ||
| 322 | if (av_codec_ctx->hw_device_ctx) { | 323 | if (av_codec_ctx->hw_device_ctx) { |
| 323 | final_frame = AVFramePtr{av_frame_alloc(), AVFrameDeleter}; | 324 | final_frame = AVFramePtr{av_frame_alloc(), AVFrameDeleter}; |
| 324 | ASSERT_MSG(final_frame, "av_frame_alloc final_frame failed"); | 325 | ASSERT_MSG(final_frame, "av_frame_alloc final_frame failed"); |
| @@ -334,7 +335,7 @@ void Codec::Decode() { | |||
| 334 | UNIMPLEMENTED_MSG("Unexpected video format: {}", final_frame->format); | 335 | UNIMPLEMENTED_MSG("Unexpected video format: {}", final_frame->format); |
| 335 | return; | 336 | return; |
| 336 | } | 337 | } |
| 337 | if (!final_frame->interlaced_frame) { | 338 | if (!is_interlaced) { |
| 338 | av_frames.push(std::move(final_frame)); | 339 | av_frames.push(std::move(final_frame)); |
| 339 | } else { | 340 | } else { |
| 340 | if (!filters_initialized) { | 341 | if (!filters_initialized) { |