-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaw_omx_component.h
173 lines (144 loc) · 7.08 KB
/
aw_omx_component.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
/*
* Cedarx framework.
* Copyright (c) 2008-2015 Allwinner Technology Co. Ltd.
* Copyright (c) 2014 Ning Fang <[email protected]>
*
* This file is part of Cedarx.
*
* Cedarx is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This program is distributed "as is" WITHOUT ANY WARRANTY of any
* kind, whether express or implied; without even the implied warranty
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*/
/*============================================================================
O p e n M A X w r a p p e r s
O p e n M A X C o m p o n e n t I n t e r f a c e
*//** @file aw_omx_component.h
This module contains the abstract interface for the OpenMAX components.
*//*========================================================================*/
#ifndef AW_OMX_COMPONENT_H
#define AW_OMX_COMPONENT_H
//////////////////////////////////////////////////////////////////////////////
// Include Files
//////////////////////////////////////////////////////////////////////////////
#include "OMX_Core.h"
#include "OMX_Component.h"
class aw_omx_component
{
public:
/* single member to hold the vtable */
OMX_COMPONENTTYPE m_cmp;
public:
// this is critical, otherwise, sub class destructor will not be called
virtual ~aw_omx_component(){}
// Initialize the component after creation
virtual OMX_ERRORTYPE component_init(OMX_IN OMX_STRING componentName)=0;
/*******************************************************************/
/* Standard OpenMAX Methods */
/*******************************************************************/
// Query the component for its information
virtual
OMX_ERRORTYPE get_component_version(OMX_HANDLETYPE cmp_handle,
OMX_STRING cmp_name,
OMX_VERSIONTYPE* cmp_version,
OMX_VERSIONTYPE* spec_version,
OMX_UUIDTYPE* cmp_UUID)=0;
// Invoke a command on the component
virtual
OMX_ERRORTYPE send_command(OMX_HANDLETYPE cmp_handle,
OMX_COMMANDTYPE cmd,
OMX_U32 param1,
OMX_PTR cmd_data)=0;
// Get a Parameter setting from the component
virtual
OMX_ERRORTYPE get_parameter(OMX_HANDLETYPE cmp_handle,
OMX_INDEXTYPE param_index,
OMX_PTR param_data)=0;
// Send a parameter structure to the component
virtual
OMX_ERRORTYPE set_parameter(OMX_HANDLETYPE cmp_handle,
OMX_INDEXTYPE param_index,
OMX_PTR param_data)=0;
// Get a configuration structure from the component
virtual
OMX_ERRORTYPE get_config(OMX_HANDLETYPE cmp_handle,
OMX_INDEXTYPE config_index,
OMX_PTR config_data)=0;
// Set a component configuration value
virtual
OMX_ERRORTYPE set_config(OMX_HANDLETYPE cmp_handle,
OMX_INDEXTYPE config_index,
OMX_PTR config_data)=0;
// Translate the vendor specific extension string to
// standardized index type
virtual
OMX_ERRORTYPE get_extension_index(OMX_HANDLETYPE cmp_handle,
OMX_STRING paramName,
OMX_INDEXTYPE* indexType)=0;
// Get Current state information
virtual
OMX_ERRORTYPE get_state(OMX_HANDLETYPE cmp_handle,
OMX_STATETYPE* state)=0;
// Component Tunnel Request
virtual
OMX_ERRORTYPE component_tunnel_request(OMX_HANDLETYPE cmp_handle,
OMX_U32 port,
OMX_HANDLETYPE peer_component,
OMX_U32 peer_port,
OMX_TUNNELSETUPTYPE* tunnel_setup)=0;
// Use a buffer already allocated by the IL client
// or a buffer already supplied by a tunneled component
virtual
OMX_ERRORTYPE use_buffer(OMX_HANDLETYPE cmp_handle,
OMX_BUFFERHEADERTYPE** buffer_hdr,
OMX_U32 port,
OMX_PTR app_data,
OMX_U32 bytes,
OMX_U8* buffer)=0;
// Request that the component allocate new buffer and associated header
virtual
OMX_ERRORTYPE allocate_buffer(OMX_HANDLETYPE cmp_handle,
OMX_BUFFERHEADERTYPE** buffer_hdr,
OMX_U32 port,
OMX_PTR app_data,
OMX_U32 bytes)=0;
// Release the buffer and associated header from the component
virtual
OMX_ERRORTYPE free_buffer(OMX_HANDLETYPE cmp_handle,
OMX_U32 port,
OMX_BUFFERHEADERTYPE* buffer)=0;
// Send a filled buffer to an input port of a component
virtual
OMX_ERRORTYPE empty_this_buffer(OMX_HANDLETYPE cmp_handle,
OMX_BUFFERHEADERTYPE* buffer)=0;
// Send an empty buffer to an output port of a component
virtual
OMX_ERRORTYPE fill_this_buffer(OMX_HANDLETYPE cmp_handle,
OMX_BUFFERHEADERTYPE* buffer)=0;
// Set callbacks
virtual
OMX_ERRORTYPE set_callbacks( OMX_HANDLETYPE cmp_handle,
OMX_CALLBACKTYPE* callbacks,
OMX_PTR app_data)=0;
// Component De-Initialize
virtual
OMX_ERRORTYPE component_deinit( OMX_HANDLETYPE cmp_handle)=0;
// Use the Image already allocated via EGL
virtual
OMX_ERRORTYPE use_EGL_image(OMX_HANDLETYPE cmp_handle,
OMX_BUFFERHEADERTYPE** buffer_hdr,
OMX_U32 port,
OMX_PTR app_data,
void* egl_image)=0;
// Component Role enum
virtual
OMX_ERRORTYPE component_role_enum( OMX_HANDLETYPE cmp_handle,
OMX_U8* role,
OMX_U32 index)=0;
};
#endif /* AW_OMX_COMPONENT_H */