FFmpeg.swresample.g.cs 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. #if UNITY_EDITOR || UNITY_STANDALONE
  2. using System;
  3. using System.Runtime.InteropServices;
  4. namespace FFmpeg.AutoGen
  5. {
  6. public unsafe partial struct AVBuffer
  7. {
  8. }
  9. public unsafe partial struct AVBufferPool
  10. {
  11. }
  12. public unsafe partial struct AVDictionary
  13. {
  14. }
  15. public unsafe partial struct SwrContext
  16. {
  17. }
  18. public enum SwrDitherType : int
  19. {
  20. @SWR_DITHER_NONE = 0,
  21. @SWR_DITHER_RECTANGULAR = 1,
  22. @SWR_DITHER_TRIANGULAR = 2,
  23. @SWR_DITHER_TRIANGULAR_HIGHPASS = 3,
  24. @SWR_DITHER_NS = 64,
  25. @SWR_DITHER_NS_LIPSHITZ = 65,
  26. @SWR_DITHER_NS_F_WEIGHTED = 66,
  27. @SWR_DITHER_NS_MODIFIED_E_WEIGHTED = 67,
  28. @SWR_DITHER_NS_IMPROVED_E_WEIGHTED = 68,
  29. @SWR_DITHER_NS_SHIBATA = 69,
  30. @SWR_DITHER_NS_LOW_SHIBATA = 70,
  31. @SWR_DITHER_NS_HIGH_SHIBATA = 71,
  32. @SWR_DITHER_NB = 72,
  33. }
  34. public enum SwrEngine : int
  35. {
  36. @SWR_ENGINE_SWR = 0,
  37. @SWR_ENGINE_SOXR = 1,
  38. @SWR_ENGINE_NB = 2,
  39. }
  40. public enum SwrFilterType : int
  41. {
  42. @SWR_FILTER_TYPE_CUBIC = 0,
  43. @SWR_FILTER_TYPE_BLACKMAN_NUTTALL = 1,
  44. @SWR_FILTER_TYPE_KAISER = 2,
  45. }
  46. public unsafe static partial class ffmpeg
  47. {
  48. public const int LIBSWRESAMPLE_VERSION_MAJOR = 2;
  49. public const int LIBSWRESAMPLE_VERSION_MINOR = 0;
  50. public const int LIBSWRESAMPLE_VERSION_MICRO = 101;
  51. public const int SWR_FLAG_RESAMPLE = 1;
  52. #if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
  53. private const string libswresample = "EasyMovieTexture";
  54. #else
  55. private const string libswresample = "swresample-2";
  56. #endif
  57. [DllImport(libswresample, EntryPoint = "swr_get_class", CallingConvention = CallingConvention.Cdecl)]
  58. public static extern AVClass* swr_get_class();
  59. [DllImport(libswresample, EntryPoint = "swr_alloc", CallingConvention = CallingConvention.Cdecl)]
  60. public static extern SwrContext* swr_alloc();
  61. [DllImport(libswresample, EntryPoint = "swr_init", CallingConvention = CallingConvention.Cdecl)]
  62. public static extern int swr_init(SwrContext* @s);
  63. [DllImport(libswresample, EntryPoint = "swr_is_initialized", CallingConvention = CallingConvention.Cdecl)]
  64. public static extern int swr_is_initialized(SwrContext* @s);
  65. [DllImport(libswresample, EntryPoint = "swr_alloc_set_opts", CallingConvention = CallingConvention.Cdecl)]
  66. public static extern SwrContext* swr_alloc_set_opts(SwrContext* @s, long @out_ch_layout, AVSampleFormat @out_sample_fmt, int @out_sample_rate, long @in_ch_layout, AVSampleFormat @in_sample_fmt, int @in_sample_rate, int @log_offset, void* @log_ctx);
  67. [DllImport(libswresample, EntryPoint = "swr_free", CallingConvention = CallingConvention.Cdecl)]
  68. public static extern void swr_free(SwrContext** @s);
  69. [DllImport(libswresample, EntryPoint = "swr_close", CallingConvention = CallingConvention.Cdecl)]
  70. public static extern void swr_close(SwrContext* @s);
  71. [DllImport(libswresample, EntryPoint = "swr_convert", CallingConvention = CallingConvention.Cdecl)]
  72. public static extern int swr_convert(SwrContext* @s, sbyte** @out, int @out_count, sbyte** @in, int @in_count);
  73. [DllImport(libswresample, EntryPoint = "swr_next_pts", CallingConvention = CallingConvention.Cdecl)]
  74. public static extern long swr_next_pts(SwrContext* @s, long @pts);
  75. [DllImport(libswresample, EntryPoint = "swr_set_compensation", CallingConvention = CallingConvention.Cdecl)]
  76. public static extern int swr_set_compensation(SwrContext* @s, int @sample_delta, int @compensation_distance);
  77. [DllImport(libswresample, EntryPoint = "swr_set_channel_mapping", CallingConvention = CallingConvention.Cdecl)]
  78. public static extern int swr_set_channel_mapping(SwrContext* @s, int* @channel_map);
  79. [DllImport(libswresample, EntryPoint = "swr_set_matrix", CallingConvention = CallingConvention.Cdecl)]
  80. public static extern int swr_set_matrix(SwrContext* @s, double* @matrix, int @stride);
  81. [DllImport(libswresample, EntryPoint = "swr_drop_output", CallingConvention = CallingConvention.Cdecl)]
  82. public static extern int swr_drop_output(SwrContext* @s, int @count);
  83. [DllImport(libswresample, EntryPoint = "swr_inject_silence", CallingConvention = CallingConvention.Cdecl)]
  84. public static extern int swr_inject_silence(SwrContext* @s, int @count);
  85. [DllImport(libswresample, EntryPoint = "swr_get_delay", CallingConvention = CallingConvention.Cdecl)]
  86. public static extern long swr_get_delay(SwrContext* @s, long @base);
  87. [DllImport(libswresample, EntryPoint = "swr_get_out_samples", CallingConvention = CallingConvention.Cdecl)]
  88. public static extern int swr_get_out_samples(SwrContext* @s, int @in_samples);
  89. [DllImport(libswresample, EntryPoint = "swresample_version", CallingConvention = CallingConvention.Cdecl)]
  90. public static extern uint swresample_version();
  91. [DllImport(libswresample, EntryPoint = "swresample_configuration", CallingConvention = CallingConvention.Cdecl)]
  92. public static extern string swresample_configuration();
  93. [DllImport(libswresample, EntryPoint = "swresample_license", CallingConvention = CallingConvention.Cdecl)]
  94. public static extern string swresample_license();
  95. [DllImport(libswresample, EntryPoint = "swr_convert_frame", CallingConvention = CallingConvention.Cdecl)]
  96. public static extern int swr_convert_frame(SwrContext* @swr, AVFrame* @output, AVFrame* @input);
  97. [DllImport(libswresample, EntryPoint = "swr_config_frame", CallingConvention = CallingConvention.Cdecl)]
  98. public static extern int swr_config_frame(SwrContext* @swr, AVFrame* @out, AVFrame* @in);
  99. }
  100. }
  101. #endif