summaryrefslogtreecommitdiffstats
path: root/loader/dshow/allocator.h
blob: 1e9d7d5556a419cfc7b35e976ea3742629854dc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef DS_ALLOCATOR_H
#define DS_ALLOCATOR_H

#include "interfaces.h"
#include "cmediasample.h"
#include "iunk.h"

#include <list>

struct MemAllocator: public IMemAllocator
{
    ALLOCATOR_PROPERTIES props;
    std::list<CMediaSample*> used_list;
    std::list<CMediaSample*> free_list;
    char* new_pointer;
    CMediaSample* modified_sample;
    static GUID interfaces[];
    DECLARE_IUNKNOWN(MemAllocator)

    MemAllocator();
    ~MemAllocator();
    void SetPointer(char* pointer) { new_pointer=pointer; }
    void ResetPointer() 
    { 
	if (modified_sample)
	{
	    modified_sample->ResetPointer(); 
	    modified_sample=0;
	}
    }

    static long CreateAllocator(GUID* clsid, GUID* iid, void** ppv);
};

#endif /* DS_ALLOCATOR_H */