From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features. BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- mpeglib/lib/input/cdromInputStream.h | 88 ++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 mpeglib/lib/input/cdromInputStream.h (limited to 'mpeglib/lib/input/cdromInputStream.h') diff --git a/mpeglib/lib/input/cdromInputStream.h b/mpeglib/lib/input/cdromInputStream.h new file mode 100644 index 00000000..cda18efe --- /dev/null +++ b/mpeglib/lib/input/cdromInputStream.h @@ -0,0 +1,88 @@ +/* + reads input data from cdrom + Copyright (C) 1999 Martin Vogt + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU Library General Public License as published by + the Free Software Foundation. + + For more information look at the file COPYRIGHT in this package + + */ + + + +#ifndef __VIDEOCDINPUTSTREAM_H +#define __VIDEOCDINPUTSTREAM_H + + + +#include "inputStream.h" + + + +#define _CDROM_FRAMES 75 +#define _CDROM_SECS 60 + + +/** + This is necessary because CD-I or VCD disks are not correctly + mounted by the linux kernel. + Windows seems to do it correct (sometimes, the other time it nearly crash) + During my test I found out that CD-I and VCD seems to be different. + One works with the CD-I loader the other with the VCD loader. + + This class tries to find out if its a CD-I / VCD stream. + Then you can set the interface and load from this interface. + + This class depends on the reader routines from xreadcdi/ xreadvcd, + Author: Ales Makarov + FTP : ftp://mca.sh.cvut.cz/pub/readvcd/ + + The code is used in a few other packages, in which I looked as well. + +*/ + +class CDRomRawAccess; +class CDRomToc; + +class CDRomInputStream : public InputStream{ + + CDRomRawAccess* cdRomRawAccess; + CDRomToc* cdRomToc; + + int buflen; + char* bufCurrent; + + int currentFrame; + int currentMinute; + int currentSecond; + long byteCounter; + + public: + CDRomInputStream(); + ~CDRomInputStream(); + + int open(const char* dest); + void close(); + int isOpen(); + + int eof(); + int read(char* ptr,int size); + int seek(long bytePos); + + long getByteLength(); + long getBytePosition(); + + void print(); + + private: + long getBytePos(int min,int sec); + + int setTimePos(int posInTime); + int getByteDirect(); + void next_sector(); + int readCurrent(); + int fillBuffer(); +}; +#endif -- cgit v1.2.1