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 21 module ffmpeg.libavutil.downmix_info; 22 23 import ffmpeg.libavutil.frame; 24 25 extern (C): 26 import ffmpeg; @nogc nothrow: 27 28 /** 29 * @file 30 * audio downmix medatata 31 */ 32 33 /** 34 * @addtogroup lavu_audio 35 * @{ 36 */ 37 38 /** 39 * @defgroup downmix_info Audio downmix metadata 40 * @{ 41 */ 42 43 /** 44 * Possible downmix types. 45 */ 46 enum AVDownmixType 47 { 48 AV_DOWNMIX_TYPE_UNKNOWN = 0, /**< Not indicated. */ 49 AV_DOWNMIX_TYPE_LORO = 1, /**< Lo/Ro 2-channel downmix (Stereo). */ 50 AV_DOWNMIX_TYPE_LTRT = 2, /**< Lt/Rt 2-channel downmix, Dolby Surround compatible. */ 51 AV_DOWNMIX_TYPE_DPLII = 3, /**< Lt/Rt 2-channel downmix, Dolby Pro Logic II compatible. */ 52 AV_DOWNMIX_TYPE_NB = 4 /**< Number of downmix types. Not part of ABI. */ 53 } 54 55 /** 56 * This structure describes optional metadata relevant to a downmix procedure. 57 * 58 * All fields are set by the decoder to the value indicated in the audio 59 * bitstream (if present), or to a "sane" default otherwise. 60 */ 61 struct AVDownmixInfo 62 { 63 /** 64 * Type of downmix preferred by the mastering engineer. 65 */ 66 AVDownmixType preferred_downmix_type; 67 68 /** 69 * Absolute scale factor representing the nominal level of the center 70 * channel during a regular downmix. 71 */ 72 double center_mix_level; 73 74 /** 75 * Absolute scale factor representing the nominal level of the center 76 * channel during an Lt/Rt compatible downmix. 77 */ 78 double center_mix_level_ltrt; 79 80 /** 81 * Absolute scale factor representing the nominal level of the surround 82 * channels during a regular downmix. 83 */ 84 double surround_mix_level; 85 86 /** 87 * Absolute scale factor representing the nominal level of the surround 88 * channels during an Lt/Rt compatible downmix. 89 */ 90 double surround_mix_level_ltrt; 91 92 /** 93 * Absolute scale factor representing the level at which the LFE data is 94 * mixed into L/R channels during downmixing. 95 */ 96 double lfe_mix_level; 97 } 98 99 /** 100 * Get a frame's AV_FRAME_DATA_DOWNMIX_INFO side data for editing. 101 * 102 * If the side data is absent, it is created and added to the frame. 103 * 104 * @param frame the frame for which the side data is to be obtained or created 105 * 106 * @return the AVDownmixInfo structure to be edited by the caller, or NULL if 107 * the structure cannot be allocated. 108 */ 109 AVDownmixInfo* av_downmix_info_update_side_data (AVFrame* frame); 110 111 /** 112 * @} 113 */ 114 115 /** 116 * @} 117 */ 118 119 /* AVUTIL_DOWNMIX_INFO_H */