tcp: Fix 64 bit build with debugging features enabled.
[haiku.git] / src / kits / media / AddOnManager.h
blob964cdcefbc371ae5cb2d8188cca0bb4f29d0ac12
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 "WriterPlugin.h"
28 namespace BPrivate {
29 namespace media {
31 class AddOnManager {
32 public:
33 AddOnManager();
34 ~AddOnManager();
36 static AddOnManager* GetInstance();
38 status_t GetDecoderForFormat(entry_ref* _ref,
39 const media_format& format);
41 status_t GetReaders(entry_ref* _ref,
42 int32* _count, int32 maxCount);
44 status_t GetEncoder(entry_ref* _ref, int32 id);
46 status_t GetWriter(entry_ref* _ref,
47 uint32 internalID);
49 status_t GetFileFormat(media_file_format* _fileFormat,
50 int32 cookie);
51 status_t GetCodecInfo(media_codec_info* _codecInfo,
52 media_format_family* _formatFamily,
53 media_format* _inputFormat,
54 media_format* _outputFormat, int32 cookie);
56 void RegisterAddOns();
58 private:
60 status_t _RegisterAddOn(const entry_ref& ref);
61 status_t _UnregisterAddOn(const entry_ref& ref);
63 void _RegisterReader(ReaderPlugin* reader,
64 const entry_ref& ref);
65 void _RegisterDecoder(DecoderPlugin* decoder,
66 const entry_ref& ref);
68 void _RegisterWriter(WriterPlugin* writer,
69 const entry_ref& ref);
70 void _RegisterEncoder(EncoderPlugin* encoder,
71 const entry_ref& ref);
73 bool _FindDecoder(const media_format& format,
74 const BPath& path,
75 entry_ref* _decoderRef);
76 void _GetReaders(const BPath& path,
77 entry_ref* outRefs, int32* outCount,
78 int32 maxCount);
80 private:
81 struct reader_info {
82 entry_ref ref;
84 struct writer_info {
85 entry_ref ref;
86 uint32 internalID;
88 struct decoder_info {
89 entry_ref ref;
90 List<media_format> formats;
92 struct encoder_info {
93 entry_ref ref;
94 uint32 internalID;
95 media_codec_info codecInfo;
96 media_format_family formatFamily;
97 media_format intputFormat;
98 media_format outputFormat;
101 BLocker fLock;
102 List<reader_info> fReaderList;
103 List<writer_info> fWriterList;
104 List<decoder_info> fDecoderList;
105 List<encoder_info> fEncoderList;
107 List<media_file_format> fWriterFileFormats;
109 uint32 fNextWriterFormatFamilyID;
110 uint32 fNextEncoderCodecInfoID;
112 static AddOnManager sInstance;
115 } // namespace media
116 } // namespace BPrivate
118 #endif // _ADD_ON_MANAGER_H