CircularBufferParameter.cs 2.4 KB

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