xine-lib  1.2.9
spudec.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2000-2017 the xine project
3  *
4  * Copyright (C) James Courtier-Dutton James@superbug.demon.co.uk - July 2001
5  *
6  * This file is part of xine, a free video player.
7  *
8  * xine is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * xine is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
21  *
22  * This file was originally part of the OMS program.
23  */
24 
25 #ifndef __SPU_H__
26 #define __SPU_H__
27 
28 #ifdef HAVE_CONFIG_H
29 #include "config.h"
30 #endif
31 
32 #include <inttypes.h>
33 #include <xine/video_out.h>
34 #include <xine/video_overlay.h>
35 #ifdef HAVE_DVDNAV
36 # ifdef HAVE_DVDNAV_NAVTYPES_H
37 # include <dvdnav/nav_types.h>
38 # else
39 # include <dvdread/nav_types.h>
40 # endif
41 #else
42 # include "nav_types.h"
43 #endif
44 
45 #define NUM_SEQ_BUFFERS 50
46 #define MAX_STREAMS 32
47 
48 typedef struct spudec_clut_struct {
49 #ifdef WORDS_BIGENDIAN
50  uint8_t entry0 : 4;
51  uint8_t entry1 : 4;
52  uint8_t entry2 : 4;
53  uint8_t entry3 : 4;
54 #else
55  uint8_t entry1 : 4;
56  uint8_t entry0 : 4;
57  uint8_t entry3 : 4;
58  uint8_t entry2 : 4;
59 #endif
61 
62 typedef struct {
63  uint8_t *buf;
64  uint32_t ra_offs; /* reassembly offset */
65  uint32_t seq_len;
66  uint32_t buf_len;
67  uint32_t cmd_offs;
68  int64_t pts; /* Base PTS of this sequence */
69  int32_t finished; /* Has this control sequence been finished? */
70  uint32_t complete; /* Has this reassembly been finished? */
71  uint32_t broken; /* this SPU is broken and should be dropped */
72 } spudec_seq_t;
73 
74 typedef struct {
75  uint8_t *cmd_ptr;
76 
77  uint32_t field_offs[2];
78  int32_t b_top, o_top;
79  int32_t b_bottom, o_bottom;
80  int32_t b_left, o_left;
81  int32_t b_right, o_right;
82 
83  int32_t modified; /* Was the sub-picture modified? */
84  int32_t visible; /* Must the sub-picture be shown? */
85  int32_t forced_display; /* This overlay is a menu */
86  int32_t delay; /* Delay in 90Khz / 1000 */
87  int32_t need_clut; /* doesn't have the right clut yet */
88  int32_t cur_colors[4];/* current 4 colors been used */
89  int32_t vobsub; /* vobsub must be aligned to bottom */
90 
91  uint32_t clut[16];
93 
94 typedef struct spudec_stream_state_s {
97  int64_t vpts;
98  int64_t pts;
99  int32_t overlay_handle;
101 
102 typedef struct pci_node_s pci_node_t;
103 struct pci_node_s {
104  pci_t pci;
105  uint64_t vpts;
106  pci_node_t *next;
107 };
108 
109 typedef struct spudec_decoder_s {
111 
114 
117  int32_t menu_handle;
118 
120 
122  int ovl_caps;
124  pthread_mutex_t nav_pci_lock;
126  uint32_t buttonN; /* Current button number for highlights */
127  int32_t button_filter; /* Allow highlight changes or not */
130 
131 void spudec_reassembly (xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, unsigned pkt_len);
132 void spudec_process( spudec_decoder_t *this, int stream_id);
133 /* the nav functions must be called with the nav_pci_lock held */
138 int spudec_copy_nav_to_overlay(xine_t *xine, pci_t* nav_pci, uint32_t* clut, int32_t button, int32_t mode,
139  vo_overlay_t * overlay, vo_overlay_t * base );
140 
141 #endif
Definition: video_overlay.h:52
int32_t o_bottom
Definition: spudec.h:79
xine_stream_t * stream
Definition: spudec.h:112
spudec_seq_t ra_seq
Definition: spudec.h:95
int32_t forced_display
Definition: spudec.h:85
int32_t o_left
Definition: spudec.h:80
enable disable number of frames of telecine pattern sync required before mode change make frames evenly spaced for film mode(24 fps)" ) PARAM_ITEM( POST_PARAM_TYPE_BOOL
video_overlay_event_t event
Definition: spudec.h:115
uint8_t entry1
Definition: spudec.h:55
uint8_t entry2
Definition: spudec.h:58
int32_t o_right
Definition: spudec.h:81
Definition: video_out.h:476
int64_t pts
Definition: spudec.h:98
int32_t need_clut
Definition: spudec.h:87
int64_t pts
Definition: spudec.h:68
Definition: buffer.h:334
int output_open
Definition: spudec.h:123
#define MAX_STREAMS
Definition: spudec.h:46
void spudec_process_nav(spudec_decoder_t *this)
Definition: spudec.c:297
uint8_t entry3
Definition: spudec.h:57
spudec_state_t state
Definition: spudec.h:119
uint32_t buttonN
Definition: spudec.h:126
pci_t pci
Definition: dxr3_decode_spu.c:115
int64_t vpts
Definition: spudec.h:97
int32_t delay
Definition: spudec.h:86
spudec_state_t state
Definition: spudec.h:96
uint32_t buf_len
Definition: spudec.h:66
void spudec_reassembly(xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, unsigned pkt_len)
uint32_t cmd_offs
Definition: spudec.h:67
Definition: spudec.h:62
Definition: spudec.h:48
struct spudec_clut_struct spudec_clut_t
uint32_t broken
Definition: spudec.h:71
uint64_t vpts
Definition: dxr3_decode_spu.c:116
int32_t modified
Definition: spudec.h:83
int32_t button_filter
Definition: spudec.h:127
video_overlay_object_t object
Definition: spudec.h:116
Definition: spu_decoder.h:75
uint32_t complete
Definition: spudec.h:70
uint8_t * cmd_ptr
Definition: spudec.h:75
Definition: xine_internal.h:210
void spudec_decode_nav(spudec_decoder_t *this, buf_element_t *buf)
Definition: spudec.c:85
uint32_t ra_offs
Definition: spudec.h:64
int64_t last_event_vpts
Definition: spudec.h:128
Definition: spudec.h:94
void spudec_process(spudec_decoder_t *this, int stream_id)
Definition: spudec.c:379
Definition: video_overlay.h:42
int32_t vobsub
Definition: spudec.h:89
Definition: spudec.h:74
Definition: dxr3_decode_spu.c:114
uint8_t * buf
Definition: spudec.h:63
int ovl_caps
Definition: spudec.h:122
vo_overlay_t overlay
Definition: spudec.h:121
Definition: xine_internal.h:81
Definition: spudec.h:109
spu_decoder_t spu_decoder
Definition: spudec.h:110
int spudec_copy_nav_to_overlay(xine_t *xine, pci_t *nav_pci, uint32_t *clut, int32_t button, int32_t mode, vo_overlay_t *overlay, vo_overlay_t *base)
Definition: spudec.c:970
int32_t overlay_handle
Definition: spudec.h:99
struct spudec_stream_state_s spudec_stream_state_t
pci_node_t * next
Definition: dxr3_decode_spu.c:117
spudec_stream_state_t spudec_stream_state[32]
Definition: spudec.h:113
void spudec_update_nav(spudec_decoder_t *this)
Definition: spudec.c:285
void spudec_clear_nav_list(spudec_decoder_t *this)
Definition: spudec.c:274
uint32_t seq_len
Definition: spudec.h:65
int32_t o_top
Definition: spudec.h:78
pci_node_t pci_cur
Definition: spudec.h:125
uint8_t entry0
Definition: spudec.h:56
int32_t menu_handle
Definition: spudec.h:117
int32_t visible
Definition: spudec.h:84
int32_t finished
Definition: spudec.h:69
struct spudec_decoder_s spudec_decoder_t
pthread_mutex_t nav_pci_lock
Definition: spudec.h:124