CircularBufferParameter.cs 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  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.Audio.Common;
  18. using Ryujinx.Audio.Renderer.Common;
  19. using Ryujinx.Common.Memory;
  20. using System.Runtime.InteropServices;
  21. using CpuAddress = System.UInt64;
  22. namespace Ryujinx.Audio.Renderer.Parameter.Sink
  23. {
  24. /// <summary>
  25. /// <see cref="SinkInParameter.SpecificData"/> for <see cref="SinkType.CircularBuffer"/>.
  26. /// </summary>
  27. [StructLayout(LayoutKind.Sequential, Pack = 1)]
  28. public struct CircularBufferParameter
  29. {
  30. /// <summary>
  31. /// The CPU address of the user circular buffer.
  32. /// </summary>
  33. public CpuAddress BufferAddress;
  34. /// <summary>
  35. /// The size of the user circular buffer.
  36. /// </summary>
  37. public uint BufferSize;
  38. /// <summary>
  39. /// The total count of channels to output to the circular buffer.
  40. /// </summary>
  41. public uint InputCount;
  42. /// <summary>
  43. /// The target sample count to output per update in the circular buffer.
  44. /// </summary>
  45. public uint SampleCount;
  46. /// <summary>
  47. /// Last read offset on the CPU side.
  48. /// </summary>
  49. public uint LastReadOffset;
  50. /// <summary>
  51. /// The target <see cref="SampleFormat"/>.
  52. /// </summary>
  53. /// <remarks>Only <see cref="SampleFormat.PcmInt16"/> is supported.</remarks>
  54. public SampleFormat SampleFormat;
  55. /// <summary>
  56. /// Reserved/padding.
  57. /// </summary>
  58. private unsafe fixed byte _reserved1[3];
  59. /// <summary>
  60. /// The input channels index that will be used.
  61. /// </summary>
  62. public Array6<byte> Input;
  63. /// <summary>
  64. /// Reserved/padding.
  65. /// </summary>
  66. private ushort _reserved2;
  67. }
  68. }