asrc_abuffer.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * This file is part of FFmpeg.
  3. *
  4. * FFmpeg is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * FFmpeg 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 GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with FFmpeg; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef AVFILTER_ASRC_ABUFFER_H
  19. #define AVFILTER_ASRC_ABUFFER_H
  20. #include "avfilter.h"
  21. /**
  22. * @file
  23. * memory buffer source for audio
  24. */
  25. /**
  26. * Queue an audio buffer to the audio buffer source.
  27. *
  28. * @param abuffersrc audio source buffer context
  29. * @param data pointers to the samples planes
  30. * @param linesize linesizes of each audio buffer plane
  31. * @param nb_samples number of samples per channel
  32. * @param sample_fmt sample format of the audio data
  33. * @param ch_layout channel layout of the audio data
  34. * @param planar flag to indicate if audio data is planar or packed
  35. * @param pts presentation timestamp of the audio buffer
  36. * @param flags unused
  37. */
  38. int av_asrc_buffer_add_samples(AVFilterContext *abuffersrc,
  39. uint8_t *data[8], int linesize[8],
  40. int nb_samples, int sample_rate,
  41. int sample_fmt, int64_t ch_layout, int planar,
  42. int64_t pts, int av_unused flags);
  43. /**
  44. * Queue an audio buffer to the audio buffer source.
  45. *
  46. * This is similar to av_asrc_buffer_add_samples(), but the samples
  47. * are stored in a buffer with known size.
  48. *
  49. * @param abuffersrc audio source buffer context
  50. * @param buf pointer to the samples data, packed is assumed
  51. * @param size the size in bytes of the buffer, it must contain an
  52. * integer number of samples
  53. * @param sample_fmt sample format of the audio data
  54. * @param ch_layout channel layout of the audio data
  55. * @param pts presentation timestamp of the audio buffer
  56. * @param flags unused
  57. */
  58. int av_asrc_buffer_add_buffer(AVFilterContext *abuffersrc,
  59. uint8_t *buf, int buf_size,
  60. int sample_rate,
  61. int sample_fmt, int64_t ch_layout, int planar,
  62. int64_t pts, int av_unused flags);
  63. /**
  64. * Queue an audio buffer to the audio buffer source.
  65. *
  66. * @param abuffersrc audio source buffer context
  67. * @param samplesref buffer ref to queue
  68. * @param flags unused
  69. */
  70. int av_asrc_buffer_add_audio_buffer_ref(AVFilterContext *abuffersrc,
  71. AVFilterBufferRef *samplesref,
  72. int av_unused flags);
  73. #endif /* AVFILTER_ASRC_ABUFFER_H */