Uncommented beaudio code
[pwlib.git] / src / ptlib / unix / beaudio / MediaRecorderNode.h
blob88b49463af1c2d036b2bf5c3e57ff6717983cb5a
1 // MediaRecorderNode.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_NODE_H)
7 #define _MEDIA_RECORDER_NODE_H
9 #include <MediaEventLooper.h>
10 #include <BufferConsumer.h>
11 #include <String.h>
13 class BMediaRecorder;
15 namespace BPrivate {
17 class BMediaRecorderNode : public BMediaEventLooper, public BBufferConsumer {
18 public:
19 BMediaRecorderNode(
20 const char * name,
21 BMediaRecorder * rec,
22 int32 priority);
24 // these are not thread safe; we should fix that...
25 void SetOKFormat(
26 const media_format & format);
27 status_t GetInput(
28 media_input * out_input);
30 #if 0
31 thread_id ThreadID()
33 return BMediaEventLooper::ControlThread();
35 #endif
36 void SetDataEnabled(
37 bool enabled);
39 protected:
41 virtual BMediaAddOn*AddOn(
42 int32 * internal_id) const;
44 virtual void HandleEvent(
45 const media_timed_event *event,
46 bigtime_t lateness,
47 bool realTimeEvent);
49 virtual status_t HandleMessage(
50 int32 message,
51 const void * data,
52 size_t size);
54 /* Someone, probably the producer, is asking you about this format. Give */
55 /* your honest opinion, possibly modifying *format. Do not ask upstream */
56 /* producer about the format, since he's synchronously waiting for your */
57 /* reply. */
58 virtual status_t AcceptFormat(
59 const media_destination & dest,
60 media_format * format);
61 virtual status_t GetNextInput(
62 int32 * cookie,
63 media_input * out_input);
64 virtual void DisposeInputCookie(
65 int32 cookie);
66 virtual void BufferReceived(
67 BBuffer * buffer);
68 virtual void ProducerDataStatus(
69 const media_destination & for_whom,
70 int32 status,
71 bigtime_t at_performance_time);
72 virtual status_t GetLatencyFor(
73 const media_destination & for_whom,
74 bigtime_t * out_latency,
75 media_node_id * out_timesource);
76 virtual status_t Connected(
77 const media_source & producer,
78 const media_destination & where,
79 const media_format & with_format,
80 media_input * out_input);
81 virtual void Disconnected(
82 const media_source & producer,
83 const media_destination & where);
84 virtual status_t FormatChanged(
85 const media_source & producer,
86 const media_destination & consumer,
87 int32 change_tag,
88 const media_format & format);
90 protected:
92 virtual ~BMediaRecorderNode();
94 BMediaRecorder * _mRecorder;
95 media_format _mOKFormat;
96 media_input _mInput;
97 BString _mName;
102 using namespace BPrivate;
104 #endif // _MEDIA_RECORDER_NODE_H