annotate internal.h @ 6491:b7f807b4cd88 libavformat tip

In mov demuxer, check that nb_streams is valid before using it in read_dac3
author bcoudurier
date Tue, 28 Sep 2010 00:33:21 +0000
parents 1f6088eaa469
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3788
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
1 /*
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
2 * copyright (c) 2001 Fabrice Bellard
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
3 *
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
4 * This file is part of FFmpeg.
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
5 *
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
10 *
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
14 * Lesser General Public License for more details.
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
15 *
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
19 */
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
20
3852
1b6245500d8c Globally rename the header inclusion guard names.
stefano
parents: 3788
diff changeset
21 #ifndef AVFORMAT_INTERNAL_H
1b6245500d8c Globally rename the header inclusion guard names.
stefano
parents: 3788
diff changeset
22 #define AVFORMAT_INTERNAL_H
3788
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
23
3981
ff78dd8e198a Fix 'make checkheaders', based on a patch by Diego Petten, flameeyes gmail com.
diego
parents: 3852
diff changeset
24 #include <stdint.h>
4059
59db9e761b38 Move declaration of av_set_program_name and av_program_add_stream_index
diego
parents: 3981
diff changeset
25 #include "avformat.h"
3981
ff78dd8e198a Fix 'make checkheaders', based on a patch by Diego Petten, flameeyes gmail com.
diego
parents: 3852
diff changeset
26
6390
27242bd0812c Move the definition of the maximum url size for static buffers to internal.h
mstorsjo
parents: 6389
diff changeset
27 #define MAX_URL_SIZE 4096
27242bd0812c Move the definition of the maximum url size for static buffers to internal.h
mstorsjo
parents: 6389
diff changeset
28
6033
c7b98381ec2d Move AVCodecTag from riff.h into internal.h.
cehoyos
parents: 6024
diff changeset
29 typedef struct AVCodecTag {
c7b98381ec2d Move AVCodecTag from riff.h into internal.h.
cehoyos
parents: 6024
diff changeset
30 enum CodecID id;
c7b98381ec2d Move AVCodecTag from riff.h into internal.h.
cehoyos
parents: 6024
diff changeset
31 unsigned int tag;
c7b98381ec2d Move AVCodecTag from riff.h into internal.h.
cehoyos
parents: 6024
diff changeset
32 } AVCodecTag;
c7b98381ec2d Move AVCodecTag from riff.h into internal.h.
cehoyos
parents: 6024
diff changeset
33
5946
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
34 void ff_dynarray_add(intptr_t **tab_ptr, int *nb_ptr, intptr_t elem);
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
35
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
36 #ifdef __GNUC__
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
37 #define dynarray_add(tab, nb_ptr, elem)\
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
38 do {\
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
39 __typeof__(tab) _tab = (tab);\
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
40 __typeof__(elem) _elem = (elem);\
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
41 (void)sizeof(**_tab == _elem); /* check that types are compatible */\
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
42 ff_dynarray_add((intptr_t **)_tab, nb_ptr, (intptr_t)_elem);\
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
43 } while(0)
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
44 #else
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
45 #define dynarray_add(tab, nb_ptr, elem)\
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
46 do {\
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
47 ff_dynarray_add((intptr_t **)(tab), nb_ptr, (intptr_t)(elem));\
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
48 } while(0)
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
49 #endif
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
50
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
51 time_t mktimegm(struct tm *tm);
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
52 struct tm *brktimegm(time_t secs, struct tm *tm);
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
53 const char *small_strptime(const char *p, const char *fmt,
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
54 struct tm *dt);
28ca2d77f997 Move the internal function declarations in avformat.h to internal.h.
stefano
parents: 5883
diff changeset
55
5883
fd37c39041cd Add a lowercase parameter to ff_data_to_hex
mstorsjo
parents: 5853
diff changeset
56 char *ff_data_to_hex(char *buf, const uint8_t *src, int size, int lowercase);
3788
ca6df1ecb412 Export data_to_hex() as private API in lavf, rename to ff_data_to_hex() and
rbultje
parents:
diff changeset
57
6353
3f938b3a355a Make hex_to_data a lavf internal function
mstorsjo
parents: 6302
diff changeset
58 /**
3f938b3a355a Make hex_to_data a lavf internal function
mstorsjo
parents: 6302
diff changeset
59 * Parse a string of hexadecimal strings. Any space between the hexadecimal
3f938b3a355a Make hex_to_data a lavf internal function
mstorsjo
parents: 6302
diff changeset
60 * digits is ignored.
3f938b3a355a Make hex_to_data a lavf internal function
mstorsjo
parents: 6302
diff changeset
61 *
3f938b3a355a Make hex_to_data a lavf internal function
mstorsjo
parents: 6302
diff changeset
62 * @param data if non-null, the parsed data is written to this pointer
3f938b3a355a Make hex_to_data a lavf internal function
mstorsjo
parents: 6302
diff changeset
63 * @param p the string to parse
3f938b3a355a Make hex_to_data a lavf internal function
mstorsjo
parents: 6302
diff changeset
64 * @return the number of bytes written (or to be written, if data is null)
3f938b3a355a Make hex_to_data a lavf internal function
mstorsjo
parents: 6302
diff changeset
65 */
3f938b3a355a Make hex_to_data a lavf internal function
mstorsjo
parents: 6302
diff changeset
66 int ff_hex_to_data(uint8_t *data, const char *p);
3f938b3a355a Make hex_to_data a lavf internal function
mstorsjo
parents: 6302
diff changeset
67
5852
36b46032fad5 rename av_program_add_stream_index to ff_program_add_stream_index
aurel
parents: 5841
diff changeset
68 void ff_program_add_stream_index(AVFormatContext *ac, int progid, unsigned int idx);
4059
59db9e761b38 Move declaration of av_set_program_name and av_program_add_stream_index
diego
parents: 3981
diff changeset
69
4418
d5119d75439d Move declaration of ff_interleave_add_packet to internal.h.
bcoudurier
parents: 4059
diff changeset
70 /**
d5119d75439d Move declaration of ff_interleave_add_packet to internal.h.
bcoudurier
parents: 4059
diff changeset
71 * Add packet to AVFormatContext->packet_buffer list, determining its
d5119d75439d Move declaration of ff_interleave_add_packet to internal.h.
bcoudurier
parents: 4059
diff changeset
72 * interleaved position using compare() function argument.
d5119d75439d Move declaration of ff_interleave_add_packet to internal.h.
bcoudurier
parents: 4059
diff changeset
73 */
d5119d75439d Move declaration of ff_interleave_add_packet to internal.h.
bcoudurier
parents: 4059
diff changeset
74 void ff_interleave_add_packet(AVFormatContext *s, AVPacket *pkt,
d5119d75439d Move declaration of ff_interleave_add_packet to internal.h.
bcoudurier
parents: 4059
diff changeset
75 int (*compare)(AVFormatContext *, AVPacket *, AVPacket *));
d5119d75439d Move declaration of ff_interleave_add_packet to internal.h.
bcoudurier
parents: 4059
diff changeset
76
5853
cf00e196666a rename av_read_frame_flush to ff_read_frame_flush
aurel
parents: 5852
diff changeset
77 void ff_read_frame_flush(AVFormatContext *s);
5761
058a0e362dbe Move av_read_frame_flush() prototype to lavf/internal.h
mru
parents: 4428
diff changeset
78
5841
ba41d3865253 Move the NTP offset definitions to internal.h
mstorsjo
parents: 5837
diff changeset
79 #define NTP_OFFSET 2208988800ULL
ba41d3865253 Move the NTP offset definitions to internal.h
mstorsjo
parents: 5837
diff changeset
80 #define NTP_OFFSET_US (NTP_OFFSET * 1000000ULL)
ba41d3865253 Move the NTP offset definitions to internal.h
mstorsjo
parents: 5837
diff changeset
81
6199
fa244b4fe683 Fix grammar errors in documentation
mru
parents: 6186
diff changeset
82 /** Get the current time since NTP epoch in microseconds. */
5807
f4ca0041b4f4 Make the ntp_time function available to other parts of libavformat, as ff_ntp_time
mstorsjo
parents: 5774
diff changeset
83 uint64_t ff_ntp_time(void);
f4ca0041b4f4 Make the ntp_time function available to other parts of libavformat, as ff_ntp_time
mstorsjo
parents: 5774
diff changeset
84
5836
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
85 /**
6199
fa244b4fe683 Fix grammar errors in documentation
mru
parents: 6186
diff changeset
86 * Probe a bytestream to determine the input format. Each time a probe returns
5836
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
87 * with a score that is too low, the probe buffer size is increased and another
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
88 * attempt is made. When the maximum probe size is reached, the input format
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
89 * with the highest score is returned.
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
90 *
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
91 * @param pb the bytestream to probe, it may be closed and opened again
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
92 * @param fmt the input format is put here
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
93 * @param filename the filename of the stream
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
94 * @param logctx the log context
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
95 * @param offset the offset within the bytestream to probe from
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
96 * @param max_probe_size the maximum probe buffer size (zero for default)
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
97 * @return 0 in case of success, a negative value corresponding to an
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
98 * AVERROR code otherwise
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
99 */
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
100 int ff_probe_input_buffer(ByteIOContext **pb, AVInputFormat **fmt,
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
101 const char *filename, void *logctx,
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
102 unsigned int offset, unsigned int max_probe_size);
2997c88028cd Move the probe loop from av_open_input_file() into its own method
stefano
parents: 5807
diff changeset
103
6182
4fc5e0e4e1cd Make ff_url_split() public
mru
parents: 6175
diff changeset
104 #if LIBAVFORMAT_VERSION_MAJOR < 53
5837
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
105 /**
6182
4fc5e0e4e1cd Make ff_url_split() public
mru
parents: 6175
diff changeset
106 * @deprecated use av_url_split() instead
5837
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
107 */
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
108 void ff_url_split(char *proto, int proto_size,
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
109 char *authorization, int authorization_size,
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
110 char *hostname, int hostname_size,
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
111 int *port_ptr,
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
112 char *path, int path_size,
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
113 const char *url);
6182
4fc5e0e4e1cd Make ff_url_split() public
mru
parents: 6175
diff changeset
114 #endif
5837
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
115
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
116 /**
6199
fa244b4fe683 Fix grammar errors in documentation
mru
parents: 6186
diff changeset
117 * Assemble a URL string from components. This is the reverse operation
6182
4fc5e0e4e1cd Make ff_url_split() public
mru
parents: 6175
diff changeset
118 * of av_url_split.
5837
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
119 *
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
120 * Note, this requires networking to be initialized, so the caller must
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
121 * ensure ff_network_init has been called.
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
122 *
6182
4fc5e0e4e1cd Make ff_url_split() public
mru
parents: 6175
diff changeset
123 * @see av_url_split
5837
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
124 *
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
125 * @param str the buffer to fill with the url
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
126 * @param size the size of the str buffer
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
127 * @param proto the protocol identifier, if null, the separator
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
128 * after the identifier is left out, too
6147
3877522243ec ff_url_join: Don't add any at-char if the auth is an empty string
mstorsjo
parents: 6033
diff changeset
129 * @param authorization an optional authorization string, may be null.
3877522243ec ff_url_join: Don't add any at-char if the auth is an empty string
mstorsjo
parents: 6033
diff changeset
130 * An empty string is treated the same as a null string.
5837
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
131 * @param hostname the host name string
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
132 * @param port the port number, left out from the string if negative
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
133 * @param fmt a generic format string for everything to add after the
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
134 * host/port, may be null
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
135 * @return the number of characters written to the destination buffer
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
136 */
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
137 int ff_url_join(char *str, int size, const char *proto,
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
138 const char *authorization, const char *hostname,
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
139 int port, const char *fmt, ...);
d605f589f0be move ff_url_split() and ff_url_join() declarations to internal.h
aurel
parents: 5836
diff changeset
140
6009
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
141 /**
6199
fa244b4fe683 Fix grammar errors in documentation
mru
parents: 6186
diff changeset
142 * Append the media-specific SDP fragment for the media stream c
6009
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
143 * to the buffer buff.
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
144 *
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
145 * Note, the buffer needs to be initialized, since it is appended to
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
146 * existing content.
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
147 *
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
148 * @param buff the buffer to append the SDP fragment to
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
149 * @param size the size of the buff buffer
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
150 * @param c the AVCodecContext of the media to describe
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
151 * @param dest_addr the destination address of the media stream, may be NULL
6405
1f6088eaa469 Properly handle IPv6 addresses in the SDP generation
mstorsjo
parents: 6390
diff changeset
152 * @param dest_type the destination address type, may be NULL
6009
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
153 * @param port the destination port of the media stream, 0 if unknown
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
154 * @param ttl the time to live of the stream, 0 if not multicast
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
155 */
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
156 void ff_sdp_write_media(char *buff, int size, AVCodecContext *c,
6405
1f6088eaa469 Properly handle IPv6 addresses in the SDP generation
mstorsjo
parents: 6390
diff changeset
157 const char *dest_addr, const char *dest_type,
1f6088eaa469 Properly handle IPv6 addresses in the SDP generation
mstorsjo
parents: 6390
diff changeset
158 int port, int ttl);
6009
b740f4918397 Make ff_sdp_write_media a lavf-internal function
mstorsjo
parents: 5946
diff changeset
159
6024
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
160 /**
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
161 * Write a packet to another muxer than the one the user originally
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
162 * intended. Useful when chaining muxers, where one muxer internally
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
163 * writes a received packet to another muxer.
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
164 *
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
165 * @param dst the muxer to write the packet to
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
166 * @param dst_stream the stream index within dst to write the packet to
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
167 * @param pkt the packet to be written
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
168 * @param src the muxer the packet originally was intended for
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
169 * @return the value av_write_frame returned
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
170 */
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
171 int ff_write_chained(AVFormatContext *dst, int dst_stream, AVPacket *pkt,
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
172 AVFormatContext *src);
ee42a04b24f2 Add a libavformat internal function ff_write_chained
mstorsjo
parents: 6009
diff changeset
173
6246
79fc252c65cd move ff_get_v_length and ff_put_v from nutenc.c to internal.h/aviobuf.c
janne
parents: 6199
diff changeset
174 /**
79fc252c65cd move ff_get_v_length and ff_put_v from nutenc.c to internal.h/aviobuf.c
janne
parents: 6199
diff changeset
175 * Get the length in bytes which is needed to store val as v.
79fc252c65cd move ff_get_v_length and ff_put_v from nutenc.c to internal.h/aviobuf.c
janne
parents: 6199
diff changeset
176 */
79fc252c65cd move ff_get_v_length and ff_put_v from nutenc.c to internal.h/aviobuf.c
janne
parents: 6199
diff changeset
177 int ff_get_v_length(uint64_t val);
79fc252c65cd move ff_get_v_length and ff_put_v from nutenc.c to internal.h/aviobuf.c
janne
parents: 6199
diff changeset
178
79fc252c65cd move ff_get_v_length and ff_put_v from nutenc.c to internal.h/aviobuf.c
janne
parents: 6199
diff changeset
179 /**
79fc252c65cd move ff_get_v_length and ff_put_v from nutenc.c to internal.h/aviobuf.c
janne
parents: 6199
diff changeset
180 * Put val using a variable number of bytes.
79fc252c65cd move ff_get_v_length and ff_put_v from nutenc.c to internal.h/aviobuf.c
janne
parents: 6199
diff changeset
181 */
79fc252c65cd move ff_get_v_length and ff_put_v from nutenc.c to internal.h/aviobuf.c
janne
parents: 6199
diff changeset
182 void ff_put_v(ByteIOContext *bc, uint64_t val);
79fc252c65cd move ff_get_v_length and ff_put_v from nutenc.c to internal.h/aviobuf.c
janne
parents: 6199
diff changeset
183
6302
869753e625c4 document ff_get_line()
aurel
parents: 6301
diff changeset
184 /**
869753e625c4 document ff_get_line()
aurel
parents: 6301
diff changeset
185 * Read a whole line of text from ByteIOContext. Stop reading after reaching
869753e625c4 document ff_get_line()
aurel
parents: 6301
diff changeset
186 * either a \n, a \0 or EOF. The returned string is always \0 terminated,
869753e625c4 document ff_get_line()
aurel
parents: 6301
diff changeset
187 * and may be truncated if the buffer is too small.
869753e625c4 document ff_get_line()
aurel
parents: 6301
diff changeset
188 *
869753e625c4 document ff_get_line()
aurel
parents: 6301
diff changeset
189 * @param s the read-only ByteIOContext
869753e625c4 document ff_get_line()
aurel
parents: 6301
diff changeset
190 * @param buf buffer to store the read line
869753e625c4 document ff_get_line()
aurel
parents: 6301
diff changeset
191 * @param maxlen size of the buffer
869753e625c4 document ff_get_line()
aurel
parents: 6301
diff changeset
192 * @return the length of the string written in the buffer, not including the
869753e625c4 document ff_get_line()
aurel
parents: 6301
diff changeset
193 * final \0
869753e625c4 document ff_get_line()
aurel
parents: 6301
diff changeset
194 */
6301
1b2b5dbcf549 improve ff_get_line to return line length
aurel
parents: 6300
diff changeset
195 int ff_get_line(ByteIOContext *s, char *buf, int maxlen);
6300
e62d23b0547d move ff_get_line to aviobuf.c
aurel
parents: 6262
diff changeset
196
6262
7b8b71ff9a76 Move SPACE_CHARS back to libavformat/internal.h
mstorsjo
parents: 6246
diff changeset
197 #define SPACE_CHARS " \t\r\n"
7b8b71ff9a76 Move SPACE_CHARS back to libavformat/internal.h
mstorsjo
parents: 6246
diff changeset
198
6389
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
199 /**
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
200 * Callback function type for ff_parse_key_value.
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
201 *
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
202 * @param key a pointer to the key
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
203 * @param key_len the number of bytes that belong to the key, including the '='
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
204 * char
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
205 * @param dest return the destination pointer for the value in *dest, may
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
206 * be null to ignore the value
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
207 * @param dest_len the length of the *dest buffer
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
208 */
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
209 typedef void (*ff_parse_key_val_cb)(void *context, const char *key,
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
210 int key_len, char **dest, int *dest_len);
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
211 /**
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
212 * Parse a string with comma-separated key=value pairs. The value strings
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
213 * may be quoted and may contain escaped characters within quoted strings.
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
214 *
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
215 * @param str the string to parse
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
216 * @param callback_get_buf function that returns where to store the
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
217 * unescaped value string.
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
218 * @param context the opaque context pointer to pass to callback_get_buf
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
219 */
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
220 void ff_parse_key_value(const char *str, ff_parse_key_val_cb callback_get_buf,
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
221 void *context);
054de75e4a49 Make parse_key_value from httpauth a common lavf internal function
mstorsjo
parents: 6353
diff changeset
222
3852
1b6245500d8c Globally rename the header inclusion guard names.
stefano
parents: 3788
diff changeset
223 #endif /* AVFORMAT_INTERNAL_H */