summaryrefslogtreecommitdiffstats
path: root/mpeglib/lib/output/threadSafeOutputStream.h
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commite2de64d6f1beb9e492daf5b886e19933c1fa41dd (patch)
tree9047cf9e6b5c43878d5bf82660adae77ceee097a /mpeglib/lib/output/threadSafeOutputStream.h
downloadtdemultimedia-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/output/threadSafeOutputStream.h')
-rw-r--r--mpeglib/lib/output/threadSafeOutputStream.h67
1 files changed, 67 insertions, 0 deletions
diff --git a/mpeglib/lib/output/threadSafeOutputStream.h b/mpeglib/lib/output/threadSafeOutputStream.h
new file mode 100644
index 00000000..c9852a37
--- /dev/null
+++ b/mpeglib/lib/output/threadSafeOutputStream.h
@@ -0,0 +1,67 @@
+/*
+ thread safe wrapper for output Stream
+ 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 __THREADSAFEOUTPUTSTREAM_H
+#define __THREADSAFEOUTPUTSTREAM_H
+
+// read INTRO in threadQueue.h
+// This class makes the outputStream (given in constructor)
+// threadsafe by wrapping each call with a threadqueue.
+//
+// Important NOTE: the output pointer is the owned by this class !!!
+// which means: we call delete on it!
+// More Important NOTES:
+//
+// We make the audio and video calls seperate threadsafe
+// and ONLY the config call threadsafe to both!
+
+#include "../util/abstract/threadQueue.h"
+#include "outputStream.h"
+
+
+class ThreadSafeOutputStream : public OutputStream {
+
+ ThreadQueue* threadQueueAudio;
+ ThreadQueue* threadQueueVideo;
+ OutputStream* output;
+
+ public:
+ ThreadSafeOutputStream(OutputStream* output);
+ ~ThreadSafeOutputStream();
+
+ // Thread safe Audio Stream handling
+ int audioInit();
+ int audioSetup(int freq,int stereo,int sign,int big,int sampleSize);
+ int audioPlay(TimeStamp* startStamp,
+ TimeStamp* endStamp,char *buffer, int size);
+ void audioFlush();
+ void audioClose();
+ void audioOpen();
+ int getPreferredDeliverSize();
+
+
+ // Video Output
+ int videoInit();
+ int openWindow(int width, int height,const char *title);
+ void closeWindow();
+ void flushWindow();
+ PictureArray* lockPictureArray();
+ void unlockPictureArray(PictureArray* pictureArray);
+ int getFrameusec();
+
+ // config Output
+ void config(const char* key,
+ const char* value,void* user_data);
+
+
+};
+#endif