OpenMAX Bellagio  0.9.3
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)) {
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;
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;
79 
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 
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 }
OMX_ERRORTYPE
Definition: OMX_Core.h:127
@ OMX_ErrorInsufficientResources
Definition: OMX_Core.h:131
@ OMX_ErrorNone
Definition: OMX_Core.h:128
unsigned long OMX_U32
Definition: OMX_Types.h:145
OMX_BOOL
Definition: OMX_Types.h:189
@ OMX_TRUE
Definition: OMX_Types.h:191
@ OMX_FALSE
Definition: OMX_Types.h:190
@ OMX_PortDomainImage
Definition: OMX_Component.h:53
@ OMX_IMAGE_CodingUnused
Definition: OMX_Image.h:54
void setHeader(OMX_PTR header, OMX_U32 size)
Simply fills the first two fields in any OMX structure with the size and the version.
#define DEFAULT_IN_BUFFER_SIZE
#define DEFAULT_OUT_BUFFER_SIZE
#define DEFAULT_MIME_STRING_LENGTH
OMX_ERRORTYPE base_image_port_Constructor(OMX_COMPONENTTYPE *openmaxStandComp, omx_base_PortType **openmaxStandPort, OMX_U32 nPortIndex, OMX_BOOL isInput)
The base constructor for the generic OpenMAX ST Image port.
OMX_ERRORTYPE base_image_port_Destructor(omx_base_PortType *openmaxStandPort)
The base image port destructor for the generic OpenMAX ST Image port.
OMX_ERRORTYPE base_port_Constructor(OMX_COMPONENTTYPE *openmaxStandComp, omx_base_PortType **openmaxStandPort, OMX_U32 nPortIndex, OMX_BOOL isInput)
The base contructor for the generic OpenMAX ST port.
Definition: omx_base_port.c:55
OMX_ERRORTYPE base_port_Destructor(omx_base_PortType *openmaxStandPort)
The base destructor for the generic OpenMAX ST port.
#define DEB_LEV_FUNCTION_NAME
#define DEB_LEV_ERR
#define DEBUG(n, fmt, args...)
OMX_ERRORTYPE err
OMX_IMAGE_CODINGTYPE eCompressionFormat
Definition: OMX_Image.h:145
OMX_NATIVE_DEVICETYPE pNativeRender
Definition: OMX_Image.h:113
OMX_IMAGE_CODINGTYPE eCompressionFormat
Definition: OMX_Image.h:119
union OMX_PARAM_PORTDEFINITIONTYPE::@0 format
OMX_PORTDOMAINTYPE eDomain
Definition: OMX_Component.h:77
OMX_IMAGE_PORTDEFINITIONTYPE image
Definition: OMX_Component.h:81
OMX_PARAM_PORTDEFINITIONTYPE sPortParam
OMX_PARAM_PORTDEFINITIONTYPE sPortParam
OMX_IMAGE_PARAM_PORTFORMATTYPE sImageParam
OMX_ERRORTYPE(* PortDestructor)(omx_base_PortType *openmaxStandPort)

Generated for OpenMAX Bellagio rel. 0.9.3 by  doxygen 1.5.1
SourceForge.net Logo