]> git.sesse.net Git - vlc/blobdiff - plugins/dvd/dvd_summary.c
* Removed unused code (intf_channels.c, keystrokes.h).
[vlc] / plugins / dvd / dvd_summary.c
index 83c5e4b735a2ed137d97f43919ad19a1cfcf547a..a77e60758882395bc7fd6c8a44792197c814dea2 100644 (file)
@@ -3,7 +3,7 @@
  * found in .ifo.
  *****************************************************************************
  * Copyright (C) 1998-2001 VideoLAN
- * $Id: dvd_summary.c,v 1.1 2001/05/19 00:39:30 stef Exp $
+ * $Id: dvd_summary.c,v 1.11 2001/12/07 18:33:07 sam Exp $
  *
  * Author: Stéphane Borel <stef@via.ecp.fr>
  *
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
  *****************************************************************************/
 
+#define MODULE_NAME dvd
+#include "modules_inner.h"
+
 /*****************************************************************************
  * Preamble
  *****************************************************************************/
 #include "defs.h"
 
-#ifdef HAVE_CSS
-#define MODULE_NAME dvd
-#else /* HAVE_CSS */
-#define MODULE_NAME dvdnocss
-#endif /* HAVE_CSS */
-#include "modules_inner.h"
-
 #include <stdio.h>
 #include <stdlib.h>
+
+#ifdef HAVE_UNISTD_H
 #include <unistd.h>
+#endif
+
+#if !defined( WIN32 )
 #include <netinet/in.h>
+#endif
 
 #include <fcntl.h>
 #include <sys/types.h>
-#include <sys/uio.h>
 
 #include <string.h>
 #ifdef STRNCASECMP_IN_STRINGS_H
 #endif
 #include <errno.h>
 
-#include "config.h"
+#ifdef GOD_DAMN_DMCA
+#   include "dummy_dvdcss.h"
+#else
+#   include <videolan/dvdcss.h>
+#endif
+
 #include "common.h"
+#include "intf_msg.h"
 #include "threads.h"
 #include "mtime.h"
+#include "iso_lang.h"
 #include "tests.h"
 
-#include "intf_msg.h"
-
-#include "main.h"
-
-#include "dvd_ifo.h"
 #include "input_dvd.h"
+#include "dvd_ifo.h"
 
 #include "debug.h"
 
 #include "modules.h"
+#include "modules_export.h"
 
-/*****************************************************************************
- * Local tables
- *****************************************************************************/
-static struct
-{
-    char    p_code[3];
-    char    p_lang_long[20];
-}
-
-lang_tbl[] =
-{
-    /* The ISO 639 language codes.
-     * Language names with * prefix are not spelled in their own language 
-     */
-    { "  ", "Not Specified" },
-    { "aa", "*Afar" },
-    { "ab", "*Abkhazian" },
-    { "af", "*Afrikaans" },
-    { "am", "*Amharic" },
-    { "ar", "*Arabic" },
-    { "as", "*Assamese" },
-    { "ay", "*Aymara" },
-    { "az", "*Azerbaijani" },
-    { "ba", "*Bashkir" },
-    { "be", "*Byelorussian" },
-    { "bg", "*Bulgarian" },
-    { "bh", "*Bihari" },
-    { "bi", "*Bislama" },
-    { "bn", "*Bengali; Bangla" },
-    { "bo", "*Tibetan" },
-    { "br", "*Breton" },
-    { "ca", "*Catalan" },
-    { "co", "*Corsican" },
-    { "cs", "*Czech(Ceske)" },
-    { "cy", "*Welsh" },
-    { "da", "Dansk" },
-    { "de", "Deutsch" },
-    { "dz", "*Bhutani" },
-    { "el", "*Greek" },
-    { "en", "English" },
-    { "eo", "*Esperanto" },
-    { "es", "Espanol" },
-    { "et", "*Estonian" },
-    { "eu", "*Basque" },
-    { "fa", "*Persian" },
-    { "fi", "Suomi" },
-    { "fj", "*Fiji" },
-    { "fo", "*Faroese" },
-    { "fr", "Francais" },
-    { "fy", "*Frisian" },
-    { "ga", "*Irish" },
-    { "gd", "*Scots Gaelic" },
-    { "gl", "*Galician" },
-    { "gn", "*Guarani" },
-    { "gu", "*Gujarati" },
-    { "ha", "*Hausa" },
-    { "he", "*Hebrew" },                                      /* formerly iw */
-    { "hi", "*Hindi" },
-    { "hr", "Hrvatski" },                                        /* Croatian */
-    { "hu", "Magyar" },
-    { "hy", "*Armenian" },
-    { "ia", "*Interlingua" },
-    { "id", "*Indonesian" },                                  /* formerly in */
-    { "ie", "*Interlingue" },
-    { "ik", "*Inupiak" },
-    { "in", "*Indonesian" },                               /* replaced by id */
-    { "is", "Islenska" },
-    { "it", "Italiano" },
-    { "iu", "*Inuktitut" },
-    { "iw", "*Hebrew" },                                   /* replaced by he */
-    { "ja", "*Japanese" },
-    { "ji", "*Yiddish" },                                  /* replaced by yi */
-    { "jw", "*Javanese" },
-    { "ka", "*Georgian" },
-    { "kk", "*Kazakh" },
-    { "kl", "*Greenlandic" },
-    { "km", "*Cambodian" },
-    { "kn", "*Kannada" },
-    { "ko", "*Korean" },
-    { "ks", "*Kashmiri" },
-    { "ku", "*Kurdish" },
-    { "ky", "*Kirghiz" },
-    { "la", "*Latin" },
-    { "ln", "*Lingala" },
-    { "lo", "*Laothian" },
-    { "lt", "*Lithuanian" },
-    { "lv", "*Latvian, Lettish" },
-    { "mg", "*Malagasy" },
-    { "mi", "*Maori" },
-    { "mk", "*Macedonian" },
-    { "ml", "*Malayalam" },
-    { "mn", "*Mongolian" },
-    { "mo", "*Moldavian" },
-    { "mr", "*Marathi" },
-    { "ms", "*Malay" },
-    { "mt", "*Maltese" },
-    { "my", "*Burmese" },
-    { "na", "*Nauru" },
-    { "ne", "*Nepali" },
-    { "nl", "Nederlands" },
-    { "no", "Norsk" },
-    { "oc", "*Occitan" },
-    { "om", "*(Afan) Oromo" },
-    { "or", "*Oriya" },
-    { "pa", "*Punjabi" },
-    { "pl", "*Polish" },
-    { "ps", "*Pashto, Pushto" },
-    { "pt", "Portugues" },
-    { "qu", "*Quechua" },
-    { "rm", "*Rhaeto-Romance" },
-    { "rn", "*Kirundi" },
-    { "ro", "*Romanian"  },
-    { "ru", "*Russian" },
-    { "rw", "*Kinyarwanda" },
-    { "sa", "*Sanskrit" },
-    { "sd", "*Sindhi" },
-    { "sg", "*Sangho" },
-    { "sh", "*Serbo-Croatian" },
-    { "si", "*Sinhalese" },
-    { "sk", "*Slovak" },
-    { "sl", "*Slovenian" },
-    { "sm", "*Samoan" },
-    { "sn", "*Shona"  },
-    { "so", "*Somali" },
-    { "sq", "*Albanian" },
-    { "sr", "*Serbian" },
-    { "ss", "*Siswati" },
-    { "st", "*Sesotho" },
-    { "su", "*Sundanese" },
-    { "sv", "Svenska" },
-    { "sw", "*Swahili" },
-    { "ta", "*Tamil" },
-    { "te", "*Telugu" },
-    { "tg", "*Tajik" },
-    { "th", "*Thai" },
-    { "ti", "*Tigrinya" },
-    { "tk", "*Turkmen" },
-    { "tl", "*Tagalog" },
-    { "tn", "*Setswana" },
-    { "to", "*Tonga" },
-    { "tr", "*Turkish" },
-    { "ts", "*Tsonga" },
-    { "tt", "*Tatar" },
-    { "tw", "*Twi" },
-    { "ug", "*Uighur" },
-    { "uk", "*Ukrainian" },
-    { "ur", "*Urdu" },
-    { "uz", "*Uzbek" },
-    { "vi", "*Vietnamese" },
-    { "vo", "*Volapuk" },
-    { "wo", "*Wolof" },
-    { "xh", "*Xhosa" },
-    { "yi", "*Yiddish" },                                     /* formerly ji */
-    { "yo", "*Yoruba" },
-    { "za", "*Zhuang" },
-    { "zh", "*Chinese" },
-    { "zu", "*Zulu" },
-    { "\0", "" }
-};
 
 /*
  * Local tools to decode some data in ifo
  */
 
-/*****************************************************************************
- * IfoLanguage: gives the long language name from the two-letters
- *              ISO-639 code
- *****************************************************************************/
-char * IfoLanguage( u16 i_code )
-{
-    int     i = 0;
-
-    while( memcmp( lang_tbl[i].p_code, &i_code, 2 ) &&
-           lang_tbl[i].p_lang_long[0] )
-    {
-        i++;
-    }
-
-    return lang_tbl[i].p_lang_long;
-}
-
-
 /****************************************************************************
  * IfoPrintTitle
  ****************************************************************************/
 void IfoPrintTitle( thread_dvd_data_t * p_dvd )
 {
-    intf_WarnMsg( 5, "***************************************************" );
     intf_WarnMsg( 5, "dvd info: title: %d", p_dvd->i_title );
-    intf_WarnMsg( 5, "    vobstart at: %lld", p_dvd->i_start );
-    intf_WarnMsg( 5, "    stream size: %lld", p_dvd->i_size );
+    intf_WarnMsg( 5, "    vobstart at: %d blocks", p_dvd->i_start );
+    intf_WarnMsg( 5, "    stream size: %d blocks", p_dvd->i_size );
     intf_WarnMsg( 5, "    number of chapters: %d", p_dvd->i_chapter_nb );
     intf_WarnMsg( 5, "    number of angles: %d", p_dvd->i_angle_nb );
-    intf_WarnMsg( 5, "***************************************************\n" );
 }
 
 /****************************************************************************
@@ -298,7 +124,6 @@ void IfoPrintVideo( thread_dvd_data_t * p_dvd )
         break;
     }
 
-    intf_WarnMsg( 5, "***********************************************" );
     intf_WarnMsg( 5, "dvd info: video" );
     intf_WarnMsg( 5, "    compression: mpeg-%d", video.i_compression+1 );
     intf_WarnMsg( 5, "    tv system: %s Hz",
@@ -316,7 +141,6 @@ void IfoPrintVideo( thread_dvd_data_t * p_dvd )
                      video.i_letterboxed ? "yes" : "no" );
     intf_WarnMsg( 5, "    mode: %s",
                      video.i_mode ? "film (625/50 only)" : "camera");
-    intf_WarnMsg( 5, "***********************************************\n" );
 }
 #undef video
 
@@ -339,10 +163,9 @@ void IfoPrintAudio( thread_dvd_data_t * p_dvd, int i )
         char    ppsz_quant[4][10] =
                 { "16 bits", "20 bits", "24 bits", "drc" };
     
-        intf_WarnMsg( 5, "***********************************************" );
         intf_WarnMsg( 5, "dvd info: audio %d" , i );
         intf_WarnMsg( 5, "    language: %s", 
-                         IfoLanguage( hton16( audio.i_lang_code ) ) );
+                         DecodeLanguage( hton16( audio.i_lang_code ) ) );
         intf_WarnMsg( 5, "    mode: %s", ppsz_mode[audio.i_coding_mode & 0x7] );
         intf_WarnMsg( 5, "    channel(s): %d %s",
                          audio.i_num_channels + 1,
@@ -368,7 +191,6 @@ void IfoPrintAudio( thread_dvd_data_t * p_dvd, int i )
                          ppsz_quant[audio.i_quantization & 0x3] );
     
         intf_WarnMsg( 5, "    status: %x", audio_status.i_position );
-        intf_WarnMsg( 5, "***********************************************\n" );
     }
 
 
@@ -387,11 +209,10 @@ void IfoPrintSpu( thread_dvd_data_t * p_dvd, int i )
 {
     if( spu_status.i_available )
     {
-        intf_WarnMsg( 5, "***********************************************" );
         intf_WarnMsg( 5, "dvd info: spu %d", i );
         intf_WarnMsg( 5, "    caption: %d", spu.i_caption );
         intf_WarnMsg( 5, "    language: %s",
-                         IfoLanguage( hton16( spu.i_lang_code ) ) );
+                         DecodeLanguage( hton16( spu.i_lang_code ) ) );
         intf_WarnMsg( 5, "    prefix: %x", spu.i_prefix );
 
         intf_WarnMsg( 5, "    status: 4:3 %x wide %x letter %x pan %x",
@@ -399,7 +220,6 @@ void IfoPrintSpu( thread_dvd_data_t * p_dvd, int i )
             spu_status.i_position_wide,
             spu_status.i_position_letter,
             spu_status.i_position_pan );
-        intf_WarnMsg( 5, "***********************************************\n" );
     }
 
 }