AuxiliaryBufferParameter.cs 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. //
  2. // Copyright (c) 2019-2021 Ryujinx
  3. //
  4. // This program is free software: you can redistribute it and/or modify
  5. // it under the terms of the GNU Lesser General Public License as published by
  6. // the Free Software Foundation, either version 3 of the License, or
  7. // (at your option) any later version.
  8. //
  9. // This program is distributed in the hope that it will be useful,
  10. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. // GNU Lesser General Public License for more details.
  13. //
  14. // You should have received a copy of the GNU Lesser General Public License
  15. // along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. //
  17. using Ryujinx.Common.Memory;
  18. using System.Runtime.InteropServices;
  19. namespace Ryujinx.Audio.Renderer.Parameter.Effect
  20. {
  21. /// <summary>
  22. /// <see cref="IEffectInParameter.SpecificData"/> for <see cref="Common.EffectType.AuxiliaryBuffer"/> and <see cref="Common.EffectType.CaptureBuffer"/>.
  23. /// </summary>
  24. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  25. public struct AuxiliaryBufferParameter
  26. {
  27. /// <summary>
  28. /// The input channel indices that will be used by the <see cref="Dsp.AudioProcessor"/> to write data to <see cref="SendBufferInfoAddress"/>.
  29. /// </summary>
  30. public Array24<byte> Input;
  31. /// <summary>
  32. /// The output channel indices that will be used by the <see cref="Dsp.AudioProcessor"/> to read data from <see cref="ReturnBufferInfoAddress"/>.
  33. /// </summary>
  34. public Array24<byte> Output;
  35. /// <summary>
  36. /// The total channel count used.
  37. /// </summary>
  38. public uint ChannelCount;
  39. /// <summary>
  40. /// The target sample rate.
  41. /// </summary>
  42. public uint SampleRate;
  43. /// <summary>
  44. /// The buffer storage total size.
  45. /// </summary>
  46. public uint BufferStorageSize;
  47. /// <summary>
  48. /// The maximum number of channels supported.
  49. /// </summary>
  50. /// <remarks>This is unused.</remarks>
  51. public uint ChannelCountMax;
  52. /// <summary>
  53. /// The address of the start of the region containing two <see cref="Dsp.State.AuxiliaryBufferHeader"/> followed by the data that will be written by the <see cref="Dsp.AudioProcessor"/>.
  54. /// </summary>
  55. public ulong SendBufferInfoAddress;
  56. /// <summary>
  57. /// The address of the start of the region containling data that will be written by the <see cref="Dsp.AudioProcessor"/>.
  58. /// </summary>
  59. /// <remarks>This is unused.</remarks>
  60. public ulong SendBufferStorageAddress;
  61. /// <summary>
  62. /// The address of the start of the region containing two <see cref="Dsp.State.AuxiliaryBufferHeader"/> followed by the data that will be read by the <see cref="Dsp.AudioProcessor"/>.
  63. /// </summary>
  64. /// <remarks>Unused with <see cref="Common.EffectType.CaptureBuffer"/>.</remarks>
  65. public ulong ReturnBufferInfoAddress;
  66. /// <summary>
  67. /// The address of the start of the region containling data that will be read by the <see cref="Dsp.AudioProcessor"/>.
  68. /// </summary>
  69. /// <remarks>This is unused.</remarks>
  70. public ulong ReturnBufferStorageAddress;
  71. /// <summary>
  72. /// Size of a sample of the mix buffer.
  73. /// </summary>
  74. /// <remarks>This is unused.</remarks>
  75. public uint MixBufferSampleSize;
  76. /// <summary>
  77. /// The total count of sample that can be stored.
  78. /// </summary>
  79. /// <remarks>This is unused.</remarks>
  80. public uint TotalSampleCount;
  81. /// <summary>
  82. /// The count of sample of the mix buffer.
  83. /// </summary>
  84. /// <remarks>This is unused.</remarks>
  85. public uint MixBufferSampleCount;
  86. }
  87. }