haiku/headers/os/media/BufferGroup.h
Murai Takashi 992ba1a5ce Media Kit: Fix -Wmismatched-tags
Replace struct with class, since it is previously declared as a class
in SharedBufferList.h
Pointed by clang  [-Wmismatched-tags]

Change-Id: I3ff4e285862f31a2088a773be2967102bc8b18b6
Reviewed-on: https://review.haiku-os.org/480
Reviewed-by: Barrett17 <b.vitruvio@gmail.com>
2018-08-25 15:23:52 +00:00

71 lines
1.5 KiB
C++

/*
* Copyright 2009, Haiku Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _BUFFER_GROUP_H
#define _BUFFER_GROUP_H
#include <MediaDefs.h>
class BBuffer;
namespace BPrivate {
class SharedBufferList;
}
class BBufferGroup {
public:
BBufferGroup(size_t size, int32 count = 3,
uint32 placement = B_ANY_ADDRESS,
uint32 lock = B_FULL_LOCK);
explicit BBufferGroup();
BBufferGroup(int32 count,
const media_buffer_id* buffers);
~BBufferGroup();
status_t InitCheck();
status_t AddBuffer(const buffer_clone_info& info,
BBuffer** _buffer = NULL);
BBuffer* RequestBuffer(size_t size,
bigtime_t timeout = B_INFINITE_TIMEOUT);
status_t RequestBuffer(BBuffer* buffer,
bigtime_t timeout = B_INFINITE_TIMEOUT);
status_t RequestError();
status_t CountBuffers(int32* _count);
status_t GetBufferList(int32 bufferCount,
BBuffer** _buffers);
status_t WaitForBuffers();
status_t ReclaimAllBuffers();
private:
// deprecated BeOS R4 API
status_t AddBuffersTo(BMessage* message, const char* name,
bool needLock);
BBufferGroup(const BBufferGroup& other);
BBufferGroup& operator=(const BBufferGroup& other);
status_t _Init();
private:
friend class BPrivate::SharedBufferList;
status_t fInitError;
status_t fRequestError;
int32 fBufferCount;
BPrivate::SharedBufferList* fBufferList;
sem_id fReclaimSem;
uint32 _reserved[9];
};
#endif // _BUFFER_GROUP_H