haiku/headers/private/codec/FormatManager.h
Barrett17 b4d8bbd540 Codec Kit: Move Managers to private headers
* Those classes are not ready for public consumption. Ideally,
I'd add a well designed BCodecRoster wrapping them. This is part
of the general cleanup I am doing to get the code in a good state
before going to finalize the design.
* I don't plan to reintroduce BMediaFile in the media2 API, and
I'd like to remove any (explicit) usage of entry_refs and things
like that.
* I plan to introduce BMetaData and BMediaFormat which is going
to be different than what we do now.
* We need to explicitly use the mime type when it's available and
it is another design consideration when CodecRoster will be introduced.
2018-11-18 13:15:35 +01:00

50 lines
1.0 KiB
C++

/*
* Copyright 2004-2009, Haiku, Inc. All rights reserved.
* Distributed under the terms of the MIT license.
*
* Authors:
* Axel Dörfler
* Marcus Overhagen
*/
#ifndef _FORMAT_MANAGER_H
#define _FORMAT_MANAGER_H
#include <Locker.h>
#include <ObjectList.h>
#include <pthread.h>
#include "MetaFormat.h"
class FormatManager {
public:
~FormatManager();
void GetFormats(bigtime_t lastUpdate, BMessage& reply);
status_t MakeFormatFor(
const media_format_description* descriptions,
int32 descriptionCount,
media_format& format, uint32 flags,
void* _reserved);
void RemoveFormat(const media_format& format);
static FormatManager* GetInstance();
private:
FormatManager();
static void CreateInstance();
private:
typedef BPrivate::media::meta_format meta_format;
BObjectList<meta_format> fList;
BLocker fLock;
bigtime_t fLastUpdate;
int32 fNextCodecID;
static FormatManager* sInstance;
static pthread_once_t sInitOnce;
};
#endif // _FORMAT_MANAGER_H