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

« back to all changes in this revision

Viewing changes to mpeglib/lib/frame/audioFrameQueue.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
  queues audio frames in an IOQueue, allows streaming from frames
 
3
  Copyright (C) 2001  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 __AUDIOFRAMEQUE_H
 
16
#define __AUDIOFRAMEQUE_H
 
17
 
 
18
#include "IOFrameQueue.h"
 
19
#include "floatFrame.h"
 
20
#include "pcmFrame.h"
 
21
 
 
22
 
 
23
 
 
24
/**
 
25
   This class solves the problem that we produce audioFrames
 
26
   in a packet, but often we want that these packets looks
 
27
   like a stream.
 
28
   This class can convert from packets back to a stream.
 
29
*/
 
30
 
 
31
class AudioFrameQueue : public IOFrameQueue {
 
32
  
 
33
  int frameType;
 
34
  int len;
 
35
  AudioFrame* currentAudioFrame;
 
36
  int currentRead;
 
37
 
 
38
 public:
 
39
  AudioFrameQueue(int queueSize,int frameSize,int frameType);
 
40
  ~AudioFrameQueue();
 
41
 
 
42
  void emptyQueueEnqueue(AudioFrame* frame);
 
43
  AudioFrame* emptyQueueDequeue();
 
44
 
 
45
  void dataQueueEnqueue(AudioFrame* frame);
 
46
  AudioFrame* dataQueueDequeue();
 
47
 
 
48
  // Meta info about stream
 
49
  AudioFrame* getCurrent();
 
50
 
 
51
  // Data info about "stream" (calculated from the packets)
 
52
  int getLen();
 
53
 
 
54
  // copy from packets to destination
 
55
  int copy(float* left,float* right,int len);
 
56
  int copy(short int* left,short int* right,int len);
 
57
  void forwardStreamDouble(int len);
 
58
 
 
59
  int copy(short int* dest,int len);
 
60
  int copy(float* dest,int len);
 
61
  void forwardStreamSingle(int len);
 
62
 
 
63
  void clear();
 
64
 
 
65
 private:
 
66
  void transferFrame(float* left,float* right,FloatFrame*,int start,int len);
 
67
  void transferFrame(short int* left,short int* right,
 
68
                     PCMFrame*,int start,int len);
 
69
  void transferFrame(short int* dest,
 
70
                     PCMFrame*,int start,int len);
 
71
  void transferFrame(float* dest,
 
72
                     FloatFrame*,int start,int len);
 
73
  int copygeneric(char* left,char* right,int wantLen,int version);
 
74
};
 
75
#endif