本文整理汇总了C++中PortVideo::GetPortDefinition方法的典型用法代码示例。如果您正苦于以下问题:C++ PortVideo::GetPortDefinition方法的具体用法?C++ PortVideo::GetPortDefinition怎么用?C++ PortVideo::GetPortDefinition使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PortVideo
的用法示例。
在下文中一共展示了PortVideo::GetPortDefinition方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: PrepareConfigBuffer
OMX_ERRORTYPE OMXVideoDecoderBase::PrepareConfigBuffer(VideoConfigBuffer *p) {
// default config buffer preparation
memset(p, 0, sizeof(VideoConfigBuffer));
const OMX_PARAM_PORTDEFINITIONTYPE *paramPortDefinitionInput = this->ports[INPORT_INDEX]->GetPortDefinition();
if (paramPortDefinitionInput == NULL) {
return OMX_ErrorBadParameter;
}
if (mWorkingMode == GRAPHICBUFFER_MODE) {
p->surfaceNumber = mOMXBufferHeaderTypePtrNum;
for (int i = 0; i < mOMXBufferHeaderTypePtrNum; i++){
OMX_BUFFERHEADERTYPE *buffer_hdr = mOMXBufferHeaderTypePtrArray[i];
p->graphicBufferHandler[i] = buffer_hdr->pBuffer;
ALOGV("PrepareConfigBuffer bufferid = %p, handle = %p", buffer_hdr, buffer_hdr->pBuffer);
}
p->flag |= USE_NATIVE_GRAPHIC_BUFFER;
p->graphicBufferStride = mGraphicBufferParam.graphicBufferStride;
p->graphicBufferColorFormat = mGraphicBufferParam.graphicBufferColorFormat;
p->graphicBufferWidth = mGraphicBufferParam.graphicBufferWidth;
p->graphicBufferHeight = mGraphicBufferParam.graphicBufferHeight;
if (p->graphicBufferColorFormat == OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar_Tiled
#ifdef USE_GEN_HW
|| p->graphicBufferColorFormat == HAL_PIXEL_FORMAT_NV12_X_TILED_INTEL
#endif
)
p->flag |= USE_TILING_MEMORY;
if (mEnableAdaptivePlayback)
p->flag |= WANT_ADAPTIVE_PLAYBACK;
PortVideo *port = NULL;
port = static_cast<PortVideo *>(this->ports[INPORT_INDEX]);
OMX_PARAM_PORTDEFINITIONTYPE port_def;
memcpy(&port_def, port->GetPortDefinition(), sizeof(port_def));
if (port_def.format.video.pNativeWindow != NULL) {
p->nativeWindow = port_def.format.video.pNativeWindow;
ALOGD("NativeWindow = %p", p->nativeWindow);
}
}
p->rotationDegrees = mRotationDegrees;
#ifdef TARGET_HAS_VPP
p->vppBufferNum = mVppBufferNum;
#endif
p->width = paramPortDefinitionInput->format.video.nFrameWidth;
p->height = paramPortDefinitionInput->format.video.nFrameHeight;
return OMX_ErrorNone;
}
示例2: SetStoreMetaDataInBuffers
OMX_ERRORTYPE OMXVideoEncoderBase::SetStoreMetaDataInBuffers(OMX_PTR pStructure) {
OMX_ERRORTYPE ret;
StoreMetaDataInBuffersParams *p = (StoreMetaDataInBuffersParams *)pStructure;
VideoParamsStoreMetaDataInBuffers StoreMetaDataInBuffers;
PortVideo *port = static_cast<PortVideo *>(this->ports[INPORT_INDEX]);
CHECK_TYPE_HEADER(p);
CHECK_PORT_INDEX(p, INPORT_INDEX);
LOGD("SetStoreMetaDataInBuffers (enabled = %x)", p->bStoreMetaData);
if(mStoreMetaDataInBuffers == p->bStoreMetaData)
return OMX_ErrorNone;
StoreMetaDataInBuffers.isEnabled = p->bStoreMetaData;
if (mVideoEncoder->setParameters(&StoreMetaDataInBuffers) != ENCODE_SUCCESS)
return OMX_ErrorNotReady;
mStoreMetaDataInBuffers = p->bStoreMetaData;
if(mStoreMetaDataInBuffers){
// for input port buffer
OMX_PARAM_PORTDEFINITIONTYPE *paramPortDefinitionInput;
const OMX_PARAM_PORTDEFINITIONTYPE *paramPortDefinitionInput_get;
paramPortDefinitionInput_get = port->GetPortDefinition();
paramPortDefinitionInput = (OMX_PARAM_PORTDEFINITIONTYPE *)paramPortDefinitionInput_get;
paramPortDefinitionInput->nBufferSize = IntelMetadataBuffer::GetMaxBufferSize();
}
else
{
const OMX_PARAM_PORTDEFINITIONTYPE *paramPortDefinitionInput_get;
paramPortDefinitionInput_get = port->GetPortDefinition();
port->SetPortDefinition(paramPortDefinitionInput_get, true);
}
LOGD("SetStoreMetaDataInBuffers success");
return OMX_ErrorNone;
};
示例3: mCheckBufferAvailable
bool OMXVideoDecoderVP9Hybrid::IsAllBufferAvailable(void) {
bool b = ComponentBase::IsAllBufferAvailable();
if (b == false) {
return false;
}
PortVideo *port = NULL;
port = static_cast<PortVideo *>(this->ports[OUTPORT_INDEX]);
const OMX_PARAM_PORTDEFINITIONTYPE* port_def = port->GetPortDefinition();
// if output port is disabled, retain the input buffer
if (!port_def->bEnabled) {
return false;
}
return mCheckBufferAvailable(mHybridCtx);
}
示例4: SetNativeBufferModeSpecific
OMX_ERRORTYPE OMXVideoDecoderBase::SetNativeBufferModeSpecific(OMX_PTR pStructure) {
OMX_ERRORTYPE ret;
EnableAndroidNativeBuffersParams *param = (EnableAndroidNativeBuffersParams*)pStructure;
CHECK_TYPE_HEADER(param);
CHECK_PORT_INDEX_RANGE(param);
CHECK_SET_PARAM_STATE();
PortVideo *port = NULL;
port = static_cast<PortVideo *>(this->ports[OUTPORT_INDEX]);
OMX_PARAM_PORTDEFINITIONTYPE port_def;
memcpy(&port_def,port->GetPortDefinition(),sizeof(port_def));
if (!param->enable) {
mWorkingMode = RAWDATA_MODE;
// If it is fallback from native mode the color format has been
// already set to INTEL format.
// We need to set back the default color format and Native stuff.
port_def.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
port_def.format.video.pNativeRender = NULL;
port_def.format.video.pNativeWindow = NULL;
port->SetPortDefinition(&port_def,true);
return OMX_ErrorNone;
}
mWorkingMode = GRAPHICBUFFER_MODE;
port_def.nBufferCountMin = mNativeBufferCount;
if (mEnableAdaptivePlayback) {
SetMaxOutputBufferCount(&port_def);
} else {
port_def.nBufferCountActual = mNativeBufferCount;
}
port_def.format.video.cMIMEType = (OMX_STRING)VA_VED_RAW_MIME_TYPE;
port_def.format.video.eColorFormat = OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar;
port_def.format.video.nFrameHeight = (port_def.format.video.nFrameHeight + 0x1f) & ~0x1f;
port_def.format.video.eColorFormat = GetOutputColorFormat(
port_def.format.video.nFrameWidth);
port->SetPortDefinition(&port_def,true);
return OMX_ErrorNone;
}