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

« back to all changes in this revision

Viewing changes to mpeglib/lib/output/avSyncer.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
  encapsulates the syncing methods, to use it in other classes
 
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
 
 
15
#ifndef __AVSYNCER_H
 
16
#define __AVSYNCER_H
 
17
 
 
18
#include <stdlib.h>
 
19
 
 
20
#include "../util/render/yuvPicture.h"
 
21
#include "../util/syncClock.h"
 
22
#include "audioTime.h"
 
23
 
 
24
class Performance;
 
25
class AudioDataArray;
 
26
class AudioData;
 
27
 
 
28
class AVSyncer {
 
29
 
 
30
  AudioData* audioDataInsert;
 
31
  AudioData* audioDataCurrent;
 
32
  AudioDataArray* audioDataArray;
 
33
  Performance* performance;
 
34
 
 
35
  AudioTime* audioTime;
 
36
  int onePicFrameInAudioBytes;
 
37
  int oneFrameTime;
 
38
 
 
39
  int lAudioRunning;
 
40
 
 
41
  abs_thread_mutex_t writeInMut;
 
42
  abs_thread_mutex_t changeMut;
 
43
 
 
44
 
 
45
  int bufferSize;
 
46
 
 
47
  TimeStamp* startAudio;
 
48
  TimeStamp* endAudio;
 
49
  
 
50
  TimeStamp* videoTimeStamp;
 
51
  TimeStamp* diffTime;
 
52
  TimeStamp* waitTime;
 
53
 
 
54
  int lPerformance;
 
55
  int lavSync;
 
56
  int lastAudioPacket;
 
57
  double pts_jitter;
 
58
 
 
59
 
 
60
 public:
 
61
  AVSyncer(int bufferSize);
 
62
  ~AVSyncer();
 
63
 
 
64
  // audio
 
65
  int audioSetup(int frequency,int stereo,int sign,int big,int sixteen);
 
66
  int audioPlay(TimeStamp* startStamp,
 
67
                TimeStamp* endStamp,char *buffer, int size);
 
68
  void audioClose(void);
 
69
  void setAudioBufferSize(int size);
 
70
 
 
71
  int getPreferredDeliverSize();
 
72
 
 
73
  // video
 
74
  int getFrameusec();
 
75
  int syncPicture(YUVPicture* syncPic);
 
76
 
 
77
  void config(const char* key,const char* value,void* user_data);
 
78
 
 
79
 
 
80
 
 
81
 private:
 
82
  int getAudioRunning();
 
83
  void setAudioRunning(int lAudioRunning);
 
84
 
 
85
  void lockSyncData();
 
86
  void unlockSyncData();
 
87
  void setAudioSync(AudioData* audioData);
 
88
 
 
89
   // methods which belong not to the OutputStream interface
 
90
  int avSync(TimeStamp* startVideoStamp,
 
91
             TimeStamp* waitTime,
 
92
             TimeStamp* earlyTime,
 
93
             float picPerSec);
 
94
 
 
95
};
 
96
#endif