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

« back to all changes in this revision

Viewing changes to mpeglib/lib/output/threadSafeOutputStream.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
  thread safe wrapper for output Stream
 
3
  Copyright (C) 2000  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
#ifndef __THREADSAFEOUTPUTSTREAM_H
 
14
#define __THREADSAFEOUTPUTSTREAM_H
 
15
 
 
16
// read INTRO in threadQueue.h
 
17
// This class makes the outputStream (given in constructor)
 
18
// threadsafe by wrapping each call with a threadqueue.
 
19
//
 
20
// Important NOTE: the output pointer is the owned by this class !!!
 
21
//                 which means: we call delete on it!
 
22
// More Important NOTES:
 
23
//
 
24
// We make the audio and video calls seperate threadsafe
 
25
// and ONLY the config call threadsafe to both!
 
26
 
 
27
#include "../util/abstract/threadQueue.h"
 
28
#include "outputStream.h"
 
29
 
 
30
 
 
31
class ThreadSafeOutputStream : public OutputStream {
 
32
 
 
33
  ThreadQueue* threadQueueAudio;
 
34
  ThreadQueue* threadQueueVideo;
 
35
  OutputStream* output;
 
36
 
 
37
 public:
 
38
  ThreadSafeOutputStream(OutputStream* output);
 
39
  ~ThreadSafeOutputStream();
 
40
 
 
41
  // Thread safe Audio Stream handling
 
42
  int audioInit();
 
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);  
 
46
  void audioFlush();
 
47
  void audioClose();
 
48
  void audioOpen();
 
49
  int getPreferredDeliverSize();
 
50
  
 
51
  
 
52
  // Video Output
 
53
  int videoInit();
 
54
  int openWindow(int width, int height,const char *title);
 
55
  void closeWindow();
 
56
  void flushWindow();
 
57
  PictureArray* lockPictureArray();
 
58
  void unlockPictureArray(PictureArray* pictureArray);
 
59
  int getFrameusec();
 
60
  
 
61
  // config Output
 
62
  void config(const char* key, 
 
63
              const char* value,void* user_data);
 
64
 
 
65
 
 
66
};
 
67
#endif