xine-lib: xine-lib-1.2.13/src/spu_dec/spudec.h Source File

xine-lib 1.2.13-20230125hg15249

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
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
60} spudec_clut_t;
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];
92} spudec_state_t;
93
94 typedef struct spudec_stream_state_s {
95 spudec_seq_t ra_seq;
96 spudec_state_t state;
97 int64_t vpts;
98 int64_t pts;
99 int32_t overlay_handle;
100} spudec_stream_state_t;
101
102 typedef struct pci_node_s pci_node_t;
103struct pci_node_s {
104 pci_t pci;
105 uint64_t vpts;
106 pci_node_t *next;
107};
108
109 typedef struct spudec_decoder_s {
110 spu_decoder_t spu_decoder;
111
112 xine_stream_t *stream;
113 spudec_stream_state_t spudec_stream_state[MAX_STREAMS];
114
115 video_overlay_event_t event;
116 video_overlay_object_t object;
117 int32_t menu_handle;
118
119 spudec_state_t state;
120
121 vo_overlay_t overlay;
122 int ovl_caps;
123 int output_open;
124 pthread_mutex_t nav_pci_lock;
125 pci_node_t pci_cur;
126 uint32_t buttonN; /* Current button number for highlights */
127 int32_t button_filter; /* Allow highlight changes or not */
128 int64_t last_event_vpts;
129} spudec_decoder_t;
130
131 void 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 */
134void spudec_decode_nav( spudec_decoder_t *this, buf_element_t *buf);
135void spudec_clear_nav_list(spudec_decoder_t *this);
136void spudec_update_nav(spudec_decoder_t *this);
137void spudec_process_nav(spudec_decoder_t *this);
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
video_out.h
spudec_stream_state_t
struct spudec_stream_state_s spudec_stream_state_t
spudec_clear_nav_list
void spudec_clear_nav_list(spudec_decoder_t *this)
Definition spudec.c:274
spudec_process_nav
void spudec_process_nav(spudec_decoder_t *this)
Definition spudec.c:297
spudec_decoder_t
struct spudec_decoder_s spudec_decoder_t
MAX_STREAMS
#define MAX_STREAMS
Definition spudec.h:46
spudec_decode_nav
void spudec_decode_nav(spudec_decoder_t *this, buf_element_t *buf)
Definition spudec.c:85
spudec_process
void spudec_process(spudec_decoder_t *this, int stream_id)
Definition spudec.c:379
spudec_copy_nav_to_overlay
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
spudec_reassembly
void spudec_reassembly(xine_t *xine, spudec_seq_t *seq, uint8_t *pkt_data, unsigned pkt_len)
spudec_update_nav
void spudec_update_nav(spudec_decoder_t *this)
Definition spudec.c:285
spudec_clut_t
struct spudec_clut_struct spudec_clut_t
buf_element_s
Definition buffer.h:338
pci_node_s
Definition dxr3_decode_spu.c:93
pci_node_s::pci
pci_t pci
Definition dxr3_decode_spu.c:94
pci_node_s::vpts
uint64_t vpts
Definition dxr3_decode_spu.c:95
pci_node_s::next
pci_node_t * next
Definition dxr3_decode_spu.c:96
spu_decoder_s
Definition spu_decoder.h:74
spudec_clut_struct
Definition spudec.h:48
spudec_clut_struct::entry3
uint8_t entry3
Definition spudec.h:57
spudec_clut_struct::entry1
uint8_t entry1
Definition spudec.h:55
spudec_clut_struct::entry0
uint8_t entry0
Definition spudec.h:56
spudec_clut_struct::entry2
uint8_t entry2
Definition spudec.h:58
spudec_decoder_s
Definition spudec.h:109
spudec_decoder_s::ovl_caps
int ovl_caps
Definition spudec.h:122
spudec_decoder_s::menu_handle
int32_t menu_handle
Definition spudec.h:117
spudec_decoder_s::spu_decoder
spu_decoder_t spu_decoder
Definition spudec.h:110
spudec_decoder_s::nav_pci_lock
pthread_mutex_t nav_pci_lock
Definition spudec.h:124
spudec_decoder_s::spudec_stream_state
spudec_stream_state_t spudec_stream_state[32]
Definition spudec.h:113
spudec_decoder_s::overlay
vo_overlay_t overlay
Definition spudec.h:121
spudec_decoder_s::last_event_vpts
int64_t last_event_vpts
Definition spudec.h:128
spudec_decoder_s::stream
xine_stream_t * stream
Definition spudec.h:112
spudec_decoder_s::button_filter
int32_t button_filter
Definition spudec.h:127
spudec_decoder_s::state
spudec_state_t state
Definition spudec.h:119
spudec_decoder_s::buttonN
uint32_t buttonN
Definition spudec.h:126
spudec_decoder_s::object
video_overlay_object_t object
Definition spudec.h:116
spudec_decoder_s::event
video_overlay_event_t event
Definition spudec.h:115
spudec_decoder_s::pci_cur
pci_node_t pci_cur
Definition spudec.h:125
spudec_decoder_s::output_open
int output_open
Definition spudec.h:123
spudec_seq_t
Definition spudec.h:62
spudec_seq_t::ra_offs
uint32_t ra_offs
Definition spudec.h:64
spudec_seq_t::broken
uint32_t broken
Definition spudec.h:71
spudec_seq_t::buf
uint8_t * buf
Definition spudec.h:63
spudec_seq_t::complete
uint32_t complete
Definition spudec.h:70
spudec_seq_t::buf_len
uint32_t buf_len
Definition spudec.h:66
spudec_seq_t::pts
int64_t pts
Definition spudec.h:68
spudec_seq_t::finished
int32_t finished
Definition spudec.h:69
spudec_seq_t::cmd_offs
uint32_t cmd_offs
Definition spudec.h:67
spudec_seq_t::seq_len
uint32_t seq_len
Definition spudec.h:65
spudec_state_t
Definition spudec.h:74
spudec_state_t::vobsub
int32_t vobsub
Definition spudec.h:89
spudec_state_t::delay
int32_t delay
Definition spudec.h:86
spudec_state_t::visible
int32_t visible
Definition spudec.h:84
spudec_state_t::b_top
int32_t b_top
Definition spudec.h:78
spudec_state_t::modified
int32_t modified
Definition spudec.h:83
spudec_state_t::forced_display
int32_t forced_display
Definition spudec.h:85
spudec_state_t::cmd_ptr
uint8_t * cmd_ptr
Definition spudec.h:75
spudec_state_t::need_clut
int32_t need_clut
Definition spudec.h:87
spudec_state_t::b_bottom
int32_t b_bottom
Definition spudec.h:79
spudec_state_t::b_right
int32_t b_right
Definition spudec.h:81
spudec_state_t::b_left
int32_t b_left
Definition spudec.h:80
spudec_stream_state_s
Definition spudec.h:94
spudec_stream_state_s::vpts
int64_t vpts
Definition spudec.h:97
spudec_stream_state_s::ra_seq
spudec_seq_t ra_seq
Definition spudec.h:95
spudec_stream_state_s::pts
int64_t pts
Definition spudec.h:98
spudec_stream_state_s::state
spudec_state_t state
Definition spudec.h:96
spudec_stream_state_s::overlay_handle
int32_t overlay_handle
Definition spudec.h:99
video_overlay_event_s
Definition video_overlay.h:54
video_overlay_object_s
Definition video_overlay.h:44
vo_overlay_s
Definition video_out.h:495
xine_s
Definition xine_internal.h:80
xine_stream_s
Definition xine_internal.h:123
video_overlay.h
mode
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