audio.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /* GStreamer
  2. * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu>
  3. * Library <2001> Thomas Vander Stichele <thomas@apestaart.org>
  4. * <2011> Wim Taymans <wim.taymans@gmail.com>
  5. *
  6. * This library is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Library General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2 of the License, or (at your option) any later version.
  10. *
  11. * This library is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Library General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Library General Public
  17. * License along with this library; if not, write to the
  18. * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
  19. * Boston, MA 02110-1301, USA.
  20. */
  21. #ifndef __GST_AUDIO_AUDIO_H__
  22. #define __GST_AUDIO_AUDIO_H__
  23. #include <gst/gst.h>
  24. #include <gst/audio/audio-enumtypes.h>
  25. #include <gst/audio/audio-format.h>
  26. #include <gst/audio/audio-channels.h>
  27. #include <gst/audio/audio-channel-mixer.h>
  28. #include <gst/audio/audio-info.h>
  29. #include <gst/audio/audio-quantize.h>
  30. #include <gst/audio/audio-converter.h>
  31. G_BEGIN_DECLS
  32. /* conversion macros */
  33. /**
  34. * GST_FRAMES_TO_CLOCK_TIME:
  35. * @frames: sample frames
  36. * @rate: sampling rate
  37. *
  38. * Calculate clocktime from sample @frames and @rate.
  39. */
  40. #define GST_FRAMES_TO_CLOCK_TIME(frames, rate) \
  41. ((GstClockTime) gst_util_uint64_scale_round (frames, GST_SECOND, rate))
  42. /**
  43. * GST_CLOCK_TIME_TO_FRAMES:
  44. * @clocktime: clock time
  45. * @rate: sampling rate
  46. *
  47. * Calculate frames from @clocktime and sample @rate.
  48. */
  49. #define GST_CLOCK_TIME_TO_FRAMES(clocktime, rate) \
  50. gst_util_uint64_scale_round (clocktime, rate, GST_SECOND)
  51. /* metadata macros */
  52. /**
  53. * GST_META_TAG_AUDIO_STR:
  54. *
  55. * This metadata is relevant for audio streams.
  56. *
  57. * Since: 1.2
  58. */
  59. #define GST_META_TAG_AUDIO_STR "audio"
  60. /**
  61. * GST_META_TAG_AUDIO_CHANNELS_STR:
  62. *
  63. * This metadata stays relevant as long as channels are unchanged.
  64. *
  65. * Since: 1.2
  66. */
  67. #define GST_META_TAG_AUDIO_CHANNELS_STR "channels"
  68. /**
  69. * GST_META_TAG_AUDIO_RATE_STR:
  70. *
  71. * This metadata stays relevant as long as sample rate is unchanged.
  72. *
  73. * Since: 1.8
  74. */
  75. #define GST_META_TAG_AUDIO_RATE_STR "rate"
  76. /*
  77. * this library defines and implements some helper functions for audio
  78. * handling
  79. */
  80. GstBuffer * gst_audio_buffer_clip (GstBuffer *buffer, GstSegment *segment,
  81. gint rate, gint bpf);
  82. G_END_DECLS
  83. #include <gst/audio/gstaudioringbuffer.h>
  84. #include <gst/audio/gstaudioclock.h>
  85. #include <gst/audio/gstaudiofilter.h>
  86. #include <gst/audio/gstaudiocdsrc.h>
  87. #include <gst/audio/gstaudiodecoder.h>
  88. #include <gst/audio/gstaudioencoder.h>
  89. #include <gst/audio/gstaudiobasesink.h>
  90. #include <gst/audio/gstaudiobasesrc.h>
  91. #include <gst/audio/gstaudiometa.h>
  92. #include <gst/audio/gstaudiosink.h>
  93. #include <gst/audio/gstaudiosrc.h>
  94. #include <gst/audio/streamvolume.h>
  95. #include <gst/audio/gstaudioiec61937.h>
  96. #endif /* __GST_AUDIO_AUDIO_H__ */