avformat/mpeg: demux ivtv captions
[ffmpeg.git] / libavcodec / codec_desc.h
blob96afd20208b3dd4c3eb44710d45c61e116a9dbce
1 /*
2 * Codec descriptors public API
4 * This file is part of FFmpeg.
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.
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.
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
21 #ifndef AVCODEC_CODEC_DESC_H
22 #define AVCODEC_CODEC_DESC_H
24 #include "libavutil/avutil.h"
26 #include "codec_id.h"
28 /**
29 * @addtogroup lavc_core
30 * @{
33 /**
34 * This struct describes the properties of a single codec described by an
35 * AVCodecID.
36 * @see avcodec_descriptor_get()
38 typedef struct AVCodecDescriptor {
39 enum AVCodecID id;
40 enum AVMediaType type;
41 /**
42 * Name of the codec described by this descriptor. It is non-empty and
43 * unique for each codec descriptor. It should contain alphanumeric
44 * characters and '_' only.
46 const char *name;
47 /**
48 * A more descriptive name for this codec. May be NULL.
50 const char *long_name;
51 /**
52 * Codec properties, a combination of AV_CODEC_PROP_* flags.
54 int props;
55 /**
56 * MIME type(s) associated with the codec.
57 * May be NULL; if not, a NULL-terminated array of MIME types.
58 * The first item is always non-NULL and is the preferred MIME type.
60 const char *const *mime_types;
61 /**
62 * If non-NULL, an array of profiles recognized for this codec.
63 * Terminated with AV_PROFILE_UNKNOWN.
65 const struct AVProfile *profiles;
66 } AVCodecDescriptor;
68 /**
69 * Codec uses only intra compression.
70 * Video and audio codecs only.
72 #define AV_CODEC_PROP_INTRA_ONLY (1 << 0)
73 /**
74 * Codec supports lossy compression. Audio and video codecs only.
75 * @note a codec may support both lossy and lossless
76 * compression modes
78 #define AV_CODEC_PROP_LOSSY (1 << 1)
79 /**
80 * Codec supports lossless compression. Audio and video codecs only.
82 #define AV_CODEC_PROP_LOSSLESS (1 << 2)
83 /**
84 * Codec supports frame reordering. That is, the coded order (the order in which
85 * the encoded packets are output by the encoders / stored / input to the
86 * decoders) may be different from the presentation order of the corresponding
87 * frames.
89 * For codecs that do not have this property set, PTS and DTS should always be
90 * equal.
92 #define AV_CODEC_PROP_REORDER (1 << 3)
94 /**
95 * Video codec supports separate coding of fields in interlaced frames.
97 #define AV_CODEC_PROP_FIELDS (1 << 4)
99 /**
100 * Subtitle codec is bitmap based
101 * Decoded AVSubtitle data can be read from the AVSubtitleRect->pict field.
103 #define AV_CODEC_PROP_BITMAP_SUB (1 << 16)
105 * Subtitle codec is text based.
106 * Decoded AVSubtitle data can be read from the AVSubtitleRect->ass field.
108 #define AV_CODEC_PROP_TEXT_SUB (1 << 17)
111 * @return descriptor for given codec ID or NULL if no descriptor exists.
113 const AVCodecDescriptor *avcodec_descriptor_get(enum AVCodecID id);
116 * Iterate over all codec descriptors known to libavcodec.
118 * @param prev previous descriptor. NULL to get the first descriptor.
120 * @return next descriptor or NULL after the last descriptor
122 const AVCodecDescriptor *avcodec_descriptor_next(const AVCodecDescriptor *prev);
125 * @return codec descriptor with the given name or NULL if no such descriptor
126 * exists.
128 const AVCodecDescriptor *avcodec_descriptor_get_by_name(const char *name);
131 * @}
134 #endif // AVCODEC_CODEC_DESC_H