Uncommented beaudio code
[pwlib.git] / src / ptlib / unix / beaudio / MediaRecorder.h
blob7cb13cb86cbfad69998463f8a12b3bc755096ddb
1 // MediaRecorder.h
2 // ---------------
3 // Copyright 1999, Be Incorporated. All Rights Reserved.
4 // This file may be used under the terms of the Be Sample Code License.
6 #if !defined(_MEDIA_RECORDER_H)
7 #define _MEDIA_RECORDER_H
9 #include <MediaDefs.h>
10 #include <Locker.h>
11 #include <MediaNode.h>
14 namespace BPrivate {
15 class BMediaRecorderNode;
18 class BMediaRecorder {
19 public:
21 /* Should static enumerator helpers go here? */
23 BMediaRecorder(
24 const char * name,
25 int32 priority = 0);
26 virtual ~BMediaRecorder();
27 status_t InitCheck();
29 status_t SetBufferHook(
30 void (*buffer_hook)(
31 void * cookie,
32 const void * data,
33 size_t size,
34 const media_header & header),
35 void *cookie);
37 void SetCookie(
38 void *cookie);
40 virtual void BufferReceived(
41 void * data,
42 size_t size,
43 const media_header & header);
45 status_t Connect(
46 const media_format & format,
47 uint32 flags = 0);
48 status_t Connect(
49 const dormant_node_info & info,
50 const media_format * format = 0,
51 uint32 flags = 0);
52 status_t Connect(
53 const media_node & node,
54 const media_output * use_output = 0,
55 const media_format * format = 0,
56 uint32 flags = 0);
57 status_t Disconnect();
58 status_t Start(
59 bool force = false);
60 status_t Stop(
61 bool force = false);
62 bool IsRunning();
63 bool IsConnected();
65 const media_node & Node();
66 const media_output &Input();
67 const media_input & Output();
68 const media_format &Format();
70 protected:
72 private:
75 // unimplemented constructors
76 BMediaRecorder();
77 BMediaRecorder(const BMediaRecorder &);
78 BMediaRecorder & operator=(const BMediaRecorder &);
80 friend class BPrivate::BMediaRecorderNode;
82 status_t _mInitErr;
83 BPrivate::BMediaRecorderNode *_mNode;
84 void (*_mBufferHook)(
85 void * cookie,
86 void * data,
87 size_t size,
88 const media_header & header);
89 void * _mBufferCookie;
90 media_node _mInputNode;
91 media_output _mInput;
92 media_node _mOutputNode;
93 media_input _mOutput;
94 bool _mConnected;
95 bool _mRunning;
96 BTimeSource * _mTimeSource;
98 status_t giga_connect(
99 const media_format * format,
100 uint32 flags,
101 const dormant_node_info * dormant,
102 const media_node * node,
103 const media_output * output);
107 #endif // _MEDIA_RECORDER_H