OSDN Git Service

original
[gb-231r1-is01/Gingerbread_2.3.3_r1_IS01.git] / hardware / ti / omap3 / libopencorehw / buffer_alloc_omap34xx.h
1 /*
2  * OMAP3430 support
3  *
4  * Author: Michael Barabanov <michael.barabanov@windriver.com>
5  * Author: Srini Gosangi <srini.gosangi@windriver.com>
6
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  *      http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
16  * express or implied.
17  * See the License for the specific language governing permissions
18  */
19
20 /* ------------------------------------------------------------------
21  * Copyright (C) 2008 PacketVideo
22  *
23  * Licensed under the Apache License, Version 2.0 (the "License");
24  * you may not use this file except in compliance with the License.
25  * You may obtain a copy of the License at
26  *
27  *      http://www.apache.org/licenses/LICENSE-2.0
28  *
29  * Unless required by applicable law or agreed to in writing, software
30  * distributed under the License is distributed on an "AS IS" BASIS,
31  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
32  * express or implied.
33  * See the License for the specific language governing permissions
34  * and limitations under the License.
35  * -------------------------------------------------------------------
36  */
37
38
39 #ifndef BUFFER_ALLOC_OMAP34XXH_INCLUDED
40 #define BUFFER_ALLOC_OMAP34XXH_INCLUDED
41
42 #include "pv_interface.h"
43
44 #ifndef PVMF_FIXEDSIZE_BUFFER_ALLOC_H_INCLUDED
45 #include "pvmf_fixedsize_buffer_alloc.h"
46 #endif
47
48 /* based on test code in pvmi/media_io/pvmiofileoutput/include/pvmi_media_io_fileoutput.h */
49
50 class BufferAllocOmap34xx: public PVInterface, public PVMFFixedSizeBufferAlloc
51 {
52     public:
53
54         BufferAllocOmap34xx();
55
56         virtual ~BufferAllocOmap34xx();
57
58         OSCL_IMPORT_REF void addRef();
59
60         OSCL_IMPORT_REF void removeRef();
61
62         OSCL_IMPORT_REF bool queryInterface(const PVUuid& uuid, PVInterface*& aInterface) ;
63
64         OSCL_IMPORT_REF OsclAny* allocate();
65
66         OSCL_IMPORT_REF void deallocate(OsclAny* ptr) ;
67
68         OSCL_IMPORT_REF uint32 getBufferSize() ;
69
70         OSCL_IMPORT_REF uint32 getNumBuffers() ;
71
72     public:
73         int32 refCount;
74         int32 bufferSize;
75         int32 maxBuffers;
76         int32 numAllocated;
77         uint8** buffer_address;
78 };
79
80 #endif