00001 /* 00002 * Copyright (C) 2001 Rich Wareham <richwareham@users.sourceforge.net> 00003 * 00004 * This file is part of libdvdnav, a DVD navigation library. 00005 * 00006 * libdvdnav is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 2 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * libdvdnav is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with this program; if not, write to the Free Software 00018 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 00019 * 00020 * $Id: dvdnav_events.h,v 1.11 2003/04/07 18:10:48 mroi Exp $ 00021 * 00022 */ 00023 00024 /* 00025 * This header defines events and event types 00026 */ 00027 00028 #ifndef DVDNAV_EVENTS_H_INCLUDED 00029 #define DVDNAV_EVENTS_H_INCLUDED 00030 00031 #include "ifo_types.h" 00032 #include "dvd_reader.h" 00033 #include "nav_types.h" 00034 00035 00036 /* 00037 * DVDNAV_BLOCK_OK 00038 * 00039 * A regular data block from the DVD has been returned. 00040 * This one should be demuxed and decoded for playback. 00041 */ 00042 #define DVDNAV_BLOCK_OK 0 00043 00044 00045 /* 00046 * DVDNAV_NOP 00047 * 00048 * Just ignore this. 00049 */ 00050 #define DVDNAV_NOP 1 00051 00052 00053 /* 00054 * DVDNAV_STILL_FRAME 00055 * 00056 * We have reached a still frame. The player application should wait 00057 * the amount of time specified by the still's length while still handling 00058 * user input to make menus and other interactive stills work. 00059 * The last delivered frame should be kept showing. 00060 * Once the still has timed out, call dvdnav_skip_still(). 00061 * A length of 0xff means an infinite still which has to be skipped 00062 * indirectly by some user interaction. 00063 */ 00064 #define DVDNAV_STILL_FRAME 2 00065 00066 typedef struct { 00067 /* The length (in seconds) the still frame should be displayed for, 00068 * or 0xff if infinite. */ 00069 int length; 00070 } dvdnav_still_event_t; 00071 00072 00073 /* 00074 * DVDNAV_SPU_STREAM_CHANGE 00075 * 00076 * Inform the SPU decoding/overlaying engine to switch SPU channels. 00077 */ 00078 #define DVDNAV_SPU_STREAM_CHANGE 3 00079 00080 typedef struct { 00081 /* The physical (MPEG) stream number for widescreen SPU display. 00082 * Use this, if you blend the SPU on an anamorphic image before 00083 * unsqueezing it. */ 00084 int physical_wide; 00085 00086 /* The physical (MPEG) stream number for letterboxed display. 00087 * Use this, if you blend the SPU on an anamorphic image after 00088 * unsqueezing it. */ 00089 int physical_letterbox; 00090 00091 /* The physical (MPEG) stream number for pan&scan display. 00092 * Use this, if you blend the SPU on an anamorphic image after 00093 * unsqueezing it the pan&scan way. */ 00094 int physical_pan_scan; 00095 00096 /* The logical (DVD) stream number. */ 00097 int logical; 00098 } dvdnav_spu_stream_change_event_t; 00099 00100 00101 /* 00102 * DVDNAV_AUDIO_STREAM_CHANGE 00103 * 00104 * Inform the audio decoder to switch channels. 00105 */ 00106 #define DVDNAV_AUDIO_STREAM_CHANGE 4 00107 00108 typedef struct { 00109 /* The physical (MPEG) stream number. */ 00110 int physical; 00111 00112 /* The logical (DVD) stream number. */ 00113 int logical; 00114 } dvdnav_audio_stream_change_event_t; 00115 00116 00117 /* 00118 * DVDNAV_VTS_CHANGE 00119 * 00120 * Some status information like video aspect and video scale permissions do 00121 * not change inside a VTS. Therefore this event can be used to query such 00122 * information only when necessary and update the decoding/displaying 00123 * accordingly. 00124 */ 00125 #define DVDNAV_VTS_CHANGE 5 00126 00127 typedef struct { 00128 int old_vtsN; /* the old VTS number */ 00129 dvd_read_domain_t old_domain; /* the old domain */ 00130 int new_vtsN; /* the new VTS number */ 00131 dvd_read_domain_t new_domain; /* the new domain */ 00132 } dvdnav_vts_change_event_t; 00133 00134 00135 /* 00136 * DVDNAV_CELL_CHANGE 00137 * 00138 * Some status information like the current Title and Part numbers do not 00139 * change inside a cell. Therefore this event can be used to query such 00140 * information only when necessary and update the decoding/displaying 00141 * accordingly. 00142 * Some useful information for accurate time display is also reported 00143 * together with this event. 00144 */ 00145 #define DVDNAV_CELL_CHANGE 6 00146 00147 typedef struct { 00148 int cellN; /* the new cell number */ 00149 int pgN; /* the current program number */ 00150 int64_t cell_length; /* the length of the current cell in PTS ticks */ 00151 int64_t pg_length; /* the length of the current program in PTS ticks */ 00152 int64_t pgc_length; /* the length of the current program chain in PTS ticks */ 00153 int64_t cell_start; /* the start time of the current cell relatively to the PGC in PTS ticks */ 00154 int64_t pg_start; /* the start time of the current PG relatively to the PGC in PTS ticks */ 00155 } dvdnav_cell_change_event_t; 00156 00157 00158 /* 00159 * DVDNAV_NAV_PACKET 00160 * 00161 * NAV packets are useful for various purposes. They define the button 00162 * highlight areas and VM commands of DVD menus, so they should in any 00163 * case be sent to the SPU decoder/overlaying engine for the menus to work. 00164 * NAV packets also provide a way to detect PTS discontinuities, because 00165 * they carry the start and end PTS values for the current VOBU. 00166 * (pci.vobu_s_ptm and pci.vobu_e_ptm) Whenever the start PTS of the 00167 * current NAV does not match the end PTS of the previous NAV, a PTS 00168 * discontinuity has occured. 00169 * NAV packets can also be used for time display, because they are 00170 * timestamped relatively to the current Cell. 00171 */ 00172 #define DVDNAV_NAV_PACKET 7 00173 00174 00175 /* 00176 * DVDNAV_STOP 00177 * 00178 * Applications should end playback here. A subsequent dvdnav_get_next_block() 00179 * call will restart the VM from the beginning of the DVD. 00180 */ 00181 #define DVDNAV_STOP 8 00182 00183 00184 /* 00185 * DVDNAV_HIGHLIGHT 00186 * 00187 * The current button highlight changed. Inform the overlaying engine to 00188 * highlight a different button. Please note, that at the moment only mode 1 00189 * highlights are reported this way. That means, when the button highlight 00190 * has been moved around by some function call, you will receive an event 00191 * telling you the new button. But when a button gets activated, you have 00192 * to handle the mode 2 highlighting (that is some different colour the 00193 * button turns to on activation) in your application. 00194 */ 00195 #define DVDNAV_HIGHLIGHT 9 00196 00197 typedef struct { 00198 /* highlight mode: 0 - hide, 1 - show, 2 - activate, currently always 1 */ 00199 int display; 00200 00201 /* FIXME: these fields are currently not set */ 00202 uint32_t palette; /* The CLUT entries for the highlight palette 00203 (4-bits per entry -> 4 entries) */ 00204 uint16_t sx,sy,ex,ey; /* The start/end x,y positions */ 00205 uint32_t pts; /* Highlight PTS to match with SPU */ 00206 00207 /* button number for the SPU decoder/overlaying engine */ 00208 uint32_t buttonN; 00209 } dvdnav_highlight_event_t; 00210 00211 00212 /* 00213 * DVDNAV_SPU_CLUT_CHANGE 00214 * 00215 * Inform the SPU decoder/overlaying engine to update its colour lookup table. 00216 * The CLUT is given as 16 uint32_t's in the buffer. 00217 */ 00218 #define DVDNAV_SPU_CLUT_CHANGE 10 00219 00220 00221 /* 00222 * DVDNAV_HOP_CHANNEL 00223 * 00224 * A non-seamless operation has been performed. Applications can drop all 00225 * their internal fifo's content, which will speed up the response. 00226 */ 00227 #define DVDNAV_HOP_CHANNEL 12 00228 00229 00230 /* 00231 * DVDNAV_WAIT 00232 * 00233 * We have reached a point in DVD playback, where timing is critical. 00234 * Player application with internal fifos can introduce state 00235 * inconsistencies, because libdvdnav is always the fifo's length 00236 * ahead in the stream compared to what the application sees. 00237 * Such applications should wait until their fifos are empty 00238 * when they receive this type of event. 00239 * Once this is achieved, call dvdnav_skip_wait(). 00240 */ 00241 #define DVDNAV_WAIT 13 00242 00243 00244 #endif /* DVDNAV_EVENTS_H_INCLUDED */
1.5.5