~ubuntu-branches/debian/wheezy/vlc/wheezy

« back to all changes in this revision

Viewing changes to modules/access/dvd/summary.c

Tags: upstream-0.7.2.final
Import upstream version 0.7.2.final

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****************************************************************************
 
2
 * summary.c: set of functions to print options of selected title
 
3
 * found in .ifo.
 
4
 *****************************************************************************
 
5
 * Copyright (C) 1998-2001 VideoLAN
 
6
 * $Id: summary.c 6961 2004-03-05 17:34:23Z sam $
 
7
 *
 
8
 * Author: St�phane Borel <stef@via.ecp.fr>
 
9
 *
 
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.
 
14
 * 
 
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.
 
19
 *
 
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
 *****************************************************************************/
 
24
 
 
25
/*****************************************************************************
 
26
 * Preamble
 
27
 *****************************************************************************/
 
28
#include <stdio.h>
 
29
#include <stdlib.h>
 
30
 
 
31
#include <vlc/vlc.h>
 
32
 
 
33
#ifdef HAVE_UNISTD_H
 
34
#   include <unistd.h>
 
35
#endif
 
36
 
 
37
#if !defined( WIN32 )
 
38
#   include <netinet/in.h>
 
39
#endif
 
40
 
 
41
#include <fcntl.h>
 
42
#include <sys/types.h>
 
43
 
 
44
#include <string.h>
 
45
#ifdef STRNCASECMP_IN_STRINGS_H
 
46
#   include <strings.h>
 
47
#endif
 
48
#include <errno.h>
 
49
 
 
50
#ifdef GOD_DAMN_DMCA
 
51
#   include "dvdcss.h"
 
52
#else
 
53
#   include <dvdcss/dvdcss.h>
 
54
#endif
 
55
 
 
56
#include "dvd.h"
 
57
#include "ifo.h"
 
58
#include "iso_lang.h"
 
59
 
 
60
/*
 
61
 * Local tools to decode some data in ifo
 
62
 */
 
63
 
 
64
/****************************************************************************
 
65
 * IfoPrintTitle
 
66
 ****************************************************************************/
 
67
void IfoPrintTitle( thread_dvd_data_t * p_dvd )
 
68
{
 
69
#if 0
 
70
    intf_WarnMsg( 5, "dvd info: title %d, %d chapter%s, %d angle%s",
 
71
                     p_dvd->i_title, p_dvd->i_chapter_nb,
 
72
                     (p_dvd->i_chapter_nb == 1) ? "" : "s",
 
73
                     p_dvd->i_angle_nb,
 
74
                     (p_dvd->i_angle_nb == 1) ? "" : "s" );
 
75
#endif
 
76
}
 
77
 
 
78
/****************************************************************************
 
79
 * IfoPrintVideo
 
80
 ****************************************************************************/
 
81
#define video p_dvd->p_ifo->vts.manager_inf.video_attr
 
82
void IfoPrintVideo( thread_dvd_data_t * p_dvd )
 
83
{
 
84
#if 0
 
85
    char*    psz_perm_displ[4] =
 
86
             {
 
87
                "pan-scan & letterboxed",
 
88
                "pan-scan",
 
89
                "letterboxed",
 
90
                "not specified"
 
91
             };
 
92
    char*    psz_source_res[4] =
 
93
             {
 
94
                "720x480 ntsc or 720x576 pal",
 
95
                "704x480 ntsc or 704x576 pal",
 
96
                "352x480 ntsc or 352x576 pal",
 
97
                "352x240 ntsc or 352x288 pal"
 
98
             };
 
99
 
 
100
    intf_WarnMsg( 5, "dvd info: MPEG-%d video, %sHz, aspect ratio %s",
 
101
                     video.i_compression + 1,
 
102
                     video.i_system ? "pal 625 @50" : "ntsc 525 @60",
 
103
                     video.i_ratio ? (video.i_ratio == 3) ? "16:9"
 
104
                                                          : "unknown"
 
105
                                   : "4:3" );
 
106
 
 
107
    intf_WarnMsg( 5, "dvd info: display mode %s, %s, %s",
 
108
                     psz_perm_displ[video.i_perm_displ],
 
109
                     video.i_line21_1 ? "line21-1 data in GOP"
 
110
                                      : "no line21-1 data",
 
111
                     video.i_line21_2 ? "line21-2 data in GOP"
 
112
                                      : "no line21-2 data" );
 
113
 
 
114
    intf_WarnMsg( 5, "dvd info: source is %s, %sletterboxed, %s mode",
 
115
                     psz_source_res[video.i_source_res],
 
116
                     video.i_letterboxed ? "" : "not ",
 
117
                     video.i_mode ? "film (625/50 only)" : "camera" );
 
118
#endif
 
119
}
 
120
#undef video
 
121
 
 
122
/****************************************************************************
 
123
 * IfoPrintAudio
 
124
 ****************************************************************************/
 
125
#define audio p_dvd->p_ifo->vts.manager_inf.p_audio_attr[i-1]
 
126
#define audio_status \
 
127
    p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title.pi_audio_status[i-1]
 
128
void IfoPrintAudio( thread_dvd_data_t * p_dvd, int i )
 
129
{
 
130
    if( audio_status.i_available )
 
131
    {
 
132
#if 0
 
133
        char* ppsz_mode[8] =
 
134
            { "A52", "unknown", "MPEG", "MPEG-2", "LPCM", "SDDS", "DTS", "" };
 
135
        char* ppsz_appl_mode[4] =
 
136
            { "no application specified", "karaoke", "surround sound", "" };
 
137
        char* ppsz_quant[4] =
 
138
            { "16 bits", "20 bits", "24 bits", "drc" };
 
139
 
 
140
        intf_WarnMsg( 5, "dvd info: audio %d (%s) is %s, "
 
141
                         "%d%s channel%s, %dHz, %s", i,
 
142
                         DecodeLanguage( audio.i_lang_code ),
 
143
                         ppsz_mode[audio.i_coding_mode & 0x7],
 
144
                         audio.i_num_channels + 1,
 
145
                         audio.i_multichannel_extension ? " ext." : "",
 
146
                         audio.i_num_channels ? "s" : "",
 
147
                         audio.i_sample_freq ? 96000 : 48000,
 
148
                         ppsz_appl_mode[audio.i_appl_mode & 0x3] );
 
149
 
 
150
        intf_WarnMsg( 5, "dvd info: %s, quantization %s, status %x",
 
151
                         (audio.i_caption == 1) ? "normal caption"
 
152
                           : (audio.i_caption == 3) ? "directors comments"
 
153
                               : "unknown caption",
 
154
                         ppsz_quant[audio.i_quantization & 0x3],
 
155
                         audio_status.i_position );
 
156
#endif
 
157
    }
 
158
}
 
159
#undef audio_status
 
160
#undef audio
 
161
 
 
162
/****************************************************************************
 
163
 * IfoPrintSpu
 
164
 ****************************************************************************/
 
165
#define spu p_dvd->p_ifo->vts.manager_inf.p_spu_attr[i-1]
 
166
#define spu_status \
 
167
    p_dvd->p_ifo->vts.title_unit.p_title[p_dvd->i_title_id-1].title.pi_spu_status[i-1]
 
168
 
 
169
void IfoPrintSpu( thread_dvd_data_t * p_dvd, int i )
 
170
{
 
171
    if( spu_status.i_available )
 
172
    {
 
173
#if 0
 
174
        intf_WarnMsg( 5, "dvd info: spu %d (%s), caption %d "
 
175
                         "prefix %x, modes [%s%s%s%s ]", i,
 
176
                         DecodeLanguage( spu.i_lang_code ),
 
177
                         spu.i_caption, spu.i_prefix,
 
178
                         spu_status.i_position_43 ? " 4:3" : "",
 
179
                         spu_status.i_position_wide ? " wide" : "",
 
180
                         spu_status.i_position_letter ? " letter" : "",
 
181
                         spu_status.i_position_pan ? " pan" : "" );
 
182
#endif
 
183
    }
 
184
}
 
185
#undef spu_status
 
186
#undef spu