History

lavc: add avcodec_get_type() for mapping codec_id -> type.

Anton Khirnov committed 15 years ago

Commit bca06e71 parent 7f5bf4f4 files · +27 −2Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavcodec/avcodec.h +8 −0
  3. libavcodec/utils.c +14 −0
  4. libavcodec/version.h +2 −2
doc/APIchanges+3−0
@@ -13,6 +13,9 @@ libavutil: 2011-04-18 · 12 unmodified lines
13 13
14API changes, most recent first:14API changes, most recent first:
15 15
162011-08-xx - xxxxxxx - lavc 53.8.0
17 Add avcodec_get_type().
18
162011-08-06 - 2f63440 - lavf 53.4.0192011-08-06 - 2f63440 - lavf 53.4.0
17 Add error_recognition to AVFormatContext.20 Add error_recognition to AVFormatContext.
18 21
libavcodec/avcodec.h+8−0
@@ -210,6 +210,7 @@ enum CodecID { · 209 unmodified lines
210 CODEC_ID_DFA,210 CODEC_ID_DFA,
211 211
212 /* various PCM "codecs" */212 /* various PCM "codecs" */
213 CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
213 CODEC_ID_PCM_S16LE= 0x10000,214 CODEC_ID_PCM_S16LE= 0x10000,
214 CODEC_ID_PCM_S16BE,215 CODEC_ID_PCM_S16BE,
215 CODEC_ID_PCM_U16LE,216 CODEC_ID_PCM_U16LE,
@@ -340,6 +341,7 @@ enum CodecID { · 124 unmodified lines
340 CODEC_ID_QDMC,341 CODEC_ID_QDMC,
341 342
342 /* subtitle codecs */343 /* subtitle codecs */
344 CODEC_ID_FIRST_SUBTITLE = 0x17000, ///< A dummy ID pointing at the start of subtitle codecs.
343 CODEC_ID_DVD_SUBTITLE= 0x17000,345 CODEC_ID_DVD_SUBTITLE= 0x17000,
344 CODEC_ID_DVB_SUBTITLE,346 CODEC_ID_DVB_SUBTITLE,
345 CODEC_ID_TEXT, ///< raw UTF-8 text347 CODEC_ID_TEXT, ///< raw UTF-8 text
@@ -351,6 +353,7 @@ enum CodecID { · 5 unmodified lines
351 CODEC_ID_SRT,353 CODEC_ID_SRT,
352 354
353 /* other specific kind of codecs (generally used for attachments) */355 /* other specific kind of codecs (generally used for attachments) */
356 CODEC_ID_FIRST_UNKNOWN = 0x18000, ///< A dummy ID pointing at the start of various fake codecs.
354 CODEC_ID_TTF= 0x18000,357 CODEC_ID_TTF= 0x18000,
355 358
356 CODEC_ID_PROBE= 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it359 CODEC_ID_PROBE= 0x19000, ///< codec_id is not known (like CODEC_ID_NONE) but lavf should attempt to identify it
@@ -4273,4 +4276,9 @@ enum AVLockOp { · 3916 unmodified lines
4273 */4276 */
4274int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));4277int av_lockmgr_register(int (*cb)(void **mutex, enum AVLockOp op));
4275 4278
4279/**
4280 * Get the type of the given codec.
4281 */
4282enum AVMediaType avcodec_get_type(enum CodecID codec_id);
4283
4276#endif /* AVCODEC_AVCODEC_H */4284#endif /* AVCODEC_AVCODEC_H */
libavcodec/utils.c+14−0
@@ -1301,3 +1301,17 @@ int avcodec_thread_init(AVCodecContext *s, int thread_count) · 1300 unmodified lines
1301 return ff_thread_init(s);1301 return ff_thread_init(s);
1302}1302}
1303#endif1303#endif
1304
1305enum AVMediaType avcodec_get_type(enum CodecID codec_id)
1306{
1307 if (codec_id <= CODEC_ID_NONE)
1308 return AVMEDIA_TYPE_UNKNOWN;
1309 else if (codec_id < CODEC_ID_FIRST_AUDIO)
1310 return AVMEDIA_TYPE_VIDEO;
1311 else if (codec_id < CODEC_ID_FIRST_SUBTITLE)
1312 return AVMEDIA_TYPE_AUDIO;
1313 else if (codec_id < CODEC_ID_FIRST_UNKNOWN)
1314 return AVMEDIA_TYPE_SUBTITLE;
1315
1316 return AVMEDIA_TYPE_UNKNOWN;
1317}
libavcodec/version.h+2−2
@@ -21,8 +21,8 @@ · 20 unmodified lines
21#define AVCODEC_VERSION_H21#define AVCODEC_VERSION_H
22 22
23#define LIBAVCODEC_VERSION_MAJOR 5323#define LIBAVCODEC_VERSION_MAJOR 53
24#define LIBAVCODEC_VERSION_MINOR 724#define LIBAVCODEC_VERSION_MINOR 8
25#define LIBAVCODEC_VERSION_MICRO 125#define LIBAVCODEC_VERSION_MICRO 0
26 26
27#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \27#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
28 LIBAVCODEC_VERSION_MINOR, \28 LIBAVCODEC_VERSION_MINOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t