summaryrefslogtreecommitdiff
path: root/vdr_stream.h
blob: 68f7ea7cef8eda55bb9ba45078f918f57e8796e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/*!
 * \file  vdr_stream.h
 * \brief Definitions of media streams
 *
 * \version $Revision: 1.2 $
 * \date    $Date: 2004/05/28 15:29:19 $
 * \author  Ralf Klueber, Lars von Wedel, Andreas Kellner
 * \author  Responsible author: $Author: lvw $
 *
 * $Id: vdr_stream.h,v 1.2 2004/05/28 15:29:19 lvw Exp $
 *
 * Adapted from
 * MP3/MPlayer plugin to VDR (C++)
 * (C) 2001-2003 Stefan Huelswitt <huels@iname.com>
 */

#ifndef ___STREAM_H
#define ___STREAM_H

#include <string>

#include "vdr_decoder.h"

class cNet;

// ----------------------------------------------------------------

class mgStream // : public mgFileInfo
{
private:
  int m_fd;
  bool m_ismmap;

  // from cFileInfo
  std::string m_filename, m_fsID;
  unsigned long long m_filesize;
  time_t m_ctime;
  long m_fsType;

  bool fileinfo( bool log );
  bool removable();

protected:
  unsigned char *m_buffer;
  unsigned long long m_readpos, m_buffpos;
  unsigned long m_fill;
public:
  mgStream( std::string filename );
  virtual ~mgStream();
  virtual bool open(bool log = true);
  virtual void close();
  virtual bool stream( unsigned char *&data, unsigned long &len, const unsigned char *rest=NULL );
  virtual bool seek( unsigned long long pos = 0 );
  virtual unsigned long long bufferPos() { return m_buffpos; }
};

#endif //___STREAM_H