OLD | NEW |
1 /* | 1 /* |
2 * copyright (c) 2001 Fabrice Bellard | 2 * copyright (c) 2001 Fabrice Bellard |
3 * | 3 * |
4 * This file is part of FFmpeg. | 4 * This file is part of FFmpeg. |
5 * | 5 * |
6 * FFmpeg is free software; you can redistribute it and/or | 6 * FFmpeg is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Lesser General Public | 7 * modify it under the terms of the GNU Lesser General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2.1 of the License, or (at your option) any later version. | 9 * version 2.1 of the License, or (at your option) any later version. |
10 * | 10 * |
11 * FFmpeg is distributed in the hope that it will be useful, | 11 * FFmpeg is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 * Lesser General Public License for more details. | 14 * Lesser General Public License for more details. |
15 * | 15 * |
16 * You should have received a copy of the GNU Lesser General Public | 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 | 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 | 18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
19 */ | 19 */ |
20 | 20 |
21 #ifndef AVFORMAT_AVFORMAT_H | 21 #ifndef AVFORMAT_AVFORMAT_H |
22 #define AVFORMAT_AVFORMAT_H | 22 #define AVFORMAT_AVFORMAT_H |
23 | 23 |
24 #define LIBAVFORMAT_VERSION_MAJOR 52 | 24 #define LIBAVFORMAT_VERSION_MAJOR 52 |
25 #define LIBAVFORMAT_VERSION_MINOR 50 | 25 #define LIBAVFORMAT_VERSION_MINOR 55 |
26 #define LIBAVFORMAT_VERSION_MICRO 0 | 26 #define LIBAVFORMAT_VERSION_MICRO 0 |
27 | 27 |
28 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ | 28 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |
29 LIBAVFORMAT_VERSION_MINOR, \ | 29 LIBAVFORMAT_VERSION_MINOR, \ |
30 LIBAVFORMAT_VERSION_MICRO) | 30 LIBAVFORMAT_VERSION_MICRO) |
31 #define LIBAVFORMAT_VERSION AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, \ | 31 #define LIBAVFORMAT_VERSION AV_VERSION(LIBAVFORMAT_VERSION_MAJOR, \ |
32 LIBAVFORMAT_VERSION_MINOR, \ | 32 LIBAVFORMAT_VERSION_MINOR, \ |
33 LIBAVFORMAT_VERSION_MICRO) | 33 LIBAVFORMAT_VERSION_MICRO) |
34 #define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT | 34 #define LIBAVFORMAT_BUILD LIBAVFORMAT_VERSION_INT |
35 | 35 |
(...skipping 20 matching lines...) Expand all Loading... |
56 #include "libavcodec/avcodec.h" | 56 #include "libavcodec/avcodec.h" |
57 | 57 |
58 #include "avio.h" | 58 #include "avio.h" |
59 | 59 |
60 struct AVFormatContext; | 60 struct AVFormatContext; |
61 | 61 |
62 | 62 |
63 /* | 63 /* |
64 * Public Metadata API. | 64 * Public Metadata API. |
65 * The metadata API allows libavformat to export metadata tags to a client | 65 * The metadata API allows libavformat to export metadata tags to a client |
66 * application using a sequence of key/value pairs. | 66 * application using a sequence of key/value pairs. Like all strings in FFmpeg, |
| 67 * metadata must be stored as UTF-8 encoded Unicode. Note that metadata |
| 68 * exported by demuxers isn't checked to be valid UTF-8 in most cases. |
67 * Important concepts to keep in mind: | 69 * Important concepts to keep in mind: |
68 * 1. Keys are unique; there can never be 2 tags with the same key. This is | 70 * 1. Keys are unique; there can never be 2 tags with the same key. This is |
69 * also meant semantically, i.e., a demuxer should not knowingly produce | 71 * also meant semantically, i.e., a demuxer should not knowingly produce |
70 * several keys that are literally different but semantically identical. | 72 * several keys that are literally different but semantically identical. |
71 * E.g., key=Author5, key=Author6. In this example, all authors must be | 73 * E.g., key=Author5, key=Author6. In this example, all authors must be |
72 * placed in the same tag. | 74 * placed in the same tag. |
73 * 2. Metadata is flat, not hierarchical; there are no subtags. If you | 75 * 2. Metadata is flat, not hierarchical; there are no subtags. If you |
74 * want to store, e.g., the email address of the child of producer Alice | 76 * want to store, e.g., the email address of the child of producer Alice |
75 * and actor Bob, that could have key=alice_and_bobs_childs_email_address. | 77 * and actor Bob, that could have key=alice_and_bobs_childs_email_address. |
76 * 3. Several modifiers can be applied to the tag name. This is done by | 78 * 3. Several modifiers can be applied to the tag name. This is done by |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 #define AVFMT_NOFILE 0x0001 | 237 #define AVFMT_NOFILE 0x0001 |
236 #define AVFMT_NEEDNUMBER 0x0002 /**< Needs '%d' in filename. */ | 238 #define AVFMT_NEEDNUMBER 0x0002 /**< Needs '%d' in filename. */ |
237 #define AVFMT_SHOW_IDS 0x0008 /**< Show format stream IDs numbers. */ | 239 #define AVFMT_SHOW_IDS 0x0008 /**< Show format stream IDs numbers. */ |
238 #define AVFMT_RAWPICTURE 0x0020 /**< Format wants AVPicture structure for | 240 #define AVFMT_RAWPICTURE 0x0020 /**< Format wants AVPicture structure for |
239 raw picture data. */ | 241 raw picture data. */ |
240 #define AVFMT_GLOBALHEADER 0x0040 /**< Format wants global header. */ | 242 #define AVFMT_GLOBALHEADER 0x0040 /**< Format wants global header. */ |
241 #define AVFMT_NOTIMESTAMPS 0x0080 /**< Format does not need / have any timestam
ps. */ | 243 #define AVFMT_NOTIMESTAMPS 0x0080 /**< Format does not need / have any timestam
ps. */ |
242 #define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */ | 244 #define AVFMT_GENERIC_INDEX 0x0100 /**< Use generic index building code. */ |
243 #define AVFMT_TS_DISCONT 0x0200 /**< Format allows timestamp discontinuities.
*/ | 245 #define AVFMT_TS_DISCONT 0x0200 /**< Format allows timestamp discontinuities.
*/ |
244 #define AVFMT_VARIABLE_FPS 0x0400 /**< Format allows variable fps. */ | 246 #define AVFMT_VARIABLE_FPS 0x0400 /**< Format allows variable fps. */ |
| 247 #define AVFMT_NODIMENSIONS 0x0800 /**< Format does not need width/height */ |
245 | 248 |
246 typedef struct AVOutputFormat { | 249 typedef struct AVOutputFormat { |
247 const char *name; | 250 const char *name; |
248 /** | 251 /** |
249 * Descriptive name for the format, meant to be more human-readable | 252 * Descriptive name for the format, meant to be more human-readable |
250 * than name. You should use the NULL_IF_CONFIG_SMALL() macro | 253 * than name. You should use the NULL_IF_CONFIG_SMALL() macro |
251 * to define it. | 254 * to define it. |
252 */ | 255 */ |
253 const char *long_name; | 256 const char *long_name; |
254 const char *mime_type; | 257 const char *mime_type; |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 /** | 514 /** |
512 * last packet in packet_buffer for this stream when muxing. | 515 * last packet in packet_buffer for this stream when muxing. |
513 * used internally, NOT PART OF PUBLIC API, dont read or write from outside
of libav* | 516 * used internally, NOT PART OF PUBLIC API, dont read or write from outside
of libav* |
514 */ | 517 */ |
515 struct AVPacketList *last_in_packet_buffer; | 518 struct AVPacketList *last_in_packet_buffer; |
516 | 519 |
517 /** | 520 /** |
518 * Average framerate | 521 * Average framerate |
519 */ | 522 */ |
520 AVRational avg_frame_rate; | 523 AVRational avg_frame_rate; |
| 524 |
| 525 /** |
| 526 * Number of frames that have been demuxed during av_find_stream_info() |
| 527 */ |
| 528 int codec_info_nb_frames; |
521 } AVStream; | 529 } AVStream; |
522 | 530 |
523 #define AV_PROGRAM_RUNNING 1 | 531 #define AV_PROGRAM_RUNNING 1 |
524 | 532 |
525 /** | 533 /** |
526 * New fields can be added to the end with minor version bumps. | 534 * New fields can be added to the end with minor version bumps. |
527 * Removal, reordering and changes to existing fields require a major | 535 * Removal, reordering and changes to existing fields require a major |
528 * version bump. | 536 * version bump. |
529 * sizeof(AVProgram) must not be used outside libav*. | 537 * sizeof(AVProgram) must not be used outside libav*. |
530 */ | 538 */ |
(...skipping 793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1324 do {\ | 1332 do {\ |
1325 ff_dynarray_add((intptr_t **)(tab), nb_ptr, (intptr_t)(elem));\ | 1333 ff_dynarray_add((intptr_t **)(tab), nb_ptr, (intptr_t)(elem));\ |
1326 } while(0) | 1334 } while(0) |
1327 #endif | 1335 #endif |
1328 | 1336 |
1329 time_t mktimegm(struct tm *tm); | 1337 time_t mktimegm(struct tm *tm); |
1330 struct tm *brktimegm(time_t secs, struct tm *tm); | 1338 struct tm *brktimegm(time_t secs, struct tm *tm); |
1331 const char *small_strptime(const char *p, const char *fmt, | 1339 const char *small_strptime(const char *p, const char *fmt, |
1332 struct tm *dt); | 1340 struct tm *dt); |
1333 | 1341 |
1334 struct in_addr; | 1342 /** |
1335 /* Deprecated, use getaddrinfo instead. */ | 1343 * Splits a URL string into components. To reassemble components back into |
1336 attribute_deprecated int resolve_host(struct in_addr *sin_addr, const char *host
name); | 1344 * a URL, use ff_url_join instead of using snprintf directly. |
| 1345 * |
| 1346 * The pointers to buffers for storing individual components may be null, |
| 1347 * in order to ignore that component. Buffers for components not found are |
| 1348 * set to empty strings. If the port isn't found, it is set to a negative |
| 1349 * value. |
| 1350 * |
| 1351 * @see ff_url_join |
| 1352 * |
| 1353 * @param proto the buffer for the protocol |
| 1354 * @param proto_size the size of the proto buffer |
| 1355 * @param authorization the buffer for the authorization |
| 1356 * @param authorization_size the size of the authorization buffer |
| 1357 * @param hostname the buffer for the host name |
| 1358 * @param hostname_size the size of the hostname buffer |
| 1359 * @param port_ptr a pointer to store the port number in |
| 1360 * @param path the buffer for the path |
| 1361 * @param path_size the size of the path buffer |
| 1362 * @param url the URL to split |
| 1363 */ |
| 1364 void ff_url_split(char *proto, int proto_size, |
| 1365 char *authorization, int authorization_size, |
| 1366 char *hostname, int hostname_size, |
| 1367 int *port_ptr, |
| 1368 char *path, int path_size, |
| 1369 const char *url); |
1337 | 1370 |
1338 void url_split(char *proto, int proto_size, | |
1339 char *authorization, int authorization_size, | |
1340 char *hostname, int hostname_size, | |
1341 int *port_ptr, | |
1342 char *path, int path_size, | |
1343 const char *url); | |
1344 | |
1345 #if LIBAVFORMAT_VERSION_MAJOR < 53 | |
1346 /** | 1371 /** |
1347 * @deprecated Use av_match_ext() instead. | 1372 * Assembles a URL string from components. This is the reverse operation |
| 1373 * of ff_url_split. |
| 1374 * |
| 1375 * Note, this requires networking to be initialized, so the caller must |
| 1376 * ensure ff_network_init has been called. |
| 1377 * |
| 1378 * @see ff_url_split |
| 1379 * |
| 1380 * @param str the buffer to fill with the url |
| 1381 * @param size the size of the str buffer |
| 1382 * @param proto the protocol identifier, if null, the separator |
| 1383 * after the identifier is left out, too |
| 1384 * @param authorization an optional authorization string, may be null |
| 1385 * @param hostname the host name string |
| 1386 * @param port the port number, left out from the string if negative |
| 1387 * @param fmt a generic format string for everything to add after the |
| 1388 * host/port, may be null |
| 1389 * @return the number of characters written to the destination buffer |
1348 */ | 1390 */ |
1349 attribute_deprecated int match_ext(const char *filename, const char *extensions)
; | 1391 int ff_url_join(char *str, int size, const char *proto, |
1350 #endif | 1392 const char *authorization, const char *hostname, |
| 1393 int port, const char *fmt, ...); |
1351 | 1394 |
1352 /** | 1395 /** |
1353 * Returns a positive value if the given filename has one of the given | 1396 * Returns a positive value if the given filename has one of the given |
1354 * extensions, 0 otherwise. | 1397 * extensions, 0 otherwise. |
1355 * | 1398 * |
1356 * @param extensions a comma-separated list of filename extensions | 1399 * @param extensions a comma-separated list of filename extensions |
1357 */ | 1400 */ |
1358 int av_match_ext(const char *filename, const char *extensions); | 1401 int av_match_ext(const char *filename, const char *extensions); |
1359 | 1402 |
1360 #endif /* HAVE_AV_CONFIG_H */ | 1403 #endif /* HAVE_AV_CONFIG_H */ |
1361 | 1404 |
1362 #endif /* AVFORMAT_AVFORMAT_H */ | 1405 #endif /* AVFORMAT_AVFORMAT_H */ |
OLD | NEW |