2001-08-16 00:50:02 +00:00
|
|
|
#ifndef DS_ALLOCATOR_H
|
|
|
|
#define DS_ALLOCATOR_H
|
2001-03-20 00:05:27 +00:00
|
|
|
|
|
|
|
#include "interfaces.h"
|
|
|
|
#include "cmediasample.h"
|
|
|
|
#include "iunk.h"
|
2001-05-06 21:43:45 +00:00
|
|
|
|
2001-08-16 00:50:02 +00:00
|
|
|
#include <list>
|
|
|
|
|
|
|
|
struct MemAllocator: public IMemAllocator
|
2001-03-20 00:05:27 +00:00
|
|
|
{
|
|
|
|
ALLOCATOR_PROPERTIES props;
|
2001-05-06 21:43:45 +00:00
|
|
|
std::list<CMediaSample*> used_list;
|
|
|
|
std::list<CMediaSample*> free_list;
|
|
|
|
char* new_pointer;
|
|
|
|
CMediaSample* modified_sample;
|
2001-03-20 00:05:27 +00:00
|
|
|
static GUID interfaces[];
|
|
|
|
DECLARE_IUNKNOWN(MemAllocator)
|
2001-08-16 00:50:02 +00:00
|
|
|
|
2001-03-20 00:05:27 +00:00
|
|
|
MemAllocator();
|
2001-08-16 00:50:02 +00:00
|
|
|
~MemAllocator();
|
2001-05-06 21:43:45 +00:00
|
|
|
void SetPointer(char* pointer) { new_pointer=pointer; }
|
|
|
|
void ResetPointer()
|
|
|
|
{
|
2001-08-16 00:50:02 +00:00
|
|
|
if (modified_sample)
|
2001-05-06 21:43:45 +00:00
|
|
|
{
|
|
|
|
modified_sample->ResetPointer();
|
|
|
|
modified_sample=0;
|
|
|
|
}
|
|
|
|
}
|
2001-08-16 00:50:02 +00:00
|
|
|
|
|
|
|
static long CreateAllocator(GUID* clsid, GUID* iid, void** ppv);
|
2001-03-20 00:05:27 +00:00
|
|
|
};
|
|
|
|
|
2001-08-16 00:50:02 +00:00
|
|
|
#endif /* DS_ALLOCATOR_H */
|