annotate loader/dshow/allocator.h @ 1764:a9e51734ea00

ehh. sizeof(pointer) bug fixed...
author arpi
date Wed, 29 Aug 2001 22:01:04 +0000
parents da26060c81ef
children 213b35f84cf3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
1 #ifndef DS_ALLOCATOR_H
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
2 #define DS_ALLOCATOR_H
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
3
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
4 #include "interfaces.h"
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
5 #include "cmediasample.h"
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
6 #include "iunk.h"
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
7
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
8 #include <list>
713
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
9
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
10 struct MemAllocator: public IMemAllocator
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
11 {
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
12 ALLOCATOR_PROPERTIES props;
713
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
13 std::list<CMediaSample*> used_list;
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
14 std::list<CMediaSample*> free_list;
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
15 char* new_pointer;
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
16 CMediaSample* modified_sample;
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
17 static GUID interfaces[];
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
18 DECLARE_IUNKNOWN(MemAllocator)
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
19
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
20 MemAllocator();
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
21 ~MemAllocator();
713
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
22 void SetPointer(char* pointer) { new_pointer=pointer; }
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
23 void ResetPointer()
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
24 {
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
25 if (modified_sample)
713
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
26 {
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
27 modified_sample->ResetPointer();
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
28 modified_sample=0;
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
29 }
9355b2ae634e avifile-0.6-CVS merge
arpi_esp
parents: 168
diff changeset
30 }
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
31
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
32 static long CreateAllocator(GUID* clsid, GUID* iid, void** ppv);
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
33 };
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
34
1545
da26060c81ef big avifile sync - from now we have common code
arpi
parents: 713
diff changeset
35 #endif /* DS_ALLOCATOR_H */