xine-lib 1.2.11
spudec.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2000-2020 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#if defined(HAVE_CONFIG_H) && !defined(__XINE_LIB_CONFIG_H__)
29# error config.h not included
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
48typedef 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
62typedef 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 */
73
74typedef 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
94typedef struct spudec_stream_state_s {
97 int64_t vpts;
98 int64_t pts;
101
102typedef struct pci_node_s pci_node_t;
103struct pci_node_s {
104 pci_t pci;
105 uint64_t vpts;
107};
108
109typedef struct spudec_decoder_s {
111
114
117 int32_t menu_handle;
118
120
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
131void spudec_reassembly (xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, unsigned pkt_len);
132void spudec_process( spudec_decoder_t *this, int stream_id);
133/* the nav functions must be called with the nav_pci_lock held */
138int 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
struct spudec_stream_state_s spudec_stream_state_t
void spudec_clear_nav_list(spudec_decoder_t *this)
Definition: spudec.c:274
void spudec_process_nav(spudec_decoder_t *this)
Definition: spudec.c:297
struct spudec_decoder_s spudec_decoder_t
#define MAX_STREAMS
Definition: spudec.h:46
void spudec_decode_nav(spudec_decoder_t *this, buf_element_t *buf)
Definition: spudec.c:85
void spudec_process(spudec_decoder_t *this, int stream_id)
Definition: spudec.c:379
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:972
void spudec_reassembly(xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, unsigned pkt_len)
void spudec_update_nav(spudec_decoder_t *this)
Definition: spudec.c:285
struct spudec_clut_struct spudec_clut_t
Definition: buffer.h:338
Definition: dxr3_decode_spu.c:93
pci_t pci
Definition: dxr3_decode_spu.c:94
uint64_t vpts
Definition: dxr3_decode_spu.c:95
pci_node_t * next
Definition: dxr3_decode_spu.c:96
Definition: spu_decoder.h:74
Definition: spudec.h:48
uint8_t entry3
Definition: spudec.h:57
uint8_t entry1
Definition: spudec.h:55
uint8_t entry0
Definition: spudec.h:56
uint8_t entry2
Definition: spudec.h:58
Definition: spudec.h:109
int ovl_caps
Definition: spudec.h:122
int32_t menu_handle
Definition: spudec.h:117
spu_decoder_t spu_decoder
Definition: spudec.h:110
pthread_mutex_t nav_pci_lock
Definition: spudec.h:124
spudec_stream_state_t spudec_stream_state[32]
Definition: spudec.h:113
vo_overlay_t overlay
Definition: spudec.h:121
int64_t last_event_vpts
Definition: spudec.h:128
xine_stream_t * stream
Definition: spudec.h:112
int32_t button_filter
Definition: spudec.h:127
spudec_state_t state
Definition: spudec.h:119
uint32_t buttonN
Definition: spudec.h:126
video_overlay_object_t object
Definition: spudec.h:116
video_overlay_event_t event
Definition: spudec.h:115
pci_node_t pci_cur
Definition: spudec.h:125
int output_open
Definition: spudec.h:123
Definition: spudec.h:62
uint32_t ra_offs
Definition: spudec.h:64
uint32_t broken
Definition: spudec.h:71
uint8_t * buf
Definition: spudec.h:63
uint32_t complete
Definition: spudec.h:70
uint32_t buf_len
Definition: spudec.h:66
int64_t pts
Definition: spudec.h:68
int32_t finished
Definition: spudec.h:69
uint32_t cmd_offs
Definition: spudec.h:67
uint32_t seq_len
Definition: spudec.h:65
Definition: spudec.h:74
int32_t vobsub
Definition: spudec.h:89
int32_t delay
Definition: spudec.h:86
int32_t visible
Definition: spudec.h:84
int32_t b_top
Definition: spudec.h:78
int32_t modified
Definition: spudec.h:83
int32_t forced_display
Definition: spudec.h:85
uint8_t * cmd_ptr
Definition: spudec.h:75
int32_t need_clut
Definition: spudec.h:87
int32_t b_bottom
Definition: spudec.h:79
int32_t b_right
Definition: spudec.h:81
int32_t b_left
Definition: spudec.h:80
Definition: spudec.h:94
int64_t vpts
Definition: spudec.h:97
spudec_seq_t ra_seq
Definition: spudec.h:95
int64_t pts
Definition: spudec.h:98
spudec_state_t state
Definition: spudec.h:96
int32_t overlay_handle
Definition: spudec.h:99
Definition: video_overlay.h:54
Definition: video_overlay.h:44
Definition: video_out.h:472
Definition: xine_internal.h:80
Definition: xine_internal.h:123
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