source: trunk/bitstream_info.h @ 1223

Revision 1223, 2.3 KB checked in by astrange, 5 years ago (diff)

Don't consider MPEG-4 N-VOPs to be a parse error.

Fixes some false warnings and corruption in some divx/xvid files.
Closes #302.

Line 
1/*
2 * bitstream_info.h
3 * Created by Graham Booker on 1/6/07.
4 *
5 * This file is part of Perian.
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22#include <AudioToolbox/AudioToolbox.h>
23#include <QuickTime/QuickTime.h>
24
25#ifdef __cplusplus
26extern "C" {
27#endif
28
29int parse_ac3_bitstream(AudioStreamBasicDescription *asbd, AudioChannelLayout *acl, uint8_t *buffer, int buff_size);
30
31typedef struct FFusionParserContext
32{
33        struct AVCodecParserContext     *pc;
34        struct AVCodecContext   *avctx;
35        struct FFusionParser    *parserStructure;
36        void                                    *internalContext;
37} FFusionParserContext;
38       
39typedef struct FFusionParser
40{
41        struct AVCodecParser *avparse;
42        int internalContextSize;
43        int (*init)(FFusionParserContext *parser);
44        int (*extra_data)(FFusionParserContext *parser,
45                                          const uint8_t *buf, int buf_size);
46        int (*parser_parse)(FFusionParserContext *parser,
47                                                const uint8_t *buf, int buf_size,
48                                                int *out_buf_size,
49                                                int *type, int *skippable, int *skipped);
50        struct FFusionParser *next;
51} FFusionParser;
52
53typedef enum {
54        FFUSION_CANNOT_DECODE,
55        FFUSION_PREFER_NOT_DECODE,
56        FFUSION_PREFER_DECODE,
57} FFusionDecodeAbilities;
58
59void initFFusionParsers();
60FFusionParserContext *ffusionParserInit(int codec_id);
61void ffusionParserFree(FFusionParserContext *parser);
62int ffusionParseExtraData(FFusionParserContext *parser, const uint8_t *buf, int buf_size);
63int ffusionParse(FFusionParserContext *parser, const uint8_t *buf, int buf_size, int *out_buf_size, int *type, int *skippable, int *skipped);
64void ffusionLogDebugInfo(FFusionParserContext *parser, FILE *log);
65FFusionDecodeAbilities ffusionIsParsedVideoDecodable(FFusionParserContext *parser);
66
67#ifdef __cplusplus
68}
69#endif
Note: See TracBrowser for help on using the repository browser.