downmix_info.h 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. /*
  2. * Copyright (c) 2014 Tim Walker <tdskywalker@gmail.com>
  3. *
  4. * This file is part of FFmpeg.
  5. *
  6. * FFmpeg is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * FFmpeg 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. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with FFmpeg; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #ifndef AVUTIL_DOWNMIX_INFO_H
  21. #define AVUTIL_DOWNMIX_INFO_H
  22. #include "frame.h"
  23. /**
  24. * @file
  25. * audio downmix medatata
  26. */
  27. /**
  28. * @addtogroup lavu_audio
  29. * @{
  30. */
  31. /**
  32. * @defgroup downmix_info Audio downmix metadata
  33. * @{
  34. */
  35. /**
  36. * Possible downmix types.
  37. */
  38. enum AVDownmixType {
  39. AV_DOWNMIX_TYPE_UNKNOWN, /**< Not indicated. */
  40. AV_DOWNMIX_TYPE_LORO, /**< Lo/Ro 2-channel downmix (Stereo). */
  41. AV_DOWNMIX_TYPE_LTRT, /**< Lt/Rt 2-channel downmix, Dolby Surround compatible. */
  42. AV_DOWNMIX_TYPE_DPLII, /**< Lt/Rt 2-channel downmix, Dolby Pro Logic II compatible. */
  43. AV_DOWNMIX_TYPE_NB /**< Number of downmix types. Not part of ABI. */
  44. };
  45. /**
  46. * This structure describes optional metadata relevant to a downmix procedure.
  47. *
  48. * All fields are set by the decoder to the value indicated in the audio
  49. * bitstream (if present), or to a "sane" default otherwise.
  50. */
  51. typedef struct AVDownmixInfo {
  52. /**
  53. * Type of downmix preferred by the mastering engineer.
  54. */
  55. enum AVDownmixType preferred_downmix_type;
  56. /**
  57. * Absolute scale factor representing the nominal level of the center
  58. * channel during a regular downmix.
  59. */
  60. double center_mix_level;
  61. /**
  62. * Absolute scale factor representing the nominal level of the center
  63. * channel during an Lt/Rt compatible downmix.
  64. */
  65. double center_mix_level_ltrt;
  66. /**
  67. * Absolute scale factor representing the nominal level of the surround
  68. * channels during a regular downmix.
  69. */
  70. double surround_mix_level;
  71. /**
  72. * Absolute scale factor representing the nominal level of the surround
  73. * channels during an Lt/Rt compatible downmix.
  74. */
  75. double surround_mix_level_ltrt;
  76. /**
  77. * Absolute scale factor representing the level at which the LFE data is
  78. * mixed into L/R channels during downmixing.
  79. */
  80. double lfe_mix_level;
  81. } AVDownmixInfo;
  82. /**
  83. * Get a frame's AV_FRAME_DATA_DOWNMIX_INFO side data for editing.
  84. *
  85. * If the side data is absent, it is created and added to the frame.
  86. *
  87. * @param frame the frame for which the side data is to be obtained or created
  88. *
  89. * @return the AVDownmixInfo structure to be edited by the caller, or NULL if
  90. * the structure cannot be allocated.
  91. */
  92. AVDownmixInfo *av_downmix_info_update_side_data(AVFrame *frame);
  93. /**
  94. * @}
  95. */
  96. /**
  97. * @}
  98. */
  99. #endif /* AVUTIL_DOWNMIX_INFO_H */