vfs: check userland buffers before reading them.
[haiku.git] / src / apps / mediaplayer / media_node_framework / audio / AudioSupplier.h
blobae54cf352fe25f2055cd92dc25cdeab68bef541a
1 /* Copyright 2000-2008, Ingo Weinhold <ingo_weinhold@gmx.de>,
2 * All Rights Reserved. Distributed under the terms of the MIT license.
3 */
4 #ifndef AUDIO_SUPPLIER_H
5 #define AUDIO_SUPPLIER_H
8 /*! This class is an interface used by the AudioProducer to retreive the
9 audio data to be played. */
12 #include <MediaDefs.h>
15 class AudioProducer;
17 class AudioSupplier {
18 public:
19 AudioSupplier();
20 virtual ~AudioSupplier();
22 virtual void SetAudioProducer(AudioProducer* producer);
24 virtual status_t InitCheck() const;
26 virtual bigtime_t InitialLatency() const = 0;
28 virtual status_t GetFrames(void* buffer, int64 frameCount,
29 bigtime_t startTime,
30 bigtime_t endTime) = 0;
32 virtual void SetFormat(const media_format& format) = 0;
34 protected:
35 AudioProducer* fAudioProducer;
39 #endif // AUDIO_SUPPLIER_H