|
1 /* |
|
2 * Copyright (c) 2010 Ixonos Plc. |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - Initial contribution |
|
11 * |
|
12 * Contributors: |
|
13 * Ixonos Plc |
|
14 * |
|
15 * Description: |
|
16 * Header file for the Video Decoder Engine image buffer store. |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef _VDEIMS_H_ |
|
22 #define _VDEIMS_H_ |
|
23 |
|
24 /* |
|
25 * Includes |
|
26 */ |
|
27 |
|
28 #include "list.h" |
|
29 #include "vdeimb.h" |
|
30 |
|
31 /* |
|
32 * Defines |
|
33 */ |
|
34 |
|
35 /* for the mode parameter of vdeImsGetReference */ |
|
36 #define VDEIMS_REF_TR 0 |
|
37 #define VDEIMS_REF_LATEST 1 |
|
38 #define VDEIMS_REF_OLDEST 2 |
|
39 |
|
40 |
|
41 /* |
|
42 * Typedefs |
|
43 */ |
|
44 |
|
45 /* {{-output"vdeImsItem_t_info.txt" -ignore"*" -noCR}} |
|
46 The image store item structure is used throughout the Image Store |
|
47 module to store individual image buffers. |
|
48 {{-output"vdeImsItem_t_info.txt"}} */ |
|
49 |
|
50 /* {{-output"vdeImsItem_t.txt"}} */ |
|
51 typedef struct { |
|
52 LST_ITEM_SKELETON |
|
53 |
|
54 vdeImb_t *imb; /* pointer to image buffer structure */ |
|
55 } vdeImsItem_t; |
|
56 /* {{-output"vdeImsItem_t.txt"}} */ |
|
57 |
|
58 |
|
59 /* {{-output"vdeIms_t_info.txt" -ignore"*" -noCR}} |
|
60 vdeIms_t defines the structure of an image buffer store. |
|
61 A pointer to this structure is passed to the VDE Image Store module |
|
62 functions to indicate the image store instance which the functions should |
|
63 handle. One should not access the members of this structure directly |
|
64 but rather always use the provided access functions. |
|
65 {{-output"vdeIms_t_info.txt"}} */ |
|
66 |
|
67 /* {{-output"vdeIms_t.txt"}} */ |
|
68 typedef struct { |
|
69 lst_t freeStoreList; /* a list of "Free" stores each of which is |
|
70 carrying frames with a certain (unique) |
|
71 size */ |
|
72 |
|
73 vdeImsItem_t *refFrame; /* refFrame is a pointer to |
|
74 the latest reference (INTRA or INTER) frame */ |
|
75 |
|
76 lst_t idleStore; /* a list of non-referenced but to-be-displayed |
|
77 image store items */ |
|
78 int fYuvNeeded; |
|
79 |
|
80 } vdeIms_t; |
|
81 /* {{-output"vdeIms_t.txt"}} */ |
|
82 |
|
83 |
|
84 /* |
|
85 * Function prototypes |
|
86 */ |
|
87 |
|
88 int vdeImsChangeReference(vdeIms_t *store, vdeImsItem_t *newItem); |
|
89 |
|
90 int vdeImsClose(vdeIms_t *store); |
|
91 |
|
92 int vdeImsDebRefStore(vdeIms_t *store); |
|
93 |
|
94 int vdeImsFromRenderer(vdeIms_t *store, void *drawItem); |
|
95 |
|
96 int vdeImsGetFree(vdeIms_t *store, int lumWidth, int lumHeight, |
|
97 vdeImsItem_t **item); |
|
98 |
|
99 int vdeImsGetReference(vdeIms_t *store, int mode, int tr, vdeImsItem_t **item); |
|
100 |
|
101 int vdeImsOpen(vdeIms_t *store, int numFreeItems, int lumWidth, int lumHeight); |
|
102 |
|
103 void vdeImsSetYUVNeed(vdeIms_t *store, int fYuvNeeded); |
|
104 |
|
105 int vdeImsPut(vdeIms_t *store, vdeImsItem_t *item); |
|
106 |
|
107 int vdeImsPutFree(vdeIms_t *store, vdeImsItem_t *item); |
|
108 |
|
109 int vdeImsReleaseReference(vdeIms_t *store, vdeImsItem_t *item); |
|
110 |
|
111 |
|
112 |
|
113 /* |
|
114 * Macros |
|
115 */ |
|
116 |
|
117 /* Note: vdeImsImageBufferToStoreItem and vdeImsStoreItemToImageBuffer |
|
118 need not be used since it is considered that the vdeImsItem_t structure |
|
119 is public and one can directly refer the image buffer to as pImsItem->imb. |
|
120 However, these macros exist to provide compatibility to some "old" code. */ |
|
121 |
|
122 /* |
|
123 * vdeImsImageBufferToStoreItem |
|
124 * |
|
125 * Parameters: |
|
126 * vdeImb_t *buffer a pointer to an image buffer |
|
127 * vdeImsItem_t *storeItem a pointer to a image store item |
|
128 * |
|
129 * Function: |
|
130 * This macro associates the given image buffer with the given |
|
131 * image store item. |
|
132 * |
|
133 * Returns: |
|
134 * >= 0 if successful |
|
135 * < 0 indicating an error |
|
136 * |
|
137 */ |
|
138 |
|
139 #define vdeImsImageBufferToStoreItem(buffer, storeItem) ((storeItem)->imb = (buffer), 0) |
|
140 |
|
141 |
|
142 /* |
|
143 * vdeImsStoreItemToImageBuffer |
|
144 * |
|
145 * Parameters: |
|
146 * vdeImsItem_t *storeItem a pointer to a image store item |
|
147 * vdeImb_t **buffer a pointer to an image buffer pointer |
|
148 * |
|
149 * Function: |
|
150 * This macro returns the pointer to the image buffer associated with |
|
151 * the given image store item. |
|
152 * |
|
153 * Returns: |
|
154 * >= 0 if successful |
|
155 * < 0 indicating an error |
|
156 * |
|
157 */ |
|
158 |
|
159 #define vdeImsStoreItemToImageBuffer(storeItem, buffer) (*(buffer) = (storeItem)->imb, 0) |
|
160 |
|
161 |
|
162 #endif |
|
163 // End of File |