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

« back to all changes in this revision

Viewing changes to mpeglib/lib/input/threadSafeInputStream.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
  thread safe wrapper for input Stream
 
3
  Copyright (C) 2000  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
#ifndef __THREADSAFEINPUTSTREAM_H
 
15
#define __THREADSAFEINPUTSTREAM_H
 
16
 
 
17
// read INTRO in threadQueue.h
 
18
// This class makes the inputStream (given in constructor)
 
19
// threadsafe by wrapping each call with a threadqueue.
 
20
//
 
21
// Important NOTE: the input pointer is the owned by this class !!!
 
22
//                 which means: we call delete on it!
 
23
 
 
24
#include "../util/abstract/threadQueue.h"
 
25
#include "inputStream.h"
 
26
 
 
27
 
 
28
class ThreadSafeInputStream : public InputStream {
 
29
 
 
30
  ThreadQueue* threadQueue;
 
31
  InputStream* input;
 
32
 
 
33
 public:
 
34
  ThreadSafeInputStream(InputStream* input);
 
35
  ~ThreadSafeInputStream();
 
36
 
 
37
 
 
38
  int open(const char* dest);
 
39
  void close();
 
40
  int isOpen();
 
41
 
 
42
  int eof();
 
43
  int read(char* ptr,int size);
 
44
  int seek(long bytePos);
 
45
  void clear();
 
46
 
 
47
  long getByteLength();
 
48
  long getBytePosition();
 
49
 
 
50
  void insertTimeStamp(TimeStamp* src,long key,int len);
 
51
  TimeStamp* getTimeStamp(long key);
 
52
  int bytesUntilNext(long key);
 
53
  void print();
 
54
 
 
55
};
 
56
#endif