1 /*****************************************************************************
2 * dvd_summary.c: set of functions to print options of selected title
4 *****************************************************************************
5 * Copyright (C) 1998-2001 VideoLAN
6 * $Id: dvd_summary.c,v 1.9 2001/11/07 17:37:16 stef Exp $
8 * Author: Stéphane Borel <stef@via.ecp.fr>
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
23 *****************************************************************************/
25 #define MODULE_NAME dvd
26 #include "modules_inner.h"
28 /*****************************************************************************
30 *****************************************************************************/
41 #include <netinet/in.h>
45 #include <sys/types.h>
48 #ifdef STRNCASECMP_IN_STRINGS_H
54 # include "dummy_dvdcss.h"
56 # include <videolan/dvdcss.h>
70 #include "input_dvd.h"
76 #include "modules_export.h"
80 * Local tools to decode some data in ifo
83 /****************************************************************************
85 ****************************************************************************/
86 void IfoPrintTitle( thread_dvd_data_t * p_dvd )
88 intf_WarnMsg( 5, "dvd info: title: %d", p_dvd->i_title );
89 intf_WarnMsg( 5, " vobstart at: %d blocks", p_dvd->i_start );
90 intf_WarnMsg( 5, " stream size: %d blocks", p_dvd->i_size );
91 intf_WarnMsg( 5, " number of chapters: %d", p_dvd->i_chapter_nb );
92 intf_WarnMsg( 5, " number of angles: %d", p_dvd->i_angle_nb );
95 /****************************************************************************
97 ****************************************************************************/
98 #define video p_dvd->p_ifo->vts.manager_inf.video_attr
99 void IfoPrintVideo( thread_dvd_data_t * p_dvd )
102 char psz_perm_displ[4][23] =
104 "pan-scan & letterboxed",
109 char psz_source_res[4][28] =
111 "720x480 ntsc or 720x576 pal",
112 "704x480 ntsc or 704x576 pal",
113 "352x480 ntsc or 352x576 pal",
114 "352x240 ntsc or 352x288 pal"
118 switch( video.i_ratio )
121 sprintf( psz_ratio, "4:3" );
124 sprintf( psz_ratio, "16:9" );
127 sprintf( psz_ratio, "undef" );
131 intf_WarnMsg( 5, "dvd info: video" );
132 intf_WarnMsg( 5, " compression: mpeg-%d", video.i_compression+1 );
133 intf_WarnMsg( 5, " tv system: %s Hz",
134 video.i_system ? "pal 625/50" : "ntsc 525/60" );
135 intf_WarnMsg( 5, " aspect ratio: %s", psz_ratio );
136 intf_WarnMsg( 5, " display mode: %s",
137 psz_perm_displ[video.i_perm_displ] );
138 intf_WarnMsg( 5, " line21-1: %s",
139 video.i_line21_1 ? "data present in GOP" : "" );
140 intf_WarnMsg( 5, " line21-2: %s",
141 video.i_line21_2 ? "data present in GOP" : "" );
142 intf_WarnMsg( 5, " source res: %s",
143 psz_source_res[video.i_source_res] );
144 intf_WarnMsg( 5, " letterboxed: %s",
145 video.i_letterboxed ? "yes" : "no" );
146 intf_WarnMsg( 5, " mode: %s",
147 video.i_mode ? "film (625/50 only)" : "camera");
151 /****************************************************************************
153 ****************************************************************************/
154 #define audio p_dvd->p_ifo->vts.manager_inf.p_audio_attr[i-1]
155 #define audio_status \
156 p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title.pi_audio_status[i-1]
157 void IfoPrintAudio( thread_dvd_data_t * p_dvd, int i )
160 if( audio_status.i_available )
162 char ppsz_mode[7][9] =
163 { "ac3", "unknown", "mpeg-1", "mpeg-2", "lpcm", "sdds", "dts" };
164 char ppsz_appl_mode[3][15] =
165 { "not specified", "karaoke", "surround sound" };
166 char psz_caption[25];
167 char ppsz_quant[4][10] =
168 { "16 bits", "20 bits", "24 bits", "drc" };
170 intf_WarnMsg( 5, "dvd info: audio %d" , i );
171 intf_WarnMsg( 5, " language: %s",
172 DecodeLanguage( hton16( audio.i_lang_code ) ) );
173 intf_WarnMsg( 5, " mode: %s", ppsz_mode[audio.i_coding_mode & 0x7] );
174 intf_WarnMsg( 5, " channel(s): %d %s",
175 audio.i_num_channels + 1,
176 audio.i_multichannel_extension ? "ext." : "" );
177 intf_WarnMsg( 5, " sampling: %d Hz",
178 audio.i_sample_freq ? 96000 : 48000 );
179 intf_WarnMsg( 5, " appl_mode: %s",
180 ppsz_appl_mode[audio.i_appl_mode & 0x2] );
181 switch( audio.i_caption )
184 sprintf( psz_caption, "normal caption" );
187 sprintf( psz_caption, "directors comments" );
190 sprintf( psz_caption, " " );
193 intf_WarnMsg( 5, " caption: %s", psz_caption );
194 intf_WarnMsg( 5, " quantization: %s",
195 ppsz_quant[audio.i_quantization & 0x3] );
197 intf_WarnMsg( 5, " status: %x", audio_status.i_position );
205 /****************************************************************************
207 ****************************************************************************/
208 #define spu p_dvd->p_ifo->vts.manager_inf.p_spu_attr[i-1]
210 p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title.pi_spu_status[i-1]
212 void IfoPrintSpu( thread_dvd_data_t * p_dvd, int i )
214 if( spu_status.i_available )
216 intf_WarnMsg( 5, "dvd info: spu %d", i );
217 intf_WarnMsg( 5, " caption: %d", spu.i_caption );
218 intf_WarnMsg( 5, " language: %s",
219 DecodeLanguage( hton16( spu.i_lang_code ) ) );
220 intf_WarnMsg( 5, " prefix: %x", spu.i_prefix );
222 intf_WarnMsg( 5, " status: 4:3 %x wide %x letter %x pan %x",
223 spu_status.i_position_43,
224 spu_status.i_position_wide,
225 spu_status.i_position_letter,
226 spu_status.i_position_pan );