2
thread safe wrapper for output Stream
3
Copyright (C) 2000 Martin Vogt
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.
9
For more information look at the file COPYRIGHT in this package
13
#ifndef __THREADSAFEOUTPUTSTREAM_H
14
#define __THREADSAFEOUTPUTSTREAM_H
16
// read INTRO in threadQueue.h
17
// This class makes the outputStream (given in constructor)
18
// threadsafe by wrapping each call with a threadqueue.
20
// Important NOTE: the output pointer is the owned by this class !!!
21
// which means: we call delete on it!
22
// More Important NOTES:
24
// We make the audio and video calls seperate threadsafe
25
// and ONLY the config call threadsafe to both!
27
#include "../util/abstract/threadQueue.h"
28
#include "outputStream.h"
31
class ThreadSafeOutputStream : public OutputStream {
33
ThreadQueue* threadQueueAudio;
34
ThreadQueue* threadQueueVideo;
38
ThreadSafeOutputStream(OutputStream* output);
39
~ThreadSafeOutputStream();
41
// Thread safe Audio Stream handling
43
int audioSetup(int freq,int stereo,int sign,int big,int sampleSize);
44
int audioPlay(TimeStamp* startStamp,
45
TimeStamp* endStamp,char *buffer, int size);
49
int getPreferredDeliverSize();
54
int openWindow(int width, int height,const char *title);
57
PictureArray* lockPictureArray();
58
void unlockPictureArray(PictureArray* pictureArray);
62
void config(const char* key,
63
const char* value,void* user_data);