mirror of
https://review.haiku-os.org/haiku
synced 2025-02-15 18:18:57 +01:00
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10 a95241bf-73f2-0310-859d-f6bbb57e9c96
35 lines
786 B
C++
35 lines
786 B
C++
/***********************************************************************
|
|
* Copyright (c) 2002 Marcus Overhagen. All Rights Reserved.
|
|
* This file may be used under the terms of the OpenBeOS License.
|
|
*
|
|
* A cache for BBuffers to be received by
|
|
* BBufferConsumer::BufferReceived()
|
|
***********************************************************************/
|
|
#ifndef _BUFFER_ID_CACHE_H_
|
|
#define _BUFFER_ID_CACHE_H_
|
|
|
|
class _buffer_id_cache
|
|
{
|
|
public:
|
|
_buffer_id_cache();
|
|
~_buffer_id_cache();
|
|
|
|
BBuffer *GetBuffer(media_buffer_id id);
|
|
|
|
private:
|
|
enum { MAX_CACHED_BUFFER = 17 };
|
|
struct _buffer_id_info
|
|
{
|
|
BBuffer *buffer;
|
|
media_buffer_id id;
|
|
int32 last_used;
|
|
};
|
|
_buffer_id_info info[MAX_CACHED_BUFFER];
|
|
int32 in_use;
|
|
int32 used;
|
|
int32 stat_missed;
|
|
int32 stat_hit;
|
|
};
|
|
|
|
#endif
|