OpenMAXBellagio  0.9.3
omx_base_video_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 #include "omx_base_video_port.h"
32 
50 
51  omx_base_video_PortType *omx_base_video_Port;
52 
53  if (!(*openmaxStandPort)) {
54  *openmaxStandPort = calloc(1,sizeof (omx_base_video_PortType));
55  }
56 
57  if (!(*openmaxStandPort)) {
59  }
60 
61  base_port_Constructor(openmaxStandComp,openmaxStandPort,nPortIndex, isInput);
62 
63  omx_base_video_Port = (omx_base_video_PortType *)*openmaxStandPort;
64 
65  setHeader(&omx_base_video_Port->sVideoParam, sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE));
66  omx_base_video_Port->sVideoParam.nPortIndex = nPortIndex;
67  omx_base_video_Port->sVideoParam.nIndex = 0;
69  omx_base_video_Port->sVideoParam.eColorFormat = OMX_COLOR_FormatUnused;
70  omx_base_video_Port->sVideoParam.xFramerate = 15;
71 
72  omx_base_video_Port->sPortParam.eDomain = OMX_PortDomainVideo;
73  omx_base_video_Port->sPortParam.format.video.cMIMEType = malloc(DEFAULT_MIME_STRING_LENGTH);
74  strcpy(omx_base_video_Port->sPortParam.format.video.cMIMEType, "raw/video");
75  omx_base_video_Port->sPortParam.format.video.pNativeRender = 0;
76  omx_base_video_Port->sPortParam.format.video.bFlagErrorConcealment = OMX_FALSE;
78 
79  omx_base_video_Port->sPortParam.format.video.nFrameWidth = 0;
80  omx_base_video_Port->sPortParam.format.video.nFrameHeight= 0;
81  omx_base_video_Port->sPortParam.format.video.nStride = 0;
82  omx_base_video_Port->sPortParam.format.video.nSliceHeight = 0;
83  omx_base_video_Port->sPortParam.format.video.nBitrate = 0;
84  omx_base_video_Port->sPortParam.format.video.xFramerate = 15;
86  omx_base_video_Port->sPortParam.format.video.pNativeWindow = NULL;
87 
88 
90 
91  omx_base_video_Port->PortDestructor = &base_video_port_Destructor;
92 
93  return OMX_ErrorNone;
94 }
95 
109 
110  if(openmaxStandPort->sPortParam.format.video.cMIMEType) {
111  free(openmaxStandPort->sPortParam.format.video.cMIMEType);
112  openmaxStandPort->sPortParam.format.video.cMIMEType = NULL;
113  }
114 
115  base_port_Destructor(openmaxStandPort);
116 
117  return OMX_ErrorNone;
118 }
omx_base_video_PortType::sPortParam
OMX_PARAM_PORTDEFINITIONTYPE sPortParam
Definition: omx_base_video_port.h:48
OMX_VIDEO_PORTDEFINITIONTYPE::nStride
OMX_S32 nStride
Definition: OMX_Video.h:129
omx_base_video_PortType
Definition: omx_base_video_port.h:44
OMX_VIDEO_PORTDEFINITIONTYPE::eColorFormat
OMX_COLOR_FORMATTYPE eColorFormat
Definition: OMX_Video.h:135
OMX_VIDEO_PARAM_PORTFORMATTYPE::eColorFormat
OMX_COLOR_FORMATTYPE eColorFormat
Definition: OMX_Video.h:161
omx_base_video_PortType::sVideoParam
OMX_VIDEO_PARAM_PORTFORMATTYPE sVideoParam
Definition: omx_base_video_port.h:48
OMX_VIDEO_PORTDEFINITIONTYPE::pNativeRender
OMX_NATIVE_DEVICETYPE pNativeRender
Definition: OMX_Video.h:126
OMX_VIDEO_PORTDEFINITIONTYPE::bFlagErrorConcealment
OMX_BOOL bFlagErrorConcealment
Definition: OMX_Video.h:133
OMX_ERRORTYPE
OMX_ERRORTYPE
Definition: OMX_Core.h:127
OMX_VIDEO_CodingUnused
@ OMX_VIDEO_CodingUnused
Definition: OMX_Video.h:62
OMX_U32
unsigned long OMX_U32
Definition: OMX_Types.h:145
OMX_TRUE
@ OMX_TRUE
Definition: OMX_Types.h:191
OMX_VIDEO_PARAM_PORTFORMATTYPE::eCompressionFormat
OMX_VIDEO_CODINGTYPE eCompressionFormat
Definition: OMX_Video.h:160
OMX_VIDEO_PARAM_PORTFORMATTYPE::xFramerate
OMX_U32 xFramerate
Definition: OMX_Video.h:162
OMX_Core.h
base_video_port_Constructor
OMX_ERRORTYPE base_video_port_Constructor(OMX_COMPONENTTYPE *openmaxStandComp, omx_base_PortType **openmaxStandPort, OMX_U32 nPortIndex, OMX_BOOL isInput)
The base contructor for the generic OpenMAX ST Video port.
Definition: omx_base_video_port.c:49
DEFAULT_MIME_STRING_LENGTH
#define DEFAULT_MIME_STRING_LENGTH
Definition: omx_base_component.h:60
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
omxcore.h
OMX_VIDEO_PORTDEFINITIONTYPE::cMIMEType
OMX_STRING cMIMEType
Definition: OMX_Video.h:125
OMX_VIDEO_PORTDEFINITIONTYPE::nFrameWidth
OMX_U32 nFrameWidth
Definition: OMX_Video.h:127
OMX_Component.h
OMX_PARAM_PORTDEFINITIONTYPE::format
union OMX_PARAM_PORTDEFINITIONTYPE::@0 format
MAX_VIDEO_OUTPUT_BUF_SIZE
#define MAX_VIDEO_OUTPUT_BUF_SIZE
Definition: omx_base_video_port.h:34
DEFAULT_IN_BUFFER_SIZE
#define DEFAULT_IN_BUFFER_SIZE
Definition: omx_base_component.h:56
OMX_VIDEO_PARAM_PORTFORMATTYPE::nIndex
OMX_U32 nIndex
Definition: OMX_Video.h:159
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_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
OSCL_EXPORT_REF
#define OSCL_EXPORT_REF
Definition: omx_base_component.h:43
OMX_PARAM_PORTDEFINITIONTYPE::video
OMX_VIDEO_PORTDEFINITIONTYPE video
Definition: OMX_Component.h:80
OMX_VIDEO_PORTDEFINITIONTYPE::xFramerate
OMX_U32 xFramerate
Definition: OMX_Video.h:132
OMX_VIDEO_PARAM_PORTFORMATTYPE::nPortIndex
OMX_U32 nPortIndex
Definition: OMX_Video.h:158
OMX_VIDEO_PORTDEFINITIONTYPE::eCompressionFormat
OMX_VIDEO_CODINGTYPE eCompressionFormat
Definition: OMX_Video.h:134
OMX_FALSE
@ OMX_FALSE
Definition: OMX_Types.h:190
OMX_COLOR_FormatUnused
@ OMX_COLOR_FormatUnused
Definition: OMX_IVCommon.h:89
OMX_VIDEO_PARAM_PORTFORMATTYPE
Definition: OMX_Video.h:155
omx_base_PortType::sPortParam
OMX_PARAM_PORTDEFINITIONTYPE sPortParam
Definition: omx_base_port.h:142
OMX_VIDEO_PORTDEFINITIONTYPE::pNativeWindow
OMX_NATIVE_WINDOWTYPE pNativeWindow
Definition: OMX_Video.h:136
OMX_ErrorNone
@ OMX_ErrorNone
Definition: OMX_Core.h:128
OMX_VIDEO_PORTDEFINITIONTYPE::nSliceHeight
OMX_U32 nSliceHeight
Definition: OMX_Video.h:130
base_video_port_Destructor
OMX_ERRORTYPE base_video_port_Destructor(omx_base_PortType *openmaxStandPort)
The base video port destructor for the generic OpenMAX ST Video port.
Definition: omx_base_video_port.c:108
OMX_VIDEO_PORTDEFINITIONTYPE::nFrameHeight
OMX_U32 nFrameHeight
Definition: OMX_Video.h:128
OMX_VIDEO_PORTDEFINITIONTYPE::nBitrate
OMX_U32 nBitrate
Definition: OMX_Video.h:131
omx_base_video_PortType::PortDestructor
OMX_ERRORTYPE(* PortDestructor)(omx_base_PortType *openmaxStandPort)
Definition: omx_base_video_port.h:48
omx_base_video_port.h
OMX_PortDomainVideo
@ OMX_PortDomainVideo
Definition: OMX_Component.h:52
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