xine-lib: xine-lib-1.2.12/src/combined/ffmpeg/ff_mpeg_parser.h Source File

xine-lib 1.2.12

ff_mpeg_parser.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2001-2018 the xine project
3 *
4 * This file is part of xine, a free video player.
5 *
6 * xine is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * xine is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 *
20 * Simple MPEG-ES parser/framer by Thibaut Mattern (tmattern@noos.fr)
21 * based on libmpeg2 decoder.
22 */
23#ifndef HAVE_MPEG_PARSER_H
24#define HAVE_MPEG_PARSER_H
25/*
26#define DEBUG_MPEG_PARSER
27*/
28#include <stdint.h>
29#include <stddef.h>
30
31 typedef struct mpeg_parser_s {
32 uint8_t *chunk_buffer;
33 uint8_t *chunk_ptr;
34 uint8_t *chunk_start;
35 uint32_t shift;
36 int buffer_size;
37 uint8_t code;
38 uint8_t picture_coding_type;
39
40 uint8_t is_sequence_needed:1;
41 uint8_t is_mpeg1:1; /* public */
42 uint8_t has_sequence:1; /* public */
43 uint8_t in_slice:1;
44
45 uint8_t rate_code:4;
46
47 int aspect_ratio_info;
48
49 /* public properties */
50 uint16_t width;
51 uint16_t height;
52 int frame_duration;
53 double frame_aspect_ratio;
54
55} mpeg_parser_t;
56
57/* parser initialization */
58void mpeg_parser_init (mpeg_parser_t *parser, size_t padding_size);
59
60/* parser disposal */
61void mpeg_parser_dispose (mpeg_parser_t *parser);
62
63/* read a frame
64 * return a pointer to the first byte of the next frame
65 * or NULL if more bytes are needed
66 * *flush is set to 1 if the decoder must be flushed (needed for still menus)
67 */
68uint8_t *mpeg_parser_decode_data (mpeg_parser_t *parser,
69 uint8_t *current, uint8_t *end,
70 int *flush);
71
72/* reset the parser */
73void mpeg_parser_reset (mpeg_parser_t *parser);
74
75#endif /* HAVE_MPEG_PARSER_H */
mpeg_parser_t
struct mpeg_parser_s mpeg_parser_t
mpeg_parser_decode_data
uint8_t * mpeg_parser_decode_data(mpeg_parser_t *parser, uint8_t *current, uint8_t *end, int *flush)
Definition: ff_mpeg_parser.c:307
mpeg_parser_init
void mpeg_parser_init(mpeg_parser_t *parser, size_t padding_size)
Definition: ff_mpeg_parser.c:69
mpeg_parser_reset
void mpeg_parser_reset(mpeg_parser_t *parser)
Definition: ff_mpeg_parser.c:82
mpeg_parser_dispose
void mpeg_parser_dispose(mpeg_parser_t *parser)
Definition: ff_mpeg_parser.c:75
mpeg_parser_s
Definition: ff_mpeg_parser.h:31
mpeg_parser_s::chunk_ptr
uint8_t * chunk_ptr
Definition: ff_mpeg_parser.h:33
mpeg_parser_s::chunk_start
uint8_t * chunk_start
Definition: ff_mpeg_parser.h:34
mpeg_parser_s::code
uint8_t code
Definition: ff_mpeg_parser.h:37
mpeg_parser_s::shift
uint32_t shift
Definition: ff_mpeg_parser.h:35
mpeg_parser_s::is_sequence_needed
uint8_t is_sequence_needed
Definition: ff_mpeg_parser.h:40
mpeg_parser_s::frame_aspect_ratio
double frame_aspect_ratio
Definition: ff_mpeg_parser.h:53
mpeg_parser_s::aspect_ratio_info
int aspect_ratio_info
Definition: ff_mpeg_parser.h:47
mpeg_parser_s::width
uint16_t width
Definition: ff_mpeg_parser.h:50
mpeg_parser_s::has_sequence
uint8_t has_sequence
Definition: ff_mpeg_parser.h:42
mpeg_parser_s::frame_duration
int frame_duration
Definition: ff_mpeg_parser.h:52
mpeg_parser_s::height
uint16_t height
Definition: ff_mpeg_parser.h:51
mpeg_parser_s::chunk_buffer
uint8_t * chunk_buffer
Definition: ff_mpeg_parser.h:32
mpeg_parser_s::is_mpeg1
uint8_t is_mpeg1
Definition: ff_mpeg_parser.h:41
mpeg_parser_s::buffer_size
int buffer_size
Definition: ff_mpeg_parser.h:36
mpeg_parser_s::picture_coding_type
uint8_t picture_coding_type
Definition: ff_mpeg_parser.h:38
mpeg_parser_s::rate_code
uint8_t rate_code
Definition: ff_mpeg_parser.h:45
mpeg_parser_s::in_slice
uint8_t in_slice
Definition: ff_mpeg_parser.h:43