diff options
author | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
---|---|---|
committer | toma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2009-11-25 17:56:58 +0000 |
commit | e2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch) | |
tree | 9047cf9e6b5c43878d5bf82660adae77ceee097a /mpeglib/lib/frame/audioFrameQueue.h | |
download | tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.tar.gz tdemultimedia-e2de64d6f1beb9e492daf5b886e19933c1fa41dd.zip |
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdemultimedia@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'mpeglib/lib/frame/audioFrameQueue.h')
-rw-r--r-- | mpeglib/lib/frame/audioFrameQueue.h | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/mpeglib/lib/frame/audioFrameQueue.h b/mpeglib/lib/frame/audioFrameQueue.h new file mode 100644 index 00000000..7e7a01c0 --- /dev/null +++ b/mpeglib/lib/frame/audioFrameQueue.h @@ -0,0 +1,75 @@ +/* + queues audio frames in an IOQueue, allows streaming from frames + Copyright (C) 2001 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 + + */ + + + +#ifndef __AUDIOFRAMEQUE_H +#define __AUDIOFRAMEQUE_H + +#include "IOFrameQueue.h" +#include "floatFrame.h" +#include "pcmFrame.h" + +#include <kdemacros.h> + +/** + This class solves the problem that we produce audioFrames + in a packet, but often we want that these packets looks + like a stream. + This class can convert from packets back to a stream. +*/ + +class KDE_EXPORT AudioFrameQueue : public IOFrameQueue { + + int frameType; + int len; + AudioFrame* currentAudioFrame; + int currentRead; + + public: + AudioFrameQueue(int queueSize,int frameSize,int frameType); + ~AudioFrameQueue(); + + void emptyQueueEnqueue(AudioFrame* frame); + AudioFrame* emptyQueueDequeue(); + + void dataQueueEnqueue(AudioFrame* frame); + AudioFrame* dataQueueDequeue(); + + // Meta info about stream + AudioFrame* getCurrent(); + + // Data info about "stream" (calculated from the packets) + int getLen(); + + // copy from packets to destination + int copy(float* left,float* right,int len); + int copy(short int* left,short int* right,int len); + void forwardStreamDouble(int len); + + int copy(short int* dest,int len); + int copy(float* dest,int len); + void forwardStreamSingle(int len); + + void clear(); + + private: + void transferFrame(float* left,float* right,FloatFrame*,int start,int len); + void transferFrame(short int* left,short int* right, + PCMFrame*,int start,int len); + void transferFrame(short int* dest, + PCMFrame*,int start,int len); + void transferFrame(float* dest, + FloatFrame*,int start,int len); + int copygeneric(char* left,char* right,int wantLen,int version,int mux); +}; +#endif |