tcp: Fix 64 bit build with debugging features enabled.
[haiku.git] / src / kits / media / FormatManager.h
bloba99a674d1d3149c5e9fea9fc2ed467f1a7e46ece
1 /*
2 * Copyright 2004-2009, Haiku, Inc. All rights reserved.
3 * Distributed under the terms of the MIT license.
5 * Authors:
6 * Axel Dörfler
7 * Marcus Overhagen
8 */
9 #ifndef _FORMAT_MANAGER_H
10 #define _FORMAT_MANAGER_H
13 #include <Locker.h>
14 #include <ObjectList.h>
15 #include <pthread.h>
17 #include "MetaFormat.h"
20 class FormatManager {
21 public:
22 ~FormatManager();
24 void GetFormats(bigtime_t lastUpdate, BMessage& reply);
25 status_t MakeFormatFor(
26 const media_format_description* descriptions,
27 int32 descriptionCount,
28 media_format& format, uint32 flags,
29 void* _reserved);
30 void RemoveFormat(const media_format& format);
32 static FormatManager* GetInstance();
34 private:
35 FormatManager();
36 static void CreateInstance();
37 private:
38 typedef BPrivate::media::meta_format meta_format;
40 BObjectList<meta_format> fList;
41 BLocker fLock;
42 bigtime_t fLastUpdate;
43 int32 fNextCodecID;
45 static FormatManager* sInstance;
46 static pthread_once_t sInitOnce;
49 #endif // _FORMAT_MANAGER_H