OpenMAXBellagio
0.9.3
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
omx_base_image_port.c
Go to the documentation of this file.
1
26
#include <string.h>
27
#include <unistd.h>
28
#include <
omxcore.h
>
29
#include <
OMX_Core.h
>
30
#include <
OMX_Component.h
>
31
32
#include "
omx_base_component.h
"
33
#include "
omx_base_image_port.h
"
34
51
OMX_ERRORTYPE
base_image_port_Constructor
(
OMX_COMPONENTTYPE
*openmaxStandComp,
omx_base_PortType
**openmaxStandPort,
OMX_U32
nPortIndex,
OMX_BOOL
isInput) {
52
53
omx_base_image_PortType
*omx_base_image_Port;
54
55
DEBUG
(
DEB_LEV_FUNCTION_NAME
,
"In %s of component %p\n"
, __func__, openmaxStandComp);
56
if
(!(*openmaxStandPort)) {
57
*openmaxStandPort = calloc(1,
sizeof
(
omx_base_image_PortType
));
58
}
59
60
if
(!(*openmaxStandPort)) {
61
return
OMX_ErrorInsufficientResources
;
62
}
63
64
base_port_Constructor
(openmaxStandComp,openmaxStandPort,nPortIndex, isInput);
65
66
omx_base_image_Port = (
omx_base_image_PortType
*)*openmaxStandPort;
67
68
setHeader
(&omx_base_image_Port->
sImageParam
,
sizeof
(
OMX_IMAGE_PARAM_PORTFORMATTYPE
));
69
omx_base_image_Port->
sImageParam
.
nPortIndex
= nPortIndex;
70
omx_base_image_Port->
sImageParam
.
nIndex
= 0;
71
omx_base_image_Port->
sImageParam
.
eCompressionFormat
=
OMX_IMAGE_CodingUnused
;
72
73
omx_base_image_Port->
sPortParam
.
eDomain
=
OMX_PortDomainImage
;
74
omx_base_image_Port->
sPortParam
.
format
.
image
.
cMIMEType
= malloc(
DEFAULT_MIME_STRING_LENGTH
);
75
strcpy(omx_base_image_Port->
sPortParam
.
format
.
image
.
cMIMEType
,
"raw/image"
);
76
omx_base_image_Port->
sPortParam
.
format
.
image
.
pNativeRender
= 0;
77
omx_base_image_Port->
sPortParam
.
format
.
image
.
bFlagErrorConcealment
=
OMX_FALSE
;
78
omx_base_image_Port->
sPortParam
.
format
.
image
.
eCompressionFormat
=
OMX_IMAGE_CodingUnused
;
79
80
omx_base_image_Port->
sPortParam
.
nBufferSize
= (isInput ==
OMX_TRUE
)?
DEFAULT_IN_BUFFER_SIZE
:
DEFAULT_OUT_BUFFER_SIZE
;
81
82
omx_base_image_Port->
PortDestructor
= &
base_image_port_Destructor
;
83
84
DEBUG
(
DEB_LEV_FUNCTION_NAME
,
"Out of %s of component %p\n"
, __func__, openmaxStandComp);
85
return
OMX_ErrorNone
;
86
}
87
100
OMX_ERRORTYPE
base_image_port_Destructor
(
omx_base_PortType
*openmaxStandPort){
101
OMX_ERRORTYPE
err
;
102
DEBUG
(
DEB_LEV_FUNCTION_NAME
,
"In %s of port %p\n"
, __func__, openmaxStandPort);
103
if
(openmaxStandPort->
sPortParam
.
format
.
image
.
cMIMEType
) {
104
free(openmaxStandPort->
sPortParam
.
format
.
image
.
cMIMEType
);
105
openmaxStandPort->
sPortParam
.
format
.
image
.
cMIMEType
= NULL;
106
}
107
108
err =
base_port_Destructor
(openmaxStandPort);
109
if
(err !=
OMX_ErrorNone
) {
110
DEBUG
(
DEB_LEV_ERR
,
"In %s base port destructor failed\n"
, __func__);
111
return
err
;
112
}
113
DEBUG
(
DEB_LEV_FUNCTION_NAME
,
"Out of %s of port %p\n"
, __func__, openmaxStandPort);
114
return
OMX_ErrorNone
;
115
}
Generated for OpenMAX Bellagio rel. 0.9.3 by
1.5.1