vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / media / media-add-ons / demultiplexer / MediaOutputInfo.h
blobc1f58d7abf9583bc5f3b149ef45b9b11333f51ea
1 // MediaOutputInfo.h
2 //
3 // Andrew Bachmann, 2002
4 //
5 // A class to encapsulate and manipulate
6 // all the information for a particular
7 // output of a media node.
9 #if !defined(_MEDIA_OUTPUT_INFO_H)
10 #define _MEDIA_OUTPUT_INFO_H
12 #include <MediaDefs.h>
13 #include <MediaNode.h>
14 #include <BufferProducer.h>
15 #include <BufferGroup.h>
17 class MediaOutputInfo
19 public:
20 MediaOutputInfo(BBufferProducer * _node, char * name);
21 ~MediaOutputInfo();
23 virtual status_t SetBufferGroup(BBufferGroup * group);
25 virtual status_t FormatProposal(media_format * format);
27 virtual status_t FormatChangeRequested(
28 const media_destination & destination,
29 media_format * io_format);
31 virtual status_t PrepareToConnect(
32 const media_destination & where,
33 media_format * format,
34 media_source * out_source,
35 char * out_name);
37 virtual status_t Connect(
38 const media_destination & destination,
39 const media_format & format,
40 char * io_name,
41 bigtime_t _downstreamLatency);
43 virtual status_t Disconnect();
45 virtual status_t EnableOutput(bool enabled);
47 virtual status_t AdditionalBufferRequested(
48 media_buffer_id prev_buffer,
49 bigtime_t prev_time,
50 const media_seek_tag * prev_tag);
52 protected:
54 virtual status_t CreateBufferGroup();
56 public:
58 virtual uint32 ComputeBufferSize();
59 virtual bigtime_t ComputeBufferPeriod();
60 static uint32 ComputeBufferSize(const media_format & format);
61 static bigtime_t ComputeBufferPeriod(const media_format & format);
63 public:
64 BBufferProducer * producer;
66 media_output output;
68 bool outputEnabled;
70 BBufferGroup * bufferGroup;
71 size_t bufferSize;
73 bigtime_t downstreamLatency;
75 bigtime_t bufferPeriod;
77 // This format is the least restrictive we can
78 // support in the general case. (no restrictions
79 // based on content)
80 media_format generalFormat;
82 // This format is the next least restrictive. It
83 // takes into account the content that we are using.
84 // It should be the same as above with a few wildcards
85 // removed. Wildcards for things we are flexible on
86 // may still be present.
87 media_format wildcardedFormat;
89 // This format provides default values for all fields.
90 // These defaults are used to resolve all wildcards.
91 media_format fullySpecifiedFormat;
93 // do we need media_seek_tag in here?
96 #endif // _MEDIA_OUTPUT_INFO_H