diff options
| author | Ac_K <Acoustik666@gmail.com> | 2019-07-12 03:13:43 +0200 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2019-07-11 22:13:43 -0300 |
| commit | 560ccbeb2d55a4426ad2827bf7534d4a695431c2 (patch) | |
| tree | 7e224acbd6c023ea56ff80c6207aa0966aa06ee5 /Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoder.cs | |
| parent | f723f6f39aaf7b1cebc0224a055058d62e3b689c (diff) | |
Refactoring commands handling (#728)
* Refactoring commands handling
- Use Reflection to handle commands ID.
- Add all symbols (from SwIPC so not all time accurate).
- Re-sort some services commands methods.
- Some cleanup.
- Keep some empty constructor for consistency.
* Fix order in IProfile
Diffstat (limited to 'Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoder.cs')
| -rw-r--r-- | Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoder.cs | 40 |
1 files changed, 16 insertions, 24 deletions
diff --git a/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoder.cs b/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoder.cs index 68b02bcc..1c48cfe2 100644 --- a/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoder.cs +++ b/Ryujinx.HLE/HOS/Services/Aud/IHardwareOpusDecoder.cs @@ -1,6 +1,4 @@ using Concentus.Structs; -using Ryujinx.HLE.HOS.Ipc; -using System.Collections.Generic; using static Ryujinx.HLE.HOS.ErrorCode; @@ -10,10 +8,6 @@ namespace Ryujinx.HLE.HOS.Services.Aud { private const int FixedSampleRate = 48000; - private Dictionary<int, ServiceProcessRequest> _commands; - - public override IReadOnlyDictionary<int, ServiceProcessRequest> Commands => _commands; - private int _sampleRate; private int _channelsCount; @@ -21,29 +15,14 @@ namespace Ryujinx.HLE.HOS.Services.Aud public IHardwareOpusDecoder(int sampleRate, int channelsCount) { - _commands = new Dictionary<int, ServiceProcessRequest> - { - { 0, DecodeInterleaved }, - { 4, DecodeInterleavedWithPerf } - }; - _sampleRate = sampleRate; _channelsCount = channelsCount; _decoder = new OpusDecoder(FixedSampleRate, channelsCount); } - public long DecodeInterleavedWithPerf(ServiceCtx context) - { - long result = DecodeInterleaved(context); - - // TODO: Figure out what this value is. - // According to switchbrew, it is now used. - context.ResponseData.Write(0L); - - return result; - } - + [Command(0)] + // DecodeInterleaved(buffer<unknown, 5>) -> (u32, u32, buffer<unknown, 6>) public long DecodeInterleaved(ServiceCtx context) { long inPosition = context.Request.SendBuff[0].Position; @@ -87,5 +66,18 @@ namespace Ryujinx.HLE.HOS.Services.Aud return 0; } + + [Command(4)] + // DecodeInterleavedWithPerf(buffer<unknown, 5>) -> (u32, u32, u64, buffer<unknown, 0x46>) + public long DecodeInterleavedWithPerf(ServiceCtx context) + { + long result = DecodeInterleaved(context); + + // TODO: Figure out what this value is. + // According to switchbrew, it is now used. + context.ResponseData.Write(0L); + + return result; + } } -} +}
\ No newline at end of file |
