From e2de64d6f1beb9e492daf5b886e19933c1fa41dd Mon Sep 17 00:00:00 2001 From: toma Date: Wed, 25 Nov 2009 17:56:58 +0000 Subject: 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 --- mpeglib/lib/output/artsOutputStream.h | 123 ++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 mpeglib/lib/output/artsOutputStream.h (limited to 'mpeglib/lib/output/artsOutputStream.h') diff --git a/mpeglib/lib/output/artsOutputStream.h b/mpeglib/lib/output/artsOutputStream.h new file mode 100644 index 00000000..757022fd --- /dev/null +++ b/mpeglib/lib/output/artsOutputStream.h @@ -0,0 +1,123 @@ +/* + output to arts + Copyright (C) 2000 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 __ARTSOUTPUTSTREAM_H +#define __ARTSOUTPUTSTREAM_H + +#include "outputStream.h" +#include "../input/bufferInputStream.h" +#include "audioTime.h" + + +class WindowOut; +class AVSyncer; + + + + +/** + a word about synchronisation: Arts currently has not asynchronous + starting of stream, which means, poll if stream is initialized + or set a callbackfunction. + + mpeglib is threaded and would not have much problems + with a "callback" but currently we only support blocking wait + for initilisation. + + I think, if people realize that smooth mixing of streams + is impossible(because of the blocking start behaviour), + this will become a desired feature :-) + +*/ + + +/** + This class offers a blocking device, its behaviour is similar + to /dev/dsp we use a buffer to store the pcm data, if + we open/close the buffer the stored data is removed + and the blocking thread is "kicked" + + Arts must first wait for an init signal. it has its own + method to check for eof. during seek we close this + device, after seek we reopen it. + + close and open have the same functionality, they simply + clear the buffer. +*/ + + + +class ArtsOutputStream : public OutputStream { + + BufferInputStream* stream; + AudioTime* audioTime; + + void (*streamStateChangeCallback)(void*); + + WindowOut* x11Window; + AVSyncer* avSyncer; + int privateBufferSize; + class ThreadQueue* threadQueue; + + public: + ArtsOutputStream(void (*streamStateChangeCallback)(void*)); + ~ArtsOutputStream(); + + // Audio part + + int audioSetup(int freq,int stereo,int sign,int big,int sampleSize); + void audioClose(); + void audioOpen(); + void audioFlush(); + + int audioPlay(TimeStamp* startStamp, + TimeStamp* endStamp,char *buffer, int size); + + + AudioTime* getAudioTime(); + + int getPreferredDeliverSize(); + + // Video part + + int openWindow(int width, int height,const char *title); + int x11WindowId(); + void closeWindow(); + void flushWindow(); + + PictureArray* lockPictureArray(); + void unlockPictureArray(PictureArray* pictureArray); + + int getFrameusec(); + + void config(const char* key,const char* value,void* user_data); + + // Remote read extension + + int read(char** buffer,int bytes); + void forwardReadPtr(int bytes); + + // buffer control + int getBufferFillgrade(); + + // sync control + void setAudioBufferSize(int size); + + private: + void sendSignal(int state,int value); + void initStream(); + +}; +#endif -- cgit v1.2.1