annotate loader/dshow/allocator.h @ 168:bdc4a8fc04d8

Initial revision
author arpi_esp
date Tue, 20 Mar 2001 00:05:27 +0000
parents
children 9355b2ae634e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
168
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
1 #ifndef ALLOCATOR_H
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
2 #define ALLOCATOR_H
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"
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
6 #include <list>
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
7 #include "iunk.h"
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
8 #include "default.h"
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
9 using namespace std;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
10 class MemAllocator: public IMemAllocator
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
11 {
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
12 ALLOCATOR_PROPERTIES props;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
13 list<CMediaSample*> used_list;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
14 list<CMediaSample*> free_list;
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
15 static GUID interfaces[];
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
16 DECLARE_IUNKNOWN(MemAllocator)
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
17 public:
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
18 MemAllocator();
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
19 ~MemAllocator(){delete vt;}
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
20 static long CreateAllocator(GUID* clsid, GUID* iid, void** ppv);
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
21
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
22 static HRESULT STDCALL SetProperties (
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
23 IMemAllocator * This,
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
24 /* [in] */ ALLOCATOR_PROPERTIES *pRequest,
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
25 /* [out] */ ALLOCATOR_PROPERTIES *pActual);
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
26
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
27 static HRESULT STDCALL GetProperties (
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
28 IMemAllocator * This,
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
29 /* [out] */ ALLOCATOR_PROPERTIES *pProps);
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
30
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
31 static HRESULT STDCALL Commit (
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
32 IMemAllocator * This);
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
33
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
34 static HRESULT STDCALL Decommit (
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
35 IMemAllocator * This);
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
36
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
37 static HRESULT STDCALL GetBuffer (
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
38 IMemAllocator * This,
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
39 /* [out] */ IMediaSample **ppBuffer,
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
40 /* [in] */ REFERENCE_TIME *pStartTime,
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
41 /* [in] */ REFERENCE_TIME *pEndTime,
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
42 /* [in] */ DWORD dwFlags);
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
43
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
44 static HRESULT STDCALL ReleaseBuffer (
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
45 IMemAllocator * This,
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
46 /* [in] */ IMediaSample *pBuffer);
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
47 };
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
48
bdc4a8fc04d8 Initial revision
arpi_esp
parents:
diff changeset
49 #endif