1 /* 2 * copyright (c) 2003 Fabrice Bellard 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 module ffmpeg.libavutil.avutil; 21 22 import std.stdint; 23 //import std.format; 24 //import std.array; 25 import core.vararg; 26 27 public import ffmpeg.libavutil.common; 28 public import ffmpeg.libavutil.rational; 29 public import ffmpeg.libavutil.samplefmt; 30 public import ffmpeg.libavutil.frame; 31 public import ffmpeg.libavutil.pixfmt; 32 public import ffmpeg.libavutil.log; 33 public import ffmpeg.libavutil.dict; 34 public import ffmpeg.libavutil.error; 35 public import ffmpeg.libavutil.mathematics; 36 public import ffmpeg.libavutil.channel_layout; 37 public import ffmpeg.libavutil.avutil_version; 38 39 @nogc nothrow extern(C): 40 41 /* 42 * @mainpage 43 * 44 * @section libav_intro Introduction 45 * 46 * This document describes the usage of the different libraries 47 * provided by FFmpeg. 48 * 49 * @li @ref libavc "libavcodec" encoding/decoding library 50 * @li @subpage libavfilter graph based frame editing library 51 * @li @ref libavf "libavformat" I/O and muxing/demuxing library 52 * @li @ref lavd "libavdevice" special devices muxing/demuxing library 53 * @li @ref lavu "libavutil" common utility library 54 * @li @subpage libpostproc post processing library 55 * @li @subpage libswscale color conversion and scaling library 56 */ 57 58 /** 59 * @defgroup lavu Common utility functions 60 * 61 * @brief 62 * libavutil contains the code shared across all the other FFmpeg 63 * libraries 64 * 65 * @note In order to use the functions provided by avutil you must include 66 * the specific header. 67 * 68 * @{ 69 * 70 * @defgroup lavu_crypto Crypto and Hashing 71 * 72 * @{ 73 * @} 74 * 75 * @defgroup lavu_math Maths 76 * @{ 77 * 78 * @} 79 * 80 * @defgroup lavu_string String Manipulation 81 * 82 * @{ 83 * 84 * @} 85 * 86 * @defgroup lavu_mem Memory Management 87 * 88 * @{ 89 * 90 * @} 91 * 92 * @defgroup lavu_data Data Structures 93 * @{ 94 * 95 * @} 96 * 97 * @defgroup lavu_audio Audio related 98 * 99 * @{ 100 * 101 * @} 102 * 103 * @defgroup lavu_error Error Codes 104 * 105 * @{ 106 * 107 * @} 108 * 109 * @defgroup lavu_misc Other 110 * 111 * @{ 112 * 113 * @defgroup lavu_internal Internal 114 * 115 * Not exported functions, for internal usage only 116 * 117 * @{ 118 * 119 * @} 120 */ 121 122 /** 123 * @addtogroup lavu_ver 124 * @{ 125 */ 126 127 /** 128 * Return the LIBAVUTIL_VERSION_INT constant. 129 */ 130 uint avutil_version(); 131 132 /** 133 * Return an informative version string. This usually is the actual release 134 * version number or a git commit description. This string has no fixed format 135 * and can change any time. It should never be parsed by code. 136 */ 137 char *av_version_info(); 138 139 /** 140 * Return the libavutil build-time configuration. 141 */ 142 char *avutil_configuration(); 143 144 /** 145 * Return the libavutil license. 146 */ 147 char *avutil_license(); 148 149 /** 150 * @} 151 */ 152 153 /** 154 * @addtogroup lavu_media Media Type 155 * @brief Media Type 156 */ 157 158 enum AVMediaType { 159 AVMEDIA_TYPE_UNKNOWN = -1, ///< Usually treated as AVMEDIA_TYPE_DATA 160 AVMEDIA_TYPE_VIDEO, 161 AVMEDIA_TYPE_AUDIO, 162 AVMEDIA_TYPE_DATA, ///< Opaque data information usually continuous 163 AVMEDIA_TYPE_SUBTITLE, 164 AVMEDIA_TYPE_ATTACHMENT, ///< Opaque data information usually sparse 165 AVMEDIA_TYPE_NB 166 } 167 168 /** 169 * Return a string describing the media_type enum, NULL if media_type 170 * is unknown. 171 */ 172 char* av_get_media_type_string(AVMediaType media_type); 173 174 /** 175 * @defgroup lavu_const Constants 176 * @{ 177 * 178 * @defgroup lavu_enc Encoding specific 179 * 180 * @note those definition should move to avcodec 181 * @{ 182 */ 183 184 enum FF_LAMBDA_SHIFT = 7; 185 enum FF_LAMBDA_SCALE = (1<<FF_LAMBDA_SHIFT); 186 enum FF_QP2LAMBDA = 118; ///< factor to convert from H.263 QP to lambda 187 enum FF_LAMBDA_MAX = (256*128-1); 188 189 enum FF_QUALITY_SCALE = FF_LAMBDA_SCALE; //FIXME maybe remove 190 191 /** 192 * @} 193 * @defgroup lavu_time Timestamp specific 194 * 195 * FFmpeg internal timebase and timestamp definitions 196 * 197 * @{ 198 */ 199 200 /** 201 * @brief Undefined timestamp value 202 * 203 * Usually reported by demuxer that work on containers that do not provide 204 * either pts or dts. 205 */ 206 207 enum AV_NOPTS_VALUE = 0x8000000000000000; 208 209 210 /** 211 * Internal time base represented as integer 212 */ 213 214 enum AV_TIME_BASE = 1000_000; 215 216 /** 217 * Internal time base represented as fractional value 218 */ 219 220 AVRational AV_TIME_BASE_Q = {num:1, den:AV_TIME_BASE}; 221 222 /** 223 * @} 224 * @} 225 * @defgroup lavu_picture Image related 226 * 227 * AVPicture types, pixel formats and basic image planes manipulation. 228 * 229 * @{ 230 */ 231 enum AVPictureType { 232 AV_PICTURE_TYPE_NONE = 0, 233 AV_PICTURE_TYPE_I, 234 AV_PICTURE_TYPE_P, 235 AV_PICTURE_TYPE_B, 236 AV_PICTURE_TYPE_S, 237 AV_PICTURE_TYPE_SI, 238 AV_PICTURE_TYPE_SP, 239 AV_PICTURE_TYPE_BI 240 } 241 242 /** 243 * Return a single letter to describe the given picture type 244 * pict_type. 245 * 246 * @param[in] pict_type the picture type @return a single character 247 * representing the picture type, '?' if pict_type is unknown 248 */ 249 char av_get_picture_type_char(AVPictureType pict_type); 250 251 // end avutil.h 252 253 /** 254 * Return x default pointer in case p is NULL. 255 */ 256 //static inline void *av_x_if_null(const void *p, const void *x) 257 //{ 258 // return (void *)(intptr_t)(p ? p : x); 259 //} 260 261 /** 262 * Compute the length of an integer list. 263 * 264 * @param elsize size in bytes of each list element (only 1, 2, 4 or 8) 265 * @param term list terminator (usually 0 or -1) 266 * @param list pointer to the list 267 * @return length of the list, in elements, not counting the terminator 268 */ 269 //unsigned av_int_list_length_for_size(unsigned elsize, 270 // const void *list, uint64_t term) av_pure; 271 272 /** 273 * Compute the length of an integer list. 274 * 275 * @param term list terminator (usually 0 or -1) 276 * @param list pointer to the list 277 * @return length of the list, in elements, not counting the terminator 278 */ 279 //#define av_int_list_length(list, term) \ 280 //av_int_list_length_for_size(sizeof(*(list)), list, term) 281 282 /** 283 * Open a file using a UTF-8 filename. 284 * The API of this function matches POSIX fopen(), errors are returned through 285 * errno. 286 */ 287 //FILE *av_fopen_utf8(const char *path, const char *mode); 288 289 /** 290 * Return the fractional representation of the internal time base. 291 */ 292 //AVRational av_get_time_base_q(void); 293 294 /** 295 * @} 296 * @} 297 */