~ubuntu-branches/ubuntu/hoary/kdemultimedia/hoary

« back to all changes in this revision

Viewing changes to mpeglib/lib/input/cdromInputStream.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Schulze
  • Date: 2003-01-22 15:00:51 UTC
  • Revision ID: james.westby@ubuntu.com-20030122150051-uihwkdoxf15mi1tn
Tags: upstream-2.2.2
ImportĀ upstreamĀ versionĀ 2.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
  reads input data from cdrom
 
3
  Copyright (C) 1999  Martin Vogt
 
4
 
 
5
  This program is free software; you can redistribute it and/or modify
 
6
  it under the terms of the GNU Library General Public License as published by
 
7
  the Free Software Foundation.
 
8
 
 
9
  For more information look at the file COPYRIGHT in this package
 
10
 
 
11
 */
 
12
 
 
13
 
 
14
 
 
15
#ifndef __VIDEOCDINPUTSTREAM_H
 
16
#define __VIDEOCDINPUTSTREAM_H
 
17
 
 
18
 
 
19
 
 
20
#include "inputStream.h"
 
21
 
 
22
 
 
23
 
 
24
#define _CDROM_FRAMES   75
 
25
#define _CDROM_SECS     60
 
26
 
 
27
 
 
28
/**
 
29
   This is necessary because CD-I or VCD disks are not correctly
 
30
   mounted by the linux kernel.
 
31
   Windows seems to do it correct (sometimes, the other time it nearly crash)
 
32
   During my test I found out that CD-I and VCD seems to be different.
 
33
   One works with the CD-I loader the other with the VCD loader.
 
34
   
 
35
   This class tries to find out if its a CD-I / VCD stream.
 
36
   Then you can set the interface and load from this interface.
 
37
 
 
38
   This class depends on the reader routines from xreadcdi/ xreadvcd,
 
39
   Author: Ales Makarov <xmakarov@sun.felk.cvut.cz>
 
40
   FTP   : ftp://mca.sh.cvut.cz/pub/readvcd/
 
41
 
 
42
   The code is used in a few other packages, in which I looked as well.
 
43
 
 
44
*/
 
45
 
 
46
class CDRomRawAccess;
 
47
class CDRomToc;
 
48
 
 
49
class CDRomInputStream : public InputStream{
 
50
 
 
51
  CDRomRawAccess* cdRomRawAccess;
 
52
  CDRomToc* cdRomToc;
 
53
 
 
54
  int buflen;
 
55
  char* bufCurrent;
 
56
 
 
57
  int currentFrame;
 
58
  int currentMinute;
 
59
  int currentSecond;
 
60
  long byteCounter;
 
61
 
 
62
 public:
 
63
  CDRomInputStream();
 
64
  ~CDRomInputStream();
 
65
 
 
66
  int open(const char* dest);
 
67
  void close();
 
68
  int isOpen();
 
69
 
 
70
  int eof();
 
71
  int read(char* ptr,int size);
 
72
  int seek(long bytePos);
 
73
 
 
74
  long getByteLength();
 
75
  long getBytePosition();
 
76
 
 
77
  void print();
 
78
 
 
79
 private:
 
80
  long getBytePos(int min,int sec);
 
81
 
 
82
  int setTimePos(int posInTime);
 
83
  int getByteDirect();
 
84
  void next_sector();
 
85
  int readCurrent();
 
86
  int fillBuffer();
 
87
};
 
88
#endif