OpenMAXBellagio  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 }
DEB_LEV_FUNCTION_NAME
#define DEB_LEV_FUNCTION_NAME
Definition: omx_comp_debug_levels.h:59
omx_base_image_PortType::sPortParam
OMX_PARAM_PORTDEFINITIONTYPE sPortParam
Definition: omx_base_image_port.h:44
DEBUG
#define DEBUG(n, fmt, args...)
Definition: omx_comp_debug_levels.h:77
OMX_ERRORTYPE
OMX_ERRORTYPE
Definition: OMX_Core.h:127
omx_base_image_PortType::sImageParam
OMX_IMAGE_PARAM_PORTFORMATTYPE sImageParam
Definition: omx_base_image_port.h:44
OMX_U32
unsigned long OMX_U32
Definition: OMX_Types.h:145
OMX_TRUE
@ OMX_TRUE
Definition: OMX_Types.h:191
base_image_port_Constructor
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.
Definition: omx_base_image_port.c:51
OMX_IMAGE_PORTDEFINITIONTYPE::cMIMEType
OMX_STRING cMIMEType
Definition: OMX_Image.h:112
OMX_IMAGE_PARAM_PORTFORMATTYPE::nIndex
OMX_U32 nIndex
Definition: OMX_Image.h:144
OMX_Core.h
OMX_IMAGE_CodingUnused
@ OMX_IMAGE_CodingUnused
Definition: OMX_Image.h:54
OMX_IMAGE_PARAM_PORTFORMATTYPE
Definition: OMX_Image.h:140
DEB_LEV_ERR
#define DEB_LEV_ERR
Definition: omx_comp_debug_levels.h:39
DEFAULT_MIME_STRING_LENGTH
#define DEFAULT_MIME_STRING_LENGTH
Definition: omx_base_component.h:58
base_port_Constructor
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_PortDomainImage
@ OMX_PortDomainImage
Definition: OMX_Component.h:53
OMX_IMAGE_PARAM_PORTFORMATTYPE::nPortIndex
OMX_U32 nPortIndex
Definition: OMX_Image.h:143
omxcore.h
base_image_port_Destructor
OMX_ERRORTYPE base_image_port_Destructor(omx_base_PortType *openmaxStandPort)
The base image port destructor for the generic OpenMAX ST Image port.
Definition: omx_base_image_port.c:100
DEFAULT_OUT_BUFFER_SIZE
#define DEFAULT_OUT_BUFFER_SIZE
Definition: omx_base_component.h:56
OMX_Component.h
OMX_PARAM_PORTDEFINITIONTYPE::format
union OMX_PARAM_PORTDEFINITIONTYPE::@0 format
omx_base_image_PortType::PortDestructor
OMX_ERRORTYPE(* PortDestructor)(omx_base_PortType *openmaxStandPort)
Definition: omx_base_image_port.h:44
omx_base_component.h
DEFAULT_IN_BUFFER_SIZE
#define DEFAULT_IN_BUFFER_SIZE
Definition: omx_base_component.h:54
base_port_Destructor
OMX_ERRORTYPE base_port_Destructor(omx_base_PortType *openmaxStandPort)
The base destructor for the generic OpenMAX ST port.
Definition: omx_base_port.c:134
OMX_BOOL
OMX_BOOL
Definition: OMX_Types.h:189
omx_base_image_PortType
Definition: omx_base_image_port.h:40
OMX_PARAM_PORTDEFINITIONTYPE::eDomain
OMX_PORTDOMAINTYPE eDomain
Definition: OMX_Component.h:77
omx_base_PortType
Definition: omx_base_port.h:105
OMX_ErrorInsufficientResources
@ OMX_ErrorInsufficientResources
Definition: OMX_Core.h:131
OMX_COMPONENTTYPE
Definition: OMX_Component.h:308
OMX_PARAM_PORTDEFINITIONTYPE::nBufferSize
OMX_U32 nBufferSize
Definition: OMX_Component.h:68
OMX_PARAM_PORTDEFINITIONTYPE::image
OMX_IMAGE_PORTDEFINITIONTYPE image
Definition: OMX_Component.h:81
err
OMX_ERRORTYPE err
Definition: omxvolcontroltest.c:34
OMX_FALSE
@ OMX_FALSE
Definition: OMX_Types.h:190
OMX_IMAGE_PORTDEFINITIONTYPE::pNativeRender
OMX_NATIVE_DEVICETYPE pNativeRender
Definition: OMX_Image.h:113
omx_base_PortType::sPortParam
OMX_PARAM_PORTDEFINITIONTYPE sPortParam
Definition: omx_base_port.h:142
OMX_ErrorNone
@ OMX_ErrorNone
Definition: OMX_Core.h:128
OMX_IMAGE_PARAM_PORTFORMATTYPE::eCompressionFormat
OMX_IMAGE_CODINGTYPE eCompressionFormat
Definition: OMX_Image.h:145
OMX_IMAGE_PORTDEFINITIONTYPE::bFlagErrorConcealment
OMX_BOOL bFlagErrorConcealment
Definition: OMX_Image.h:118
omx_base_image_port.h
OMX_IMAGE_PORTDEFINITIONTYPE::eCompressionFormat
OMX_IMAGE_CODINGTYPE eCompressionFormat
Definition: OMX_Image.h:119
setHeader
void setHeader(OMX_PTR header, OMX_U32 size)
Simply fills the first two fields in any OMX structure with the size and the version.
Definition: omx_base_component.c:746

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