annotate xiph.h @ 5707:c46509aca422 libavcodec

Remove check for input buffer size as it does not guarantee that decoder will not run out of output buffer bounds (and all suspected decoders have their own checks now).
author kostya
date Mon, 24 Sep 2007 16:50:32 +0000
parents 3fd46e281bd8
children 1d83e9c34641
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4722
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
1 /*
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
2 * Copyright (C) 2007 FFmpeg Project
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
3 *
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
4 * This file is part of FFmpeg.
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
5 *
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
6 * FFmpeg is free software; you can redistribute it and/or
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
7 * modify it under the terms of the GNU Lesser General Public
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
8 * License as published by the Free Software Foundation; either
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
9 * version 2.1 of the License, or (at your option) any later version.
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
10 *
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
11 * FFmpeg is distributed in the hope that it will be useful,
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
14 * Lesser General Public License for more details.
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
15 *
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
16 * You should have received a copy of the GNU Lesser General Public
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
17 * License along with FFmpeg; if not, write to the Free Software
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
19 */
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
20
5163
9ecbfc0c82bf add multiple inclusion guards to headers
mru
parents: 4722
diff changeset
21 #ifndef AVCODEC_XIPH_H
9ecbfc0c82bf add multiple inclusion guards to headers
mru
parents: 4722
diff changeset
22 #define AVCODEC_XIPH_H
9ecbfc0c82bf add multiple inclusion guards to headers
mru
parents: 4722
diff changeset
23
4722
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
24 #include "common.h"
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
25
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
26 /**
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
27 * Splits a single extradata buffer into the three headers that most
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
28 * Xiph codecs use. (e.g. Theora and Vorbis)
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
29 * Works both with Matroska's packing and lavc's packing.
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
30 *
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
31 * @param[in] extradata The single chunk that combines all three headers
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
32 * @param[in] extradata_size The size of the extradata buffer
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
33 * @param[in] first_header_size The size of the first header, used to
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
34 * differentiate between the Matroska packing and lavc packing.
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
35 * @param[out] header_start Pointers to the start of the three separate headers.
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
36 * @param[out] header_len The sizes of each of the three headers.
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
37 * @return On error a negative value is returned, on success zero.
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
38 */
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
39 int ff_split_xiph_headers(uint8_t *extradata, int extradata_size,
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
40 int first_header_size, uint8_t *header_start[3],
7595ead28402 extract vorbis header spliting code into a reusable function
aurel
parents:
diff changeset
41 int header_len[3]);
5163
9ecbfc0c82bf add multiple inclusion guards to headers
mru
parents: 4722
diff changeset
42
5169
3fd46e281bd8 add a comment to indicate which #endif belong to which #define
gpoirier
parents: 5163
diff changeset
43 #endif // AVCODEC_XIPH_H