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

« back to all changes in this revision

Viewing changes to mpeglib/lib/util/timeStamp.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
  class for managing byte positions and associated time positions
 
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
#ifndef __TIMESTAMP_H
 
15
#define __TIMESTAMP_H
 
16
 
 
17
 
 
18
#include <iostream.h>
 
19
#include "syncClock.h"
 
20
 
 
21
 
 
22
 
 
23
 
 
24
class TimeStamp {
 
25
 
 
26
  long key;
 
27
  int keylen;
 
28
 
 
29
  int videoFrameCounter;
 
30
 
 
31
  timeval_t time;
 
32
 
 
33
  int lPTSFlag;
 
34
 
 
35
  double ptsTimeStamp;
 
36
  double scrTimeStamp;
 
37
  double dtsTimeStamp;
 
38
 
 
39
  class SyncClock* syncClock;
 
40
 
 
41
 public:
 
42
  TimeStamp();
 
43
  ~TimeStamp();
 
44
  
 
45
  void gettimeofday();
 
46
  void set(long sec,long usec);
 
47
 
 
48
  void addOffset(TimeStamp* stamp);
 
49
  void addOffset(int sec,long usec);
 
50
  void copyTo(TimeStamp* dest);
 
51
 
 
52
  long getKey();
 
53
  int getKeyLen();
 
54
  void setKey(long key,int keylen);
 
55
 
 
56
  int getPTSFlag();
 
57
  void setPTSFlag(int lPTSFlag);
 
58
 
 
59
 
 
60
  double getPTSTimeStamp();
 
61
  void setPTSTimeStamp(double ptsTimeStamp);
 
62
 
 
63
  double getDTSTimeStamp();
 
64
  void setDTSTimeStamp(double dtsTimeStamp);
 
65
 
 
66
  double getSCRTimeStamp();
 
67
  void setSCRTimeStamp(double scrTimeStamp);
 
68
 
 
69
  int getVideoFrameCounter();
 
70
  void setVideoFrameCounter(int nr);
 
71
 
 
72
  SyncClock* getSyncClock();
 
73
  void setSyncClock(class SyncClock* syncClock);
 
74
 
 
75
 
 
76
  void print(const char* name);
 
77
  void minus(TimeStamp* stamp,TimeStamp* dest);
 
78
  void minus(int sec,long usec);
 
79
  int lessThan(TimeStamp* stamp);
 
80
  int lessThan(int sec,long usec);
 
81
  double getAsSeconds();
 
82
 
 
83
  void waitForIt();
 
84
  timeval_t* getTime();
 
85
 
 
86
  int isPositive();
 
87
  int isNegative();
 
88
 
 
89
 private:
 
90
  void setTime(timeval_t* newTime);
 
91
  void normalize();
 
92
 
 
93
 
 
94
};
 
95
#endif