1 /* 2 * Codec descriptors public API 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.libavcodec.codec_desc; 21 22 import ffmpeg.libavcodec; 23 import ffmpeg.libavutil; 24 import ffmpeg.libavutil.avutil; 25 26 extern (C) @nogc nothrow: 27 28 /** 29 * @addtogroup lavc_core 30 * @{ 31 */ 32 33 /** 34 * This struct describes the properties of a single codec described by an 35 * AVCodecID. 36 * @see avcodec_descriptor_get() 37 */ 38 struct AVCodecDescriptor 39 { 40 AVCodecID id; 41 AVMediaType type; 42 /** 43 * Name of the codec described by this descriptor. It is non-empty and 44 * unique for each codec descriptor. It should contain alphanumeric 45 * characters and '_' only. 46 */ 47 const(char)* name; 48 /** 49 * A more descriptive name for this codec. May be NULL. 50 */ 51 const(char)* long_name; 52 /** 53 * Codec properties, a combination of AV_CODEC_PROP_* flags. 54 */ 55 int props; 56 /** 57 * MIME type(s) associated with the codec. 58 * May be NULL; if not, a NULL-terminated array of MIME types. 59 * The first item is always non-NULL and is the preferred MIME type. 60 */ 61 const(char*)* mime_types; 62 /** 63 * If non-NULL, an array of profiles recognized for this codec. 64 * Terminated with FF_PROFILE_UNKNOWN. 65 */ 66 struct AVProfile; 67 const(AVProfile)* profiles; 68 } 69 70 /** 71 * Codec uses only intra compression. 72 * Video and audio codecs only. 73 */ 74 enum AV_CODEC_PROP_INTRA_ONLY = 1 << 0; 75 /** 76 * Codec supports lossy compression. Audio and video codecs only. 77 * @note a codec may support both lossy and lossless 78 * compression modes 79 */ 80 enum AV_CODEC_PROP_LOSSY = 1 << 1; 81 /** 82 * Codec supports lossless compression. Audio and video codecs only. 83 */ 84 enum AV_CODEC_PROP_LOSSLESS = 1 << 2; 85 /** 86 * Codec supports frame reordering. That is, the coded order (the order in which 87 * the encoded packets are output by the encoders / stored / input to the 88 * decoders) may be different from the presentation order of the corresponding 89 * frames. 90 * 91 * For codecs that do not have this property set, PTS and DTS should always be 92 * equal. 93 */ 94 enum AV_CODEC_PROP_REORDER = 1 << 3; 95 /** 96 * Subtitle codec is bitmap based 97 * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field. 98 */ 99 enum AV_CODEC_PROP_BITMAP_SUB = 1 << 16; 100 /** 101 * Subtitle codec is text based. 102 * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field. 103 */ 104 enum AV_CODEC_PROP_TEXT_SUB = 1 << 17; 105 106 /** 107 * @return descriptor for given codec ID or NULL if no descriptor exists. 108 */ 109 const(AVCodecDescriptor)* avcodec_descriptor_get (AVCodecID id); 110 111 /** 112 * Iterate over all codec descriptors known to libavcodec. 113 * 114 * @param prev previous descriptor. NULL to get the first descriptor. 115 * 116 * @return next descriptor or NULL after the last descriptor 117 */ 118 const(AVCodecDescriptor)* avcodec_descriptor_next (const(AVCodecDescriptor)* prev); 119 120 /** 121 * @return codec descriptor with the given name or NULL if no such descriptor 122 * exists. 123 */ 124 const(AVCodecDescriptor)* avcodec_descriptor_get_by_name (const(char)* name); 125 126 /** 127 * @} 128 */ 129 130 // AVCODEC_CODEC_DESC_H