summaryrefslogtreecommitdiffstats
path: root/mpeglib/lib/input/inputStream.cpp
blob: 7eb9943bd5241a55cf4ce3ee4c4d39fc2c96ef92 (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
  generic input class
  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

 */


#include "inputStream.h"
#include "../util/mmx/mmx.h"

#include <iostream>

using namespace std;


InputStream::InputStream() {
  timeStampArray=new TimeStampArray((char*)"Input",3000);
  urlBuffer=new DynBuffer(20);
  // we call mm_support() here because it is the only position
  // where we gurantee that not threads are
  // running (the call is not thread safe)
  // afer the call we never execute the asm part again
  // and everything is fine
  mm_support();
}



InputStream::~InputStream() {
  delete timeStampArray;
  delete urlBuffer;
  
}


int InputStream::open(const char* dest) {
  cout << "direct virtual call InputStream::open:"<<dest<<endl;
  return false;
}


void InputStream::close() {
  cout << "direct virtual call InputStream::close"<<endl;
  exit(0); 
}


int InputStream::isOpen() {
  cout << "direct virtual call InputStream::isOpen"<<endl;
  exit(0);
  return false; 
}


int InputStream::eof() {
  cout << "direct virtual call InputStream::eof"<<endl;
  exit(0);
  return true;  
}


int InputStream::read(char* ,int ) {
  cout << "direct virtual call InputStream::read"<<endl;
  exit(0);
  return 0;  
}


int InputStream::seek(long bytePos) {
  cout << "direct virtual call InputStream::seek:"<<bytePos<<endl;
  exit(0);
  return false;  
}

void InputStream::clear() {
  cout << "direct virtual call InputStream::clear:"<<endl;
  exit(0);
}


long InputStream::getByteLength() {
  cout << "direct virtual call InputStream::getByteLength"<<endl;
  return 0;
}


long InputStream::getBytePosition() {
  cout << "direct virtual call InputStream::getBytePosition"<<endl;
  return 0;
}


void InputStream::insertTimeStamp(TimeStamp* src,long key,int len) {
  timeStampArray->insertTimeStamp(src,key,len);
}

TimeStamp* InputStream::getTimeStamp(long key) {
  return timeStampArray->getTimeStamp(key);
}


int InputStream::bytesUntilNext(long key) {
  return timeStampArray->bytesUntilNext(key);
}

void InputStream::print() {
  cout << "direct virtual call InputStream::print"<<endl;
}





char* InputStream::getUrl() {
  return urlBuffer->getData();
}


void InputStream::setUrl(const char* url) {
  urlBuffer->clear();
  if (url != NULL) {
    urlBuffer->append(url);
  }
}