1545
|
1 #ifndef DS_ALLOCATOR_H
|
|
2 #define DS_ALLOCATOR_H
|
168
|
3
|
|
4 #include "interfaces.h"
|
|
5 #include "cmediasample.h"
|
1545
|
6 #include "iunk.h"
|
|
7
|
168
|
8 #include <list>
|
713
|
9
|
1545
|
10 struct MemAllocator: public IMemAllocator
|
168
|
11 {
|
|
12 ALLOCATOR_PROPERTIES props;
|
713
|
13 std::list<CMediaSample*> used_list;
|
|
14 std::list<CMediaSample*> free_list;
|
|
15 char* new_pointer;
|
|
16 CMediaSample* modified_sample;
|
168
|
17 static GUID interfaces[];
|
|
18 DECLARE_IUNKNOWN(MemAllocator)
|
1545
|
19
|
168
|
20 MemAllocator();
|
1545
|
21 ~MemAllocator();
|
713
|
22 void SetPointer(char* pointer) { new_pointer=pointer; }
|
|
23 void ResetPointer()
|
|
24 {
|
1545
|
25 if (modified_sample)
|
713
|
26 {
|
|
27 modified_sample->ResetPointer();
|
|
28 modified_sample=0;
|
|
29 }
|
|
30 }
|
1545
|
31
|
|
32 static long CreateAllocator(GUID* clsid, GUID* iid, void** ppv);
|
168
|
33 };
|
|
34
|
1545
|
35 #endif /* DS_ALLOCATOR_H */
|