home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2001 September / PC-WELT 9-2001.ISO / software / hw / brennen / flask_src.exe / Input / IFOParser / ifo_cell_addr.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-11  |  1.7 KB  |  78 lines

  1.  
  2. /*
  3.  * VIDEO TITLE SET CELL ADDRESS
  4.  *
  5.  * Copyright (C) 1998,1999  Thomas Mirlacher
  6.  *
  7.  * This program is free software; you can redistribute it and/or modify
  8.  * it under the terms of the GNU General Public License as published by
  9.  * the Free Software Foundation; either version 2 of the License, or
  10.  * (at your option) any later version.
  11.  * 
  12.  * This program is distributed in the hope that it will be useful,
  13.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  15.  * GNU General Public License for more details.
  16.  * 
  17.  * You should have received a copy of the GNU General Public License
  18.  * along with this program; if not, write to the Free Software
  19.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20.  * 
  21.  * The author may be reached as dent@cosy.sbg.ac.at, or
  22.  * Thomas Mirlacher, Jakob-Haringerstr. 2, A-5020 Salzburg,
  23.  * Austria
  24.  *
  25.  *------------------------------------------------------------
  26.  *
  27.  */
  28.  
  29.  
  30. #ifdef PARSER
  31. #include <stdio.h>
  32. #endif
  33. #include <sys/types.h>
  34. //#include <unistd.h>
  35. #include "ifo.h"
  36.  
  37. #include "misc.h"
  38. #include "decode.h"
  39.  
  40. #define CADDR_HDR_LEN 8
  41.  
  42. typedef struct {
  43.     u_short    num        : 16;    // Number of Video Objects
  44.     u_short unknown        : 16;    // don't know
  45.     u_int    len        : 32;    // length of table
  46. } cell_addr_hdr_t;
  47.  
  48.  
  49. /**
  50.  *
  51.  */
  52.  
  53. int ifoGetCellAddr (char *hdr, char **ptr)
  54. {
  55.     if (!hdr)
  56.         return -1;
  57.  
  58.     *ptr = hdr + CADDR_HDR_LEN;
  59.  
  60.     return 0;
  61. }
  62.  
  63.  
  64. /**
  65.  *
  66.  */
  67.  
  68. int ifoGetCellAddrNum (char *_hdr)
  69. {
  70.     cell_addr_hdr_t *hdr = (cell_addr_hdr_t *) _hdr;
  71.  
  72.     if (!hdr)
  73.         return -1;
  74.  
  75.     return bswap_32 (hdr->len)/sizeof (ifo_cell_addr_t);
  76. //    return bswap_16 (hdr->num);
  77. }
  78.