2002-10-09 03:59:43 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2002, Marcus Overhagen. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
2002-07-09 16:24:59 +04:00
|
|
|
struct _shared_buffer_list;
|
|
|
|
|
|
|
|
class BufferManager
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
BufferManager();
|
|
|
|
~BufferManager();
|
|
|
|
|
|
|
|
area_id SharedBufferListID();
|
|
|
|
|
|
|
|
status_t RegisterBuffer(team_id teamid, media_buffer_id bufferid,
|
|
|
|
size_t *size, int32 *flags, size_t *offset, area_id *area);
|
|
|
|
|
|
|
|
status_t RegisterBuffer(team_id teamid, size_t size, int32 flags, size_t offset, area_id area,
|
|
|
|
media_buffer_id *bufferid);
|
|
|
|
|
|
|
|
status_t UnregisterBuffer(team_id teamid, media_buffer_id bufferid);
|
2002-11-24 03:27:09 +03:00
|
|
|
|
|
|
|
void CleanupTeam(team_id teamid);
|
2002-07-09 16:24:59 +04:00
|
|
|
|
|
|
|
void PrintToStream();
|
|
|
|
|
|
|
|
private:
|
|
|
|
struct _team_list
|
|
|
|
{
|
|
|
|
struct _team_list *next;
|
|
|
|
team_id team;
|
|
|
|
};
|
|
|
|
struct _buffer_list
|
|
|
|
{
|
|
|
|
struct _buffer_list *next;
|
|
|
|
media_buffer_id id;
|
|
|
|
area_id area;
|
|
|
|
size_t offset;
|
|
|
|
size_t size;
|
|
|
|
int32 flags;
|
|
|
|
_team_list *teams;
|
|
|
|
};
|
|
|
|
_shared_buffer_list * fSharedBufferList;
|
|
|
|
area_id fAreaId;
|
|
|
|
_buffer_list * fBufferList;
|
|
|
|
BLocker * fLocker;
|
|
|
|
media_buffer_id fNextBufferId;
|
|
|
|
};
|
|
|
|
|