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.
8
9#if !defined(_MEDIA_OUTPUT_INFO_H)
10#define _MEDIA_OUTPUT_INFO_H
11
12#include <MediaDefs.h>
13#include <MediaNode.h>
14#include <BufferProducer.h>
15#include <BufferGroup.h>
16
17class MediaOutputInfo
18{
19public:
20	MediaOutputInfo(BBufferProducer * _node, char * name);
21	~MediaOutputInfo();
22
23virtual status_t SetBufferGroup(BBufferGroup * group);
24
25virtual status_t FormatProposal(media_format * format);
26
27virtual status_t FormatChangeRequested(
28					const media_destination & destination,
29					media_format * io_format);
30
31virtual status_t PrepareToConnect(
32					const media_destination & where,
33					media_format * format,
34					media_source * out_source,
35					char * out_name);
36
37virtual status_t Connect(
38					const media_destination & destination,
39					const media_format & format,
40					char * io_name,
41				 	bigtime_t _downstreamLatency);
42
43virtual status_t Disconnect();
44
45virtual status_t EnableOutput(bool enabled);
46
47virtual status_t AdditionalBufferRequested(
48					media_buffer_id prev_buffer,
49					bigtime_t prev_time,
50					const media_seek_tag * prev_tag);
51
52protected:
53
54virtual status_t CreateBufferGroup();
55
56public:
57
58virtual uint32 ComputeBufferSize();
59virtual bigtime_t ComputeBufferPeriod();
60static uint32 ComputeBufferSize(const media_format & format);
61static bigtime_t ComputeBufferPeriod(const media_format & format);
62
63public:
64	BBufferProducer * producer;
65
66	media_output output;
67
68	bool outputEnabled;
69
70	BBufferGroup * bufferGroup;
71	size_t bufferSize;
72
73	bigtime_t downstreamLatency;
74
75	bigtime_t bufferPeriod;
76
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;
81
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;
88
89	// This format provides default values for all fields.
90	// These defaults are used to resolve all wildcards.
91	media_format fullySpecifiedFormat;
92
93	// do we need media_seek_tag in here?
94};
95
96#endif // _MEDIA_OUTPUT_INFO_H
97
98