2 * Copyright 2004-2009, Haiku. All rights reserved.
3 * Distributed under the terms of the MIT license.
8 * Stephan Aßmus <superstippi@gmx.de>
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"
22 #include "DecoderPlugin.h"
23 #include "EncoderPlugin.h"
24 #include "ReaderPlugin.h"
25 #include "StreamerPlugin.h"
26 #include "WriterPlugin.h"
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
,
56 status_t
GetFileFormat(media_file_format
* _fileFormat
,
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();
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
,
85 entry_ref
* _decoderRef
);
87 bool _FindEncoder(const media_format
& format
,
89 entry_ref
* _decoderRef
);
91 void _GetReaders(const BPath
& path
,
92 entry_ref
* outRefs
, int32
* outCount
,
103 struct decoder_info
{
105 List
<media_format
> formats
;
107 struct encoder_info
{
110 media_codec_info codecInfo
;
111 media_format_family formatFamily
;
112 media_format intputFormat
;
113 media_format outputFormat
;
115 struct streamer_info
{
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
;
135 } // namespace BPrivate
137 #endif // _ADD_ON_MANAGER_H