bin/pc: Mark non-returning function as void
[haiku.git] / src / kits / media / AddOnManager.h
blobb947fc5d7b235f9d222ad23ed99fe5bdf735c32f
1 /*
2 * Copyright 2004-2009, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT license.
5 * Authors:
6 * Marcus Overhagen
7 * Axel Dörfler
8 * Stephan Aßmus <superstippi@gmx.de>
9 */
10 #ifndef _ADD_ON_MANAGER_H
11 #define _ADD_ON_MANAGER_H
14 /*! Manager for codec add-ons (reader, writer, encoder, decoder)
15 BMediaAddOn are handled in the NodeManager
19 #include "DataExchange.h"
20 #include "TList.h"
22 #include "DecoderPlugin.h"
23 #include "EncoderPlugin.h"
24 #include "ReaderPlugin.h"
25 #include "StreamerPlugin.h"
26 #include "WriterPlugin.h"
29 namespace BPrivate {
30 namespace media {
32 class AddOnManager {
33 public:
34 AddOnManager();
35 ~AddOnManager();
37 static AddOnManager* GetInstance();
39 status_t GetDecoderForFormat(entry_ref* _ref,
40 const media_format& format);
42 status_t GetEncoderForFormat(entry_ref* _ref,
43 const media_format& outputFormat);
45 status_t GetReaders(entry_ref* _ref,
46 int32* _count, int32 maxCount);
48 status_t GetStreamers(entry_ref* _ref,
49 int32* _count, int32 maxCount);
51 status_t GetEncoder(entry_ref* _ref, int32 id);
53 status_t GetWriter(entry_ref* _ref,
54 uint32 internalID);
56 status_t GetFileFormat(media_file_format* _fileFormat,
57 int32 cookie);
58 status_t GetCodecInfo(media_codec_info* _codecInfo,
59 media_format_family* _formatFamily,
60 media_format* _inputFormat,
61 media_format* _outputFormat, int32 cookie);
63 void RegisterAddOns();
65 private:
67 status_t _RegisterAddOn(const entry_ref& ref);
68 status_t _UnregisterAddOn(const entry_ref& ref);
70 void _RegisterReader(ReaderPlugin* reader,
71 const entry_ref& ref);
72 void _RegisterDecoder(DecoderPlugin* decoder,
73 const entry_ref& ref);
75 void _RegisterWriter(WriterPlugin* writer,
76 const entry_ref& ref);
77 void _RegisterEncoder(EncoderPlugin* encoder,
78 const entry_ref& ref);
80 void _RegisterStreamer(StreamerPlugin* streamer,
81 const entry_ref& ref);
83 bool _FindDecoder(const media_format& format,
84 const BPath& path,
85 entry_ref* _decoderRef);
87 bool _FindEncoder(const media_format& format,
88 const BPath& path,
89 entry_ref* _decoderRef);
91 void _GetReaders(const BPath& path,
92 entry_ref* outRefs, int32* outCount,
93 int32 maxCount);
95 private:
96 struct reader_info {
97 entry_ref ref;
99 struct writer_info {
100 entry_ref ref;
101 uint32 internalID;
103 struct decoder_info {
104 entry_ref ref;
105 List<media_format> formats;
107 struct encoder_info {
108 entry_ref ref;
109 uint32 internalID;
110 media_codec_info codecInfo;
111 media_format_family formatFamily;
112 media_format intputFormat;
113 media_format outputFormat;
115 struct streamer_info {
116 entry_ref ref;
119 BLocker fLock;
120 List<reader_info> fReaderList;
121 List<writer_info> fWriterList;
122 List<decoder_info> fDecoderList;
123 List<encoder_info> fEncoderList;
124 List<streamer_info> fStreamerList;
126 List<media_file_format> fWriterFileFormats;
128 uint32 fNextWriterFormatFamilyID;
129 uint32 fNextEncoderCodecInfoID;
131 static AddOnManager sInstance;
134 } // namespace media
135 } // namespace BPrivate
137 #endif // _ADD_ON_MANAGER_H