xbmc
dvdnav_events.h
1 /*
2  * Copyright (C) 2001 Rich Wareham <richwareham@users.sourceforge.net>
3  *
4  * This file is part of libdvdnav, a DVD navigation library.
5  *
6  * libdvdnav 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  * libdvdnav 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 along
17  * with libdvdnav; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  */
20 
21 /*
22  * This header defines events and event types
23  */
24 
25 #pragma once
26 
27 /*
28  * DVDNAV_BLOCK_OK
29  *
30  * A regular data block from the DVD has been returned.
31  * This one should be demuxed and decoded for playback.
32  */
33 #define DVDNAV_BLOCK_OK 0
34 
35 /*
36  * DVDNAV_NOP
37  *
38  * Just ignore this.
39  */
40 #define DVDNAV_NOP 1
41 
42 /*
43  * DVDNAV_STILL_FRAME
44  *
45  * We have reached a still frame. The player application should wait
46  * the amount of time specified by the still's length while still handling
47  * user input to make menus and other interactive stills work.
48  * The last delivered frame should be kept showing.
49  * Once the still has timed out, call dvdnav_skip_still().
50  * A length of 0xff means an infinite still which has to be skipped
51  * indirectly by some user interaction.
52  */
53 #define DVDNAV_STILL_FRAME 2
54 
55 typedef struct {
56  /* The length (in seconds) the still frame should be displayed for,
57  * or 0xff if infinite. */
58  int length;
60 
61 
62 /*
63  * DVDNAV_SPU_STREAM_CHANGE
64  *
65  * Inform the SPU decoding/overlaying engine to switch SPU channels.
66  */
67 #define DVDNAV_SPU_STREAM_CHANGE 3
68 
69 typedef struct {
70  /* The physical (MPEG) stream number for widescreen SPU display.
71  * Use this, if you blend the SPU on an anamorphic image before
72  * unsqueezing it. */
73  int physical_wide;
74 
75  /* The physical (MPEG) stream number for letterboxed display.
76  * Use this, if you blend the SPU on an anamorphic image after
77  * unsqueezing it. */
78  int physical_letterbox;
79 
80  /* The physical (MPEG) stream number for pan&scan display.
81  * Use this, if you blend the SPU on an anamorphic image after
82  * unsqueezing it the pan&scan way. */
83  int physical_pan_scan;
84 
85  /* The logical (DVD) stream number. */
86  int logical;
88 
89 
90 /*
91  * DVDNAV_AUDIO_STREAM_CHANGE
92  *
93  * Inform the audio decoder to switch channels.
94  */
95 #define DVDNAV_AUDIO_STREAM_CHANGE 4
96 
97 typedef struct {
98  /* The physical (MPEG) stream number. */
99  int physical;
100 
101  /* The logical (DVD) stream number. */
102  int logical;
104 
105 
106 /*
107  * DVDNAV_VTS_CHANGE
108  *
109  * Some status information like video aspect and video scale permissions do
110  * not change inside a VTS. Therefore this event can be used to query such
111  * information only when necessary and update the decoding/displaying
112  * accordingly.
113  */
114 #define DVDNAV_VTS_CHANGE 5
115 
116 typedef struct {
117  int old_vtsN; /* the old VTS number */
118  DVDDomain_t old_domain; /* the old domain */
119  int new_vtsN; /* the new VTS number */
120  DVDDomain_t new_domain; /* the new domain */
122 
123 
124 /*
125  * DVDNAV_CELL_CHANGE
126  *
127  * Some status information like the current Title and Part numbers do not
128  * change inside a cell. Therefore this event can be used to query such
129  * information only when necessary and update the decoding/displaying
130  * accordingly.
131  * Some useful information for accurate time display is also reported
132  * together with this event.
133  */
134 #define DVDNAV_CELL_CHANGE 6
135 
136 typedef struct {
137  int cellN; /* the new cell number */
138  int pgN; /* the current program number */
139  int64_t cell_length; /* the length of the current cell in sectors */
140  int64_t pg_length; /* the length of the current program in sectors */
141  int64_t pgc_length; /* the length of the current program chain in PTS ticks */
142  int64_t cell_start; /* the start offset of the current cell relatively to the PGC in sectors */
143  int64_t pg_start; /* the start offset of the current PG relatively to the PGC in sectors */
145 
146 
147 /*
148  * DVDNAV_NAV_PACKET
149  *
150  * NAV packets are useful for various purposes. They define the button
151  * highlight areas and VM commands of DVD menus, so they should in any
152  * case be sent to the SPU decoder/overlaying engine for the menus to work.
153  * NAV packets also provide a way to detect PTS discontinuities, because
154  * they carry the start and end PTS values for the current VOBU.
155  * (pci.vobu_s_ptm and pci.vobu_e_ptm) Whenever the start PTS of the
156  * current NAV does not match the end PTS of the previous NAV, a PTS
157  * discontinuity has occurred.
158  * NAV packets can also be used for time display, because they are
159  * timestamped relatively to the current Cell.
160  */
161 #define DVDNAV_NAV_PACKET 7
162 
163 /*
164  * DVDNAV_STOP
165  *
166  * Applications should end playback here. A subsequent dvdnav_get_next_block()
167  * call will restart the VM from the beginning of the DVD.
168  */
169 #define DVDNAV_STOP 8
170 
171 /*
172  * DVDNAV_HIGHLIGHT
173  *
174  * The current button highlight changed. Inform the overlaying engine to
175  * highlight a different button. Please note, that at the moment only mode 1
176  * highlights are reported this way. That means, when the button highlight
177  * has been moved around by some function call, you will receive an event
178  * telling you the new button. But when a button gets activated, you have
179  * to handle the mode 2 highlighting (that is some different colour the
180  * button turns to on activation) in your application.
181  */
182 #define DVDNAV_HIGHLIGHT 9
183 
184 typedef struct {
185  /* highlight mode: 0 - hide, 1 - show, 2 - activate, currently always 1 */
186  int display;
187 
188  /* FIXME: these fields are currently not set */
189  uint32_t palette; /* The CLUT entries for the highlight palette
190  (4-bits per entry -> 4 entries) */
191  uint16_t sx,sy,ex,ey; /* The start/end x,y positions */
192  uint32_t pts; /* Highlight PTS to match with SPU */
193 
194  /* button number for the SPU decoder/overlaying engine */
195  uint32_t buttonN;
197 
198 
199 /*
200  * DVDNAV_SPU_CLUT_CHANGE
201  *
202  * Inform the SPU decoder/overlaying engine to update its colour lookup table.
203  * The CLUT is given as 16 uint32_t's in the buffer.
204  */
205 #define DVDNAV_SPU_CLUT_CHANGE 10
206 
207 /*
208  * DVDNAV_HOP_CHANNEL
209  *
210  * A non-seamless operation has been performed. Applications can drop all
211  * their internal fifo's content, which will speed up the response.
212  */
213 #define DVDNAV_HOP_CHANNEL 12
214 
215 /*
216  * DVDNAV_WAIT
217  *
218  * We have reached a point in DVD playback, where timing is critical.
219  * Player application with internal fifos can introduce state
220  * inconsistencies, because libdvdnav is always the fifo's length
221  * ahead in the stream compared to what the application sees.
222  * Such applications should wait until their fifos are empty
223  * when they receive this type of event.
224  * Once this is achieved, call dvdnav_skip_wait().
225  */
226 #define DVDNAV_WAIT 13
Definition: dvdnav_events.h:116
Definition: dvdnav_events.h:136
Definition: dvdnav_events.h:55
Definition: dvdnav_events.h:97
Definition: dvdnav_events.h:184
Definition: dvdnav_events.h:69