xine-lib  1.2.9
mpeg2.h
Go to the documentation of this file.
1 /*
2  * mpeg2.h
3  * Copyright (C) 1999-2001 Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
4  *
5  * This file is part of mpeg2dec, a free MPEG-2 video stream decoder.
6  *
7  * mpeg2dec is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 2 of the License, or
10  * (at your option) any later version.
11  *
12  * mpeg2dec 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
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20  */
21 
22 /* Structure for the mpeg2dec decoder */
23 
24 #ifndef MPEG2_H
25 #define MPEG2_H
26 
27 #include "libmpeg2_accel.h"
28 
29 typedef struct mpeg2dec_s {
31  uint32_t frame_format;
32 
33  /* this is where we keep the state of the decoder */
34  struct picture_s * picture;
35 
36  uint32_t shift;
41  int in_slice;
43 
44  /* the maximum chunk size is determined by vbv_buffer_size */
45  /* which is 224K for MP@ML streams. */
46  /* (we make no pretenses of decoding anything more than that) */
47  /* allocated in init - gcc has problems allocating such big structures */
48  uint8_t * chunk_buffer;
49  /* pointer to current position in chunk_buffer */
50  uint8_t * chunk_ptr;
51  /* last start code ? */
52  uint8_t code;
53  uint32_t chunk_size;
54 
55  int64_t pts;
56  uint32_t rff_pattern;
59 
60  /* AFD data can be found after a sequence, group or picture start code */
61  /* and will be stored in afd_value_seen. Later it will be transfered to */
62  /* a stream property and stored into afd_value_reported to detect changes */
65 
67 
68  /* a spu decoder for possible closed captions */
71 
72 } mpeg2dec_t ;
73 
74 
75 /* initialize mpegdec with a opaque user pointer */
76 void mpeg2_init (mpeg2dec_t * mpeg2dec,
77  xine_video_port_t * output);
78 
79 /* destroy everything which was allocated, shutdown the output */
80 void mpeg2_close (mpeg2dec_t * mpeg2dec);
81 
82 int mpeg2_decode_data (mpeg2dec_t * mpeg2dec,
83  uint8_t * data_start, uint8_t * data_end,
84  uint64_t pts);
85 
86 void mpeg2_find_sequence_header (mpeg2dec_t * mpeg2dec,
87  uint8_t * data_start, uint8_t * data_end);
88 
89 void mpeg2_flush (mpeg2dec_t * mpeg2dec);
90 void mpeg2_reset (mpeg2dec_t * mpeg2dec);
91 void mpeg2_discontinuity (mpeg2dec_t * mpeg2dec);
92 
93 /* Not needed, it is defined as static in decode.c, and no-one else called it
94  * currently
95  */
96 /* void process_userdata(mpeg2dec_t *mpeg2dec, uint8_t *buffer); */
97 
98 #endif
int force_pan_scan
Definition: mpeg2.h:58
void mpeg2_reset(mpeg2dec_t *mpeg2dec)
Definition: decode.c:747
int mpeg2_decode_data(mpeg2dec_t *mpeg2dec, uint8_t *data_start, uint8_t *data_end, uint64_t pts)
Definition: decode.c:697
int afd_value_reported
Definition: mpeg2.h:64
int drop_frame
Definition: mpeg2.h:40
spu_decoder_t * cc_dec
Definition: mpeg2.h:69
struct picture_s * picture
Definition: mpeg2.h:34
uint8_t code
Definition: mpeg2.h:52
struct mpeg2dec_s mpeg2dec_t
int force_aspect
Definition: mpeg2.h:57
Definition: libmpeg2_accel.h:32
Definition: mpeg2_internal.h:68
int afd_value_seen
Definition: mpeg2.h:63
uint32_t chunk_size
Definition: mpeg2.h:53
int is_wait_for_ip_frames
Definition: mpeg2.h:39
uint32_t frame_format
Definition: mpeg2.h:31
int seek_mode
Definition: mpeg2.h:42
Definition: mpeg2.h:29
Definition: spu_decoder.h:75
uint32_t rff_pattern
Definition: mpeg2.h:56
void mpeg2_find_sequence_header(mpeg2dec_t *mpeg2dec, uint8_t *data_start, uint8_t *data_end)
Definition: decode.c:877
Definition: xine_internal.h:210
uint32_t shift
Definition: mpeg2.h:36
void mpeg2_flush(mpeg2dec_t *mpeg2dec)
Definition: decode.c:795
Definition: video_out.h:177
int in_slice
Definition: mpeg2.h:41
void mpeg2_close(mpeg2dec_t *mpeg2dec)
Definition: decode.c:817
uint8_t * chunk_ptr
Definition: mpeg2.h:50
void mpeg2_discontinuity(mpeg2dec_t *mpeg2dec)
Definition: decode.c:729
void mpeg2_init(mpeg2dec_t *mpeg2dec, xine_video_port_t *output)
Definition: decode.c:57
int frames_to_drop
Definition: mpeg2.h:40
mpeg2dec_accel_t accel
Definition: mpeg2.h:70
int is_sequence_needed
Definition: mpeg2.h:38
int64_t pts
Definition: mpeg2.h:55
xine_stream_t * stream
Definition: mpeg2.h:66
int new_sequence
Definition: mpeg2.h:37
uint8_t * chunk_buffer
Definition: mpeg2.h:48
int is_frame_needed
Definition: mpeg2.h:42
xine_video_port_t * output
Definition: mpeg2.h:30