• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ OMX_INIT_STRUCT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中OMX_INIT_STRUCT函数的典型用法代码示例。如果您正苦于以下问题:C++ OMX_INIT_STRUCT函数的具体用法?C++ OMX_INIT_STRUCT怎么用?C++ OMX_INIT_STRUCT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了OMX_INIT_STRUCT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: fsl_osal_strcpy

WmaDec::WmaDec()
{
    fsl_osal_strcpy((fsl_osal_char*)name, "OMX.Freescale.std.audio_decoder.wma.sw-based");
    ComponentVersion.s.nVersionMajor = 0x0;
    ComponentVersion.s.nVersionMinor = 0x1;
    ComponentVersion.s.nRevision = 0x0;
    ComponentVersion.s.nStep = 0x0;
    role_cnt = 1;
    role[0] = (OMX_STRING)"audio_decoder.wma";
    codingType = OMX_AUDIO_CodingWMA;
    outputPortBufferSize = WMA_OUTPUT_PORT_SIZE;
    decoderLibName = "lib_wma10d_wrap_arm12_elinux_android.so";

    OMX_INIT_STRUCT(&WmaType, OMX_AUDIO_PARAM_WMATYPE);
    OMX_INIT_STRUCT(&WmaTypeExt, OMX_AUDIO_PARAM_WMATYPE_EXT);

    WmaType.nPortIndex = AUDIO_FILTER_INPUT_PORT;
    WmaType.nChannels = 2;
    WmaType.nSamplingRate = 44100;
    WmaType.nBitRate = 64000;
    WmaType.eFormat = OMX_AUDIO_WMAFormat9;

    WmaTypeExt.nPortIndex = AUDIO_FILTER_INPUT_PORT;
    WmaTypeExt.nBitsPerSample = 16;

    LOG_DEBUG("Unia -> WMA");

}
开发者ID:FreeSrk,项目名称:omx,代码行数:28,代码来源:WmaDec.cpp


示例2: fsl_osal_strcpy

AC3ToIEC937::AC3ToIEC937()
{
    fsl_osal_strcpy((fsl_osal_char*)name, "OMX.Freescale.std.audio_processor.ac3toiec937.sw-based");
    ComponentVersion.s.nVersionMajor = 0x0;
    ComponentVersion.s.nVersionMinor = 0x1;
    ComponentVersion.s.nRevision = 0x0;
    ComponentVersion.s.nStep = 0x0;
    role_cnt = 1;
    role[0] = (OMX_STRING)"audio_processor.ac3toiec937";
    bInContext = OMX_FALSE;
    nInBufferSize = IN_BUFFER_SIZE;
    nOutBufferSize = OUT_BUFFER_SIZE;
    eInCodingType = (OMX_AUDIO_CODINGTYPE)OMX_AUDIO_CodingAC3;
    OMX_INIT_STRUCT(&Ac3Type, OMX_AUDIO_PARAM_AC3TYPE);
    Ac3Type.nPortIndex = AUDIO_FILTER_INPUT_PORT;
    Ac3Type.nChannels = 2;
    Ac3Type.nSampleRate = 48000;
    Ac3Type.nBitRate = 128*1024;
    bFirstFrame = OMX_TRUE;
    bSwitchWord = OMX_FALSE;

    OMX_INIT_STRUCT(&PcmMode, OMX_AUDIO_PARAM_PCMMODETYPE);
    PcmMode.nPortIndex = AUDIO_FILTER_OUTPUT_PORT;
    PcmMode.nChannels = 2;
    PcmMode.nSamplingRate = 48000;
    PcmMode.nBitPerSample = 16;
    PcmMode.bInterleaved = OMX_TRUE;
    PcmMode.eNumData = OMX_NumericalDataSigned;
    PcmMode.ePCMMode = OMX_AUDIO_PCMModeLinear;
    PcmMode.eEndian = OMX_EndianLittle;
    PcmMode.eChannelMapping[0] = OMX_AUDIO_ChannelNone;
}
开发者ID:FreeSrk,项目名称:omx,代码行数:32,代码来源:AC3ToIEC937.cpp


示例3: OMX_ConfigureDynamicPFramesInH264E

static OMX_ERRORTYPE OMX_ConfigureDynamicPFramesInH264E( OMX_HANDLETYPE hComponent,
	OMX_BUFFERHEADERTYPE * pBufferHdr,  OMX_U32 nCurrentFrameRate,  OMX_U32 nTargetFrameRate)
{
	OMX_ERRORTYPE eError = OMX_ErrorNone;
	OMX_U32 remainder = 0;
	OMX_U16 nTargetPFrames =0; /* Target Pframes to be provided to Encoder */
	OMX_U16 nCurrentPFrames = 0; /* Current pFrame Value configured to  Encoder */
	OMX_VIDEO_CONFIG_AVCINTRAPERIOD tPframeH264e;
	OMX_VIDEO_PARAM_AVCTYPE h264type;
	OMX_COMPONENTTYPE *pHandle;
	if (hComponent == NULL){
		DOMX_ERROR("Component is invalid/ not present ");
		return OMX_ErrorBadParameter;
	}
	pHandle = (OMX_COMPONENTTYPE *) hComponent;

	/* Initialise the OMX structures */
	OMX_INIT_STRUCT(tPframeH264e, OMX_VIDEO_CONFIG_AVCINTRAPERIOD);
	OMX_INIT_STRUCT(h264type,OMX_VIDEO_PARAM_AVCTYPE);

	/* Read number of B Frames if not read yet */
	if(!nBFrames){
		h264type.nPortIndex = 1;
		eError = pHandle->GetParameter(hComponent,OMX_IndexParamVideoAvc,&h264type);
		if(eError != OMX_ErrorNone) {
			DOMX_ERROR(" Error while reading component info = %d",eError);
			return eError;
		}
		nBFrames = h264type.nBFrames;
	}

	/* Read Current pFrames set in Encoder */
	tPframeH264e.nPortIndex = 1;
	eError = pHandle->GetConfig(hComponent,OMX_IndexConfigVideoAVCIntraPeriod,&tPframeH264e);
	if(eError != OMX_ErrorNone) {
		DOMX_ERROR(" Error while Getting PFrame info, Error code = %d",eError);
		return eError;
	}
	nCurrentPFrames = tPframeH264e.nPFrames;

	/* Calculate Target P Frames */
	nTargetPFrames = (nCurrentPFrames * nTargetFrameRate) /nCurrentFrameRate;
	/* Number of pFrames should be multiple of (B FRAMES + 1) */
	remainder = nTargetPFrames % (nBFrames + 1);
	nTargetPFrames = nTargetPFrames - remainder;
	if(nTargetPFrames == nCurrentPFrames){
		DOMX_INFO(" No Change in P Frames, No Update required");
		return OMX_ErrorNone;
	}

	/* Update the new PFrames to the Encoder */
	tPframeH264e.nPFrames = nTargetPFrames;
	eError = pHandle->SetConfig(hComponent,OMX_IndexConfigVideoAVCIntraPeriod,&tPframeH264e);
	if(eError != OMX_ErrorNone) {
		DOMX_ERROR(" Error while setting PFrame info, Error code = %d",eError);
	}
	return eError;
}
开发者ID:ioz9,项目名称:lewa_code_hardware,代码行数:58,代码来源:android_omx_proxy_enc.c


示例4: load_component

OMX_ERRORTYPE load_component(HTEST *hTest)
{
	OMX_ERRORTYPE ret = OMX_ErrorNone;
	OMX_HANDLETYPE hComponent = NULL;
	OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
	OMX_U32 i;

	ret = OMX_GetHandle(&hComponent, hTest->name, hTest, &gCallBacks);
	if(ret != OMX_ErrorNone)
	{
		printf("Load component %s failed.\n", hTest->name);
		return ret;
	}

	hTest->hComponent = (OMX_COMPONENTTYPE*)hComponent;
	hTest->nPorts = get_component_ports(hComponent);
	OMX_INIT_STRUCT(&sPortDef, OMX_PARAM_PORTDEFINITIONTYPE);
	for(i=0; i<hTest->nPorts; i++)
	{
		sPortDef.nPortIndex = i;
		OMX_GetParameter(hComponent, OMX_IndexParamPortDefinition, &sPortDef);
		if (sPortDef.eDomain == OMX_PortDomainAudio)
			hTest->nAudioTrackNum = i;
		if (sPortDef.eDomain == OMX_PortDomainVideo)
			hTest->nVideoTrackNum = i;

		hTest->PortDir[i] = sPortDef.eDir;
		if(hTest->PortDir[i] == OMX_DirInput)
			hTest->bAllocater[i] = OMX_FALSE;
		if(hTest->PortDir[i] == OMX_DirOutput)
			hTest->bAllocater[i] = OMX_TRUE;
	}
	OMX_PARAM_CONTENTURITYPE *content = NULL;

	content =(OMX_PARAM_CONTENTURITYPE *) fsl_osal_malloc_new(sizeof(OMX_PARAM_CONTENTURITYPE) + 1024);
	if (!content)
		return OMX_ErrorInsufficientResources;

	fsl_osal_memset(content, 0 , sizeof(OMX_PARAM_CONTENTURITYPE)+1024);
	OMX_INIT_STRUCT(content,OMX_PARAM_CONTENTURITYPE);
	char* uri = (char*)&(content->contentURI);
	fsl_osal_memcpy(uri, hTest->media_name, strlen(hTest->media_name)+1);

	ret = OMX_SetParameter(hTest->hComponent,OMX_IndexParamContentURI,content);
	if (ret != OMX_ErrorNone)
	{
		OMX_FreeHandle(hTest->hComponent);
		hTest->hComponent = NULL;
		return ret;
	}




	fsl_osal_thread_create(&hTest->pThreadId, NULL, process_thread, hTest);

	return OMX_ErrorNone;
}
开发者ID:hicks0074,项目名称:freescale_omx_framework,代码行数:58,代码来源:parser_test.cpp


示例5: OMX_INIT_STRUCT

OMX_ERRORTYPE VideoFilter::PortFormatChanged(OMX_U32 nPortIndex)
{
    OMX_PARAM_PORTDEFINITIONTYPE sPortDef;

    OMX_INIT_STRUCT(&sPortDef, OMX_PARAM_PORTDEFINITIONTYPE);

    if(nPortIndex == IN_PORT)
    {
        sPortDef.nPortIndex = IN_PORT;
        ports[IN_PORT]->GetPortDefinition(&sPortDef);
        //fsl_osal_memcpy(&sInFmt, &(sPortDef.format.video), sizeof(OMX_VIDEO_PORTDEFINITIONTYPE));
        sInFmt.nFrameWidth = sPortDef.format.video.nFrameWidth;
        sInFmt.nFrameHeight = sPortDef.format.video.nFrameHeight;
        sInFmt.eCompressionFormat = sPortDef.format.video.eCompressionFormat;
        sInFmt.eColorFormat = sPortDef.format.video.eColorFormat;
        sInFmt.xFramerate = sPortDef.format.video.xFramerate;

        OMX_INIT_STRUCT(&sPortDef, OMX_PARAM_PORTDEFINITIONTYPE);
        sPortDef.nPortIndex = OUT_PORT;
        ports[OUT_PORT]->GetPortDefinition(&sPortDef);
        if (Rotation.nRotation == 90 || Rotation.nRotation == 270)
        {
            sPortDef.format.video.nFrameWidth = sInFmt.nFrameHeight;
            sPortDef.format.video.nFrameHeight = sInFmt.nFrameWidth;

        }
        else
        {
            sPortDef.format.video.nFrameWidth = sInFmt.nFrameWidth;
            sPortDef.format.video.nFrameHeight = sInFmt.nFrameHeight;

        }
        sPortDef.format.video.xFramerate = sInFmt.xFramerate;
        if(sInFmt.eCompressionFormat != OMX_VIDEO_CodingUnused)
            sPortDef.nBufferSize = sPortDef.format.video.nFrameWidth * sPortDef.format.video.nFrameHeight
                                   * pxlfmt2bpp(sPortDef.format.video.eColorFormat) / 8;
        ports[OUT_PORT]->SetPortDefinition(&sPortDef);

        if(hTsHandle != NULL)
            tsmSetFrmRate(hTsHandle, sInFmt.xFramerate, Q16_SHIFT);
    }

    if(nPortIndex == OUT_PORT)
    {
        sPortDef.nPortIndex = OUT_PORT;
        ports[OUT_PORT]->GetPortDefinition(&sPortDef);
        //fsl_osal_memcpy(&sOutFmt, &(sPortDef.format.video), sizeof(OMX_VIDEO_PORTDEFINITIONTYPE));
        sOutFmt.nFrameWidth = sPortDef.format.video.nFrameWidth;
        sOutFmt.nFrameHeight = sPortDef.format.video.nFrameHeight;
        sOutFmt.xFramerate=sPortDef.format.video.xFramerate;
        sOutFmt.nBitrate=sPortDef.format.video.nBitrate;
        sOutFmt.eCompressionFormat = sPortDef.format.video.eCompressionFormat;
        sOutFmt.eColorFormat = sPortDef.format.video.eColorFormat;
        nOutBufferCnt = sPortDef.nBufferCountActual;
    }

    return OMX_ErrorNone;
}
开发者ID:hicks0074,项目名称:freescale_omx_framework,代码行数:58,代码来源:VideoFilter.cpp


示例6: load_component

OMX_ERRORTYPE load_component(HTEST *hTest)
{
	OMX_ERRORTYPE ret = OMX_ErrorNone;
	OMX_HANDLETYPE hComponent = NULL;
	OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
	OMX_U32 i;

	ret = OMX_GetHandle(&hComponent, hTest->name, hTest, &gCallBacks);
	if(ret != OMX_ErrorNone)
	{
		printf("Load component %s failed.\n", hTest->name);
		return ret;
	}

	hTest->hComponent = (OMX_COMPONENTTYPE*)hComponent;
	OMX_INIT_STRUCT(&sPortDef, OMX_PARAM_PORTDEFINITIONTYPE);
	sPortDef.nPortIndex = 1;
	ret = OMX_GetParameter(hTest->hComponent,OMX_IndexParamPortDefinition,&sPortDef);
	if (ret != OMX_ErrorNone)
		return ret;

	sPortDef.format.video.nFrameWidth = 176;
	sPortDef.format.video.nFrameHeight = 144;

	ret = OMX_SetParameter(hTest->hComponent,OMX_IndexParamPortDefinition,&sPortDef);
	if (ret != OMX_ErrorNone)
		return ret;
	sPortDef.nPortIndex = 0;
	ret = OMX_SetParameter(hTest->hComponent,OMX_IndexParamPortDefinition,&sPortDef);
	if (ret != OMX_ErrorNone)
		return ret;

	hTest->nPorts = get_component_ports(hComponent);
	OMX_INIT_STRUCT(&sPortDef, OMX_PARAM_PORTDEFINITIONTYPE);
	for(i=0; i<hTest->nPorts; i++)
	{
		sPortDef.nPortIndex = i;
		OMX_GetParameter(hComponent, OMX_IndexParamPortDefinition, &sPortDef);
		if (sPortDef.eDomain == OMX_PortDomainAudio)
			hTest->nAudioTrackNum = i;
		if (sPortDef.eDomain == OMX_PortDomainVideo)
			hTest->nVideoTrackNum = i;

		hTest->PortDir[i] = sPortDef.eDir;
		if(hTest->PortDir[i] == OMX_DirInput)
			hTest->bAllocater[i] = OMX_FALSE;
		if(hTest->PortDir[i] == OMX_DirOutput)
			hTest->bAllocater[i] = OMX_TRUE;
		if(i == 0)
			hTest->bAllocater[i] = OMX_FALSE;
	}

	fsl_osal_thread_create(&hTest->pThreadId, NULL, process_thread, hTest);

	return OMX_ErrorNone;
}
开发者ID:hicks0074,项目名称:freescale_omx_framework,代码行数:56,代码来源:video_source_test.cpp


示例7: OMX_INIT_STRUCT

OMX_ERRORTYPE LibavAudioDec::InitComponent()
{
    /*set default definition*/
    OMX_ERRORTYPE ret = OMX_ErrorNone;
    OMX_PARAM_PORTDEFINITIONTYPE sPortDef;

    OMX_INIT_STRUCT(&sPortDef, OMX_PARAM_PORTDEFINITIONTYPE);
    sPortDef.nPortIndex = AUDIO_FILTER_INPUT_PORT;
    sPortDef.eDir = OMX_DirInput;
    sPortDef.eDomain = OMX_PortDomainAudio;
    sPortDef.format.audio.eEncoding = CodingType;
    sPortDef.bPopulated = OMX_FALSE;
    sPortDef.bEnabled = OMX_TRUE;
    sPortDef.nBufferCountMin = 1;
    sPortDef.nBufferCountActual = 3;
    sPortDef.nBufferSize = 32768;
    ret = ports[AUDIO_FILTER_INPUT_PORT]->SetPortDefinition(&sPortDef);
    if(ret != OMX_ErrorNone) {
        LOG_ERROR("Set port definition for port[%d] failed.\n", AUDIO_FILTER_INPUT_PORT);
        return ret;
    }

    sPortDef.nPortIndex = AUDIO_FILTER_OUTPUT_PORT;
    sPortDef.eDir = OMX_DirOutput;
    sPortDef.eDomain = OMX_PortDomainAudio;
    sPortDef.format.audio.eEncoding = OMX_AUDIO_CodingPCM;
    sPortDef.bPopulated = OMX_FALSE;
    sPortDef.bEnabled = OMX_TRUE;
    sPortDef.nBufferCountMin = 1;
    sPortDef.nBufferCountActual = 3;
    sPortDef.nBufferSize = LIBAV_OUTPUT_PORT_BUFFER_SIZE;
    ret = ports[AUDIO_FILTER_OUTPUT_PORT]->SetPortDefinition(&sPortDef);
    if(ret != OMX_ErrorNone) {
	LOG_ERROR("Set port definition for port[%d] failed.\n", 0);
	return ret;
    }

	OMX_INIT_STRUCT(&PcmMode, OMX_AUDIO_PARAM_PCMMODETYPE);

	PcmMode.nPortIndex = AUDIO_FILTER_OUTPUT_PORT;
	PcmMode.nChannels = 2;
	PcmMode.nSamplingRate = 44100;
	PcmMode.nBitPerSample = 16;
	PcmMode.bInterleaved = OMX_TRUE;
	PcmMode.eNumData = OMX_NumericalDataSigned;
	PcmMode.ePCMMode = OMX_AUDIO_PCMModeLinear;
	PcmMode.eEndian = OMX_EndianLittle;
	PcmMode.eChannelMapping[0] = OMX_AUDIO_ChannelNone;

	return ret;
}
开发者ID:FreeSrk,项目名称:omx,代码行数:51,代码来源:LibavAudioDec.cpp


示例8: fsl_osal_strcpy

AacDec::AacDec()
{
    fsl_osal_strcpy((fsl_osal_char*)name, "OMX.Freescale.std.audio_decoder.aac.sw-based");
    ComponentVersion.s.nVersionMajor = 0x0;
    ComponentVersion.s.nVersionMinor = 0x1;
    ComponentVersion.s.nRevision = 0x0;
    ComponentVersion.s.nStep = 0x0;
    role_cnt = 1;
    role[0] = (OMX_STRING)"audio_decoder.aac";
    codingType = OMX_AUDIO_CodingAAC;
    nPushModeInputLen = AAC_PUSH_MODE_LEN;
    outputPortBufferSize = 6*AACD_FRAME_SIZE*2*4;
    decoderLibName = "lib_aacd_wrap_arm12_elinux_android.so";
    optionaDecoderlLibName = "lib_aacplusd_wrap_arm12_elinux_android.so";

    OMX_INIT_STRUCT(&AacType, OMX_AUDIO_PARAM_AACPROFILETYPE);
    AacType.nPortIndex = AUDIO_FILTER_INPUT_PORT;
    AacType.nChannels = 2;
    AacType.nSampleRate = 44100;
    AacType.nAudioBandWidth = 0;
    AacType.nAACERtools = OMX_AUDIO_AACERNone;
    AacType.eAACProfile = OMX_AUDIO_AACObjectLC;
    AacType.eChannelMode = OMX_AUDIO_ChannelModeStereo;
    AacType.eAACStreamFormat = OMX_AUDIO_AACStreamFormatMax;
    LOG_DEBUG("Unia -> AAC");
    bFrameCheck = OMX_FALSE;
}
开发者ID:FreeSrk,项目名称:omx,代码行数:27,代码来源:AacDec.cpp


示例9: OMX_INIT_STRUCT

OMX_ERRORTYPE IpulibRender::PortFormatChanged(OMX_U32 nPortIndex)
{
	OMX_ERRORTYPE ret = OMX_ErrorNone;
	OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
	OMX_BOOL bFmtChanged = OMX_FALSE;

	if(nPortIndex != IN_PORT)
		return OMX_ErrorBadPortIndex;

	OMX_INIT_STRUCT(&sPortDef, OMX_PARAM_PORTDEFINITIONTYPE);
	ports[IN_PORT]->GetPortDefinition(&sPortDef);

	if(sVideoFmt.nFrameWidth != sPortDef.format.video.nFrameWidth)
	{
		sVideoFmt.nFrameWidth = sPortDef.format.video.nFrameWidth;
		bFmtChanged = OMX_TRUE;
	}
	if(sVideoFmt.nFrameHeight != sPortDef.format.video.nFrameHeight)
	{
		sVideoFmt.nFrameHeight = sPortDef.format.video.nFrameHeight;
		bFmtChanged = OMX_TRUE;
	}
	if(sVideoFmt.eColorFormat != sPortDef.format.video.eColorFormat)
	{
		sVideoFmt.eColorFormat = sPortDef.format.video.eColorFormat;
		bFmtChanged = OMX_TRUE;
	}

	if(bFmtChanged == OMX_TRUE)
		ResetDevice();

	return ret;
}
开发者ID:hicks0074,项目名称:freescale_omx_framework,代码行数:33,代码来源:IpulibRender_mx6x.cpp


示例10: OMX_INIT_STRUCT

OMX_ERRORTYPE AudioSource::SendOutputBuffer()
{
	OMX_ERRORTYPE ret = OMX_ErrorNone;
	OMX_TIME_CONFIG_TIMESTAMPTYPE ReferTime;
	OMX_U32 nDelayLen;
	OMX_S64 MediaTime;

	OMX_INIT_STRUCT(&ReferTime, OMX_TIME_CONFIG_TIMESTAMPTYPE);

	GetDeviceDelay(&nDelayLen);

	TotalRecordedLen += pOutBufferHdr->nFilledLen;
	MediaTime = StartTime.nTimestamp + ((TotalRecordedLen + nDelayLen)/nSampleSize * OMX_TICKS_PER_SECOND) / PcmMode.nSamplingRate;
	pOutBufferHdr->nTimeStamp = StartTime.nTimestamp + ((TotalRecordedLen)/nSampleSize * OMX_TICKS_PER_SECOND) / PcmMode.nSamplingRate;

	ReferTime.nTimestamp = MediaTime;
	LOG_DEBUG("Audio source total recorded data: %lld\n", TotalRecordedLen);
	LOG_DEBUG("Set reference time to clock: %lld\n", MediaTime);
	//ClockSetConfig(OMX_IndexConfigTimeCurrentAudioReference, &ReferTime);
   
	if (EOS.bEnabled == OMX_TRUE || pOutBufferHdr->nTimeStamp > nMaxDuration) {
		pOutBufferHdr->nFlags |= OMX_BUFFERFLAG_EOS;
		pOutBufferHdr->nFilledLen = 0;
		bSendEOS = OMX_TRUE;
		SendEvent(OMX_EventBufferFlag, 0, OMX_BUFFERFLAG_MAX_DURATION, NULL);
	}

	LOG_DEBUG("Audio source send buffer len: %d, flags: %p offset: %d time stamp: %lld\n", \
			pOutBufferHdr->nFilledLen, pOutBufferHdr->nFlags, pOutBufferHdr->nOffset, \
			pOutBufferHdr->nTimeStamp);
	ports[OUTPUT_PORT]->SendBuffer(pOutBufferHdr);
	pOutBufferHdr = NULL;
	
	return ret;
}
开发者ID:primiano,项目名称:udoo_external_fsl_imx_omx,代码行数:35,代码来源:AudioSource.cpp


示例11: OMX_INIT_STRUCT

OMX_ERRORTYPE VideoRender::ProcessDataBuffer()
{
    OMX_ERRORTYPE ret = OMX_ErrorNone;
    OMX_BUFFERHEADERTYPE *pBufferHdr = NULL;

    if(ports[IN_PORT]->BufferNum() == 0)
        return OMX_ErrorNoMore;

    if(pSyncFrame != NULL)
        return OMX_ErrorNoMore;

    ports[IN_PORT]->GetBuffer(&pBufferHdr);

    if(nFrameCnt == 0 && ports[CLK_PORT]->IsEnabled() == OMX_TRUE) {
        OMX_TIME_CONFIG_CLOCKSTATETYPE sState;
        OMX_INIT_STRUCT(&sState, OMX_TIME_CONFIG_CLOCKSTATETYPE);
        ports[CLK_PORT]->GetTunneledInfo(&hClock);
        OMX_GetConfig(hClock.hTunneledComp, OMX_IndexConfigTimeClockState, &sState);
        ClockState = sState.eState;
    }

    nFrameCnt ++;

    LOG_DEBUG("VideoRender get bufer: %p:%lld:%x\n", 
            pBufferHdr->pBuffer, pBufferHdr->nTimeStamp, pBufferHdr->nFlags);

    if(ports[CLK_PORT]->IsEnabled() == OMX_TRUE)
        ret = SyncFrame(pBufferHdr);
    else
        ret = RenderFrame(pBufferHdr);

    return ret;
}
开发者ID:primiano,项目名称:udoo_external_fsl_imx_omx,代码行数:33,代码来源:VideoRender.cpp


示例12: ilcore_set_port_buffers_param

ret_code_t ilcore_set_port_buffers_param(ilcore_comp_h h, int size, int count, int align)
{
    OMX_ERRORTYPE err;
    OMX_PARAM_PORTDEFINITIONTYPE param;
    ilcore_comp_ctx_t *ctx = (ilcore_comp_ctx_t *)h;

    OMX_INIT_STRUCT(param);
    param.nPortIndex = IL_AUDIO_RENDER_IN_PORT;
 
    err = OMX_GetParameter(ctx->handle, OMX_IndexParamPortDefinition, &param);
    if (err != OMX_ErrorNone)
    {
        DBG_E("%s: OMX_IndexParamPortDefinition failed. err=0x%x\n", ctx->name, err);
        return L_FAILED;
    }
    param.nBufferSize = size;
    param.nBufferCountActual = count;
    param.nBufferAlignment = align;

    err = OMX_SetParameter(ctx->handle, OMX_IndexParamPortDefinition, &param);
    if (err != OMX_ErrorNone)
    {
        DBG_E("%s: OMX_IndexParamPortDefinition failed. err=0x%x\n", ctx->name, err);
        return L_FAILED;
    }
    return L_OK;
}
开发者ID:Andrewftv,项目名称:lbmc,代码行数:27,代码来源:ilcore.c


示例13: prepare_port_buffers

OMX_ERRORTYPE prepare_port_buffers(HTEST *hTest, OMX_U32 nPortIndex)
{
    OMX_COMPONENTTYPE *hComponent = NULL;
    OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
    OMX_BUFFERHEADERTYPE *pBufferHdr = NULL;
    OMX_U8 *pBuffer = NULL;
    OMX_U32 i;

    hComponent = hTest->hComponent;
    OMX_INIT_STRUCT(&sPortDef, OMX_PARAM_PORTDEFINITIONTYPE);
    sPortDef.nPortIndex = nPortIndex;
    OMX_GetParameter(hComponent, OMX_IndexParamPortDefinition, &sPortDef);

    for(i=0; i<sPortDef.nBufferCountActual; i++) {
        if(hTest->bAllocater[nPortIndex] == OMX_TRUE) {
            OMX_AllocateBuffer(hComponent, &pBufferHdr, nPortIndex, NULL, sPortDef.nBufferSize);
            printf("Allocate buffer done.\n");
        }
        else {
            pBuffer = (OMX_U8*)FSL_MALLOC(sPortDef.nBufferSize);
            OMX_UseBuffer(hComponent, &pBufferHdr, nPortIndex, NULL, sPortDef.nBufferSize, pBuffer);
            printf("Use buffer done.\n");
        }
        hTest->pBufferHdr[nPortIndex][i] = pBufferHdr;
    }
    hTest->nBufferHdr[nPortIndex] = sPortDef.nBufferCountActual;


    return OMX_ErrorNone;
}
开发者ID:primiano,项目名称:udoo_external_fsl_imx_omx,代码行数:30,代码来源:video_source_test.cpp


示例14: start_data_process

OMX_ERRORTYPE start_data_process(HTEST *hTest)
{
    OMX_ERRORTYPE ret = OMX_ErrorNone;
    OMX_U32 i, wait_cnt = 0;

    hTest->bHoldBuffers = OMX_FALSE;

	OMX_CONFIG_BOOLEANTYPE sCapturing;
	OMX_INIT_STRUCT(&sCapturing, OMX_CONFIG_BOOLEANTYPE);
	sCapturing.bEnabled = OMX_TRUE;
    ret = OMX_SetConfig(hTest->hComponent,OMX_IndexConfigCapturing, &sCapturing);
    if (ret != OMX_ErrorNone)
        return ret;

    /* Send output buffers */
    for(i=0; i<hTest->nBufferHdr[0]; i++) {
        hTest->pBufferHdr[0][i]->nFilledLen = 0;
        hTest->pBufferHdr[0][i]->nOffset = 0;
        OMX_FillThisBuffer(hTest->hComponent, hTest->pBufferHdr[0][i]);
    }

    for(i=0; i<hTest->nBufferHdr[1]; i++) {
        hTest->pBufferHdr[1][i]->nFilledLen = 0;
        hTest->pBufferHdr[1][i]->nOffset = 0;
        OMX_FillThisBuffer(hTest->hComponent, hTest->pBufferHdr[1][i]);
    }

    return ret;
}
开发者ID:primiano,项目名称:udoo_external_fsl_imx_omx,代码行数:29,代码来源:video_source_test.cpp


示例15: OMX_INIT_STRUCT

OMX_ERRORTYPE VideoRender::InitComponent()
{
    OMX_ERRORTYPE ret = OMX_ErrorNone;
    OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
    OMX_BUFFERSUPPLIERTYPE SupplierType;

    OMX_INIT_STRUCT(&sPortDef, OMX_PARAM_PORTDEFINITIONTYPE);
    sPortDef.nPortIndex = IN_PORT;
    sPortDef.eDir = OMX_DirInput;
    sPortDef.eDomain = OMX_PortDomainVideo;
    fsl_osal_memcpy(&sPortDef.format.video, &sVideoFmt, sizeof(OMX_VIDEO_PORTDEFINITIONTYPE));
    sPortDef.bPopulated = OMX_FALSE;
    sPortDef.bEnabled = OMX_TRUE;
    sPortDef.nBufferCountMin = nFrameBufferMin;
    sPortDef.nBufferCountActual = nFrameBufferActual;
    sPortDef.nBufferSize = sPortDef.format.video.nFrameWidth
        * sPortDef.format.video.nFrameHeight
        * pxlfmt2bpp(sVideoFmt.eColorFormat) / 8;
    ret = ports[IN_PORT]->SetPortDefinition(&sPortDef);
    if(ret != OMX_ErrorNone) {
        LOG_ERROR("Set port definition for in port failed.\n");
        return ret;
    }

    ports[IN_PORT]->SetSupplierType(TunneledSupplierType);

    sPortDef.nPortIndex = CLK_PORT;
    sPortDef.eDir = OMX_DirInput;
    sPortDef.eDomain = OMX_PortDomainOther;
    sPortDef.format.other.eFormat = OMX_OTHER_FormatTime;
    sPortDef.bPopulated = OMX_FALSE;
    sPortDef.bEnabled = OMX_FALSE;
    sPortDef.nBufferCountMin = 1;
    sPortDef.nBufferCountActual = 1;
    sPortDef.nBufferSize = sizeof(OMX_TIME_MEDIATIMETYPE);
    ret = ports[CLK_PORT]->SetPortDefinition(&sPortDef);
    if(ret != OMX_ErrorNone) {
        LOG_ERROR("Set port definition for clk port failed.\n");
        return ret;
    }

    SupplierType = OMX_BufferSupplyOutput;
    ports[CLK_PORT]->SetSupplierType(SupplierType);

    fsl_osal_memset(&hClock, 0, sizeof(TUNNEL_INFO));
    ClockState = OMX_TIME_ClockStateStopped;
    ClockScale = Q16_SHIFT;
    pSyncFrame = NULL;
    nFrameCnt = nDropCnt = nDeviceDropCnt = nContiniousDrop = 0;
    playbackMode = NORMAL_MODE;

    InitVideoVisitors();

    ret = InitRenderComponent();
    if(ret != OMX_ErrorNone)
        return ret;

    return ret;
}
开发者ID:FreeSrk,项目名称:omx,代码行数:59,代码来源:VideoRender.cpp


示例16: do_seek

OMX_ERRORTYPE do_seek(HTEST *hTest,OMX_U32 nSeekPos, OMX_TIME_SEEKMODETYPE mode )
{
    OMX_ERRORTYPE ret = OMX_ErrorNone;
    OMX_TIME_CONFIG_TIMESTAMPTYPE timeStamp;
    OMX_INIT_STRUCT(&timeStamp, OMX_TIME_CONFIG_TIMESTAMPTYPE);

    OMX_TIME_CONFIG_SEEKMODETYPE seek_mode;
    OMX_INIT_STRUCT(&seek_mode, OMX_TIME_CONFIG_SEEKMODETYPE);
    seek_mode.eType = mode;
    ret = OMX_SetConfig(hTest->hComponent,OMX_IndexConfigTimeSeekMode, &seek_mode);
    if (ret != OMX_ErrorNone)
        return ret;

    timeStamp.nPortIndex = hTest->nAudioTrackNum;
    ret = OMX_GetConfig(hTest->hComponent,OMX_IndexConfigTimePosition, &timeStamp);
    if (ret != OMX_ErrorNone)
        return ret;
    printf("%s,%d,before seek, audio pos %lld.\n",__FUNCTION__,__LINE__,timeStamp.nTimestamp);

    timeStamp.nPortIndex = hTest->nVideoTrackNum;
    ret = OMX_GetConfig(hTest->hComponent,OMX_IndexConfigTimePosition, &timeStamp);
    if (ret != OMX_ErrorNone)
        return ret;
    printf("%s,%d,before seek, video pos %lld.\n",__FUNCTION__,__LINE__,timeStamp.nTimestamp);


    timeStamp.nPortIndex = OMX_ALL;
    timeStamp.nTimestamp = nSeekPos*OMX_TICKS_PER_SECOND;
    ret = OMX_SetConfig(hTest->hComponent,OMX_IndexConfigTimePosition, &timeStamp);

    timeStamp.nPortIndex = hTest->nAudioTrackNum;
    ret = OMX_GetConfig(hTest->hComponent,OMX_IndexConfigTimePosition, &timeStamp);
    if (ret != OMX_ErrorNone)
        return ret;
    printf("%s,%d,seek result audio %lld.\n",__FUNCTION__,__LINE__,timeStamp.nTimestamp);

    timeStamp.nPortIndex = hTest->nVideoTrackNum;
    ret = OMX_GetConfig(hTest->hComponent,OMX_IndexConfigTimePosition, &timeStamp);
    if (ret != OMX_ErrorNone)
        return ret;
    printf("%s,%d,seek result video %lld.\n",__FUNCTION__,__LINE__,timeStamp.nTimestamp);

    return ret;
}
开发者ID:primiano,项目名称:udoo_external_fsl_imx_omx,代码行数:44,代码来源:video_source_test.cpp


示例17: ALOGI

OMX_ERRORTYPE omx_vdec::set_vendor_extension_config(
                OMX_CONFIG_ANDROID_VENDOR_EXTENSIONTYPE *ext) {

    ALOGI("set_vendor_extension_config");
    if (ext->nIndex >= mVendorExtensionStore.size()) {
        DEBUG_PRINT_ERROR("unrecognized vendor extension index (%u) max(%u)",
                ext->nIndex, mVendorExtensionStore.size());
        return OMX_ErrorBadParameter;
    }

    const VendorExtension& vExt = mVendorExtensionStore[ext->nIndex];
    DEBUG_PRINT_LOW("VendorExt: setConfig: index=%u (%s)", ext->nIndex, vExt.name());

    OMX_ERRORTYPE err = OMX_ErrorNone;
    err = vExt.isConfigValid(ext);
    if (err != OMX_ErrorNone) {
        return err;
    }

    // mark this as set, regardless of set_config succeeding/failing.
    // App will know by inconsistent values in output-format
    vExt.set();

    bool valueSet = false;
    switch ((OMX_U32)vExt.extensionIndex()) {
        case OMX_QcomIndexParamVideoDecoderPictureOrder:
        {
            OMX_S32 pic_order_enable = 0;
            valueSet |= vExt.readParamInt32(ext, "enable", &pic_order_enable);
            if (!valueSet) {
                break;
            }

            DEBUG_PRINT_HIGH("VENDOR-EXT: set_config: OMX_QcomIndexParamVideoDecoderPictureOrder : %d",
                    pic_order_enable);

            QOMX_VIDEO_DECODER_PICTURE_ORDER decParam;
            OMX_INIT_STRUCT(&decParam, QOMX_VIDEO_DECODER_PICTURE_ORDER);
            decParam.eOutputPictureOrder =
                    pic_order_enable ? QOMX_VIDEO_DECODE_ORDER : QOMX_VIDEO_DISPLAY_ORDER;

            err = set_parameter(
                    NULL, (OMX_INDEXTYPE)OMX_QcomIndexParamVideoDecoderPictureOrder, &decParam);
            if (err != OMX_ErrorNone) {
                DEBUG_PRINT_ERROR("set_config: OMX_QcomIndexParamVideoDecoderPictureOrder failed !");
            }
            break;
        }
        default:
        {
            return OMX_ErrorNotImplemented;
        }
    }

    return err;
}
开发者ID:MIPS,项目名称:hardware-qcom-media,代码行数:56,代码来源:omx_vdec_extensions.hpp


示例18: OMX_INIT_STRUCT

OMX_ERRORTYPE VideoSource::SendOutputBuffer()
{
	OMX_ERRORTYPE ret = OMX_ErrorNone;
	OMX_TICKS nMediaTimestamp;

	if (Capturing.bEnabled != OMX_TRUE)
		pOutBufferHdr->nFilledLen = 0;

	OMX_TIME_CONFIG_TIMESTAMPTYPE sCur;
	OMX_INIT_STRUCT(&sCur, OMX_TIME_CONFIG_TIMESTAMPTYPE);
	ClockGetConfig(OMX_IndexConfigTimeCurrentMediaTime, &sCur);

	nFrameDelay = GetDelayofFrame();

	nMediaTimestamp = sCur.nTimestamp - nFrameDelay;
	LOG_DEBUG("Media time diff: %lld\n", nMediaTimestamp - nMediaTimestampPre);
	if (nMediaTimestamp <= 0) {
		pOutBufferHdr->nFilledLen = 0;
		nMediaTimestamp = 0;
	}
	if (nMediaTimestamp < nMediaTimestampPre)
		nMediaTimestamp = nMediaTimestampPre + 1000;
	nMediaTimestampPre = nMediaTimestamp;

	pOutBufferHdr->nTimeStamp = nMediaTimestamp;

	if (EOS.bEnabled == OMX_TRUE || nMediaTimestamp > nMaxDuration) {
		bSendEOS = OMX_TRUE;
		pOutBufferHdr->nFlags |= OMX_BUFFERFLAG_EOS;
		pOutBufferHdr->nFilledLen = 0;
		SendEvent(OMX_EventBufferFlag, 0, OMX_BUFFERFLAG_MAX_DURATION, NULL);
		if (nMediaTimestamp)
			printf("Video frame rate: %f\n", ((OMX_S64)nCaptureFrameCnt) * \
					OMX_TICKS_PER_SECOND * 1000 / nMediaTimestamp / ((float)1000));
	} else {
        if (pOutBufferHdr->nFilledLen)
            nCaptureFrameCnt ++;
        LOG_DEBUG("VideoSource time: %lld\n", pOutBufferHdr->nTimeStamp);
	}

	if (nTimeLapseUs > 0) {
		if (pOutBufferHdr->nTimeStamp > nNextLapseTS) {
			nNextLapseTS += nTimeLapseUs;
			pOutBufferHdr->nTimeStamp = nLastSendTS + nFrameInterval;
			nLastSendTS += nFrameInterval;
		} else {
			pOutBufferHdr->nFilledLen = 0;
			pOutBufferHdr->nTimeStamp = 0;
		}
	}

	LOG_DEBUG("VideoSource send nFilledLen: %d\n", pOutBufferHdr->nFilledLen);
	ports[CAPTURED_FRAME_PORT]->SendBuffer(pOutBufferHdr);

	return ret;
}
开发者ID:FreeSrk,项目名称:omx,代码行数:56,代码来源:VideoSource.cpp


示例19: OMX_INIT_STRUCT

OMX_ERRORTYPE Clock::InitComponent()
{
    OMX_ERRORTYPE ret = OMX_ErrorNone;
    OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
    OMX_BUFFERSUPPLIERTYPE SupplierType;
    OMX_U32 i;

    OMX_INIT_STRUCT(&sPortDef, OMX_PARAM_PORTDEFINITIONTYPE);
    sPortDef.eDir = OMX_DirOutput;
    sPortDef.eDomain = OMX_PortDomainOther;
    sPortDef.format.other.eFormat = OMX_OTHER_FormatTime;
    sPortDef.bPopulated = OMX_FALSE;
    sPortDef.bEnabled = OMX_FALSE;
    sPortDef.nBufferCountMin = 1;
    sPortDef.nBufferCountActual = 5;
    sPortDef.nBufferSize = sizeof(OMX_TIME_MEDIATIMETYPE);

    SupplierType = OMX_BufferSupplyOutput;

    for(i=0; i<PORT_NUM; i++) {
        sPortDef.nPortIndex = i;
        ports[i]->SetPortDefinition(&sPortDef);
        ports[i]->SetSupplierType(SupplierType);
    }

    if(E_FSL_OSAL_SUCCESS != fsl_osal_mutex_init(&lock, fsl_osal_mutex_normal)) {
        LOG_ERROR("Create mutext for clock failed.\n");
        return OMX_ErrorInsufficientResources;
    }

    if(E_FSL_OSAL_SUCCESS != fsl_osal_cond_create(&Cond)) {
        LOG_ERROR("Create condition variable for clock failed.\n");
        return OMX_ErrorInsufficientResources;
    }

    OMX_INIT_STRUCT(&sState, OMX_TIME_CONFIG_CLOCKSTATETYPE);
    sState.eState = CurState = OMX_TIME_ClockStateStopped;
    RefClock = OMX_TIME_RefClockNone;
    SegmentStartTime = -1L;
    bPaused = OMX_FALSE;

    return ret;
}
开发者ID:primiano,项目名称:udoo_external_fsl_imx_omx,代码行数:43,代码来源:Clock.cpp


示例20: fsl_osal_strcpy

IpulibRender::IpulibRender()
{
	OMX_U32 i;

	fsl_osal_strcpy((fsl_osal_char*)name, "OMX.Freescale.std.video_render.ipulib.sw-based");
	ComponentVersion.s.nVersionMajor = 0x0;
	ComponentVersion.s.nVersionMinor = 0x1;
	ComponentVersion.s.nRevision = 0x0;
	ComponentVersion.s.nStep = 0x0;
	role_cnt = 1;
	role[0] = (OMX_STRING)"video_render.ipulib";

	nFrameBufferMin = 2;
	nFrameBufferActual = 2;
	TunneledSupplierType = OMX_BufferSupplyInput;
	fsl_osal_memset(&sVideoFmt, 0, sizeof(OMX_VIDEO_PORTDEFINITIONTYPE));
	sVideoFmt.nFrameWidth = 320;
	sVideoFmt.nFrameHeight = 240;
	sVideoFmt.eColorFormat = OMX_COLOR_FormatYUV420Planar;
	sVideoFmt.eCompressionFormat = OMX_VIDEO_CodingUnused;

	eRotation = ROTATE_NONE;
	OMX_INIT_STRUCT(&sRectIn, OMX_CONFIG_RECTTYPE);
	sRectIn.nWidth = sVideoFmt.nFrameWidth;
	sRectIn.nHeight = sVideoFmt.nFrameHeight;
	sRectIn.nTop = 0;
	sRectIn.nLeft = 0;
	OMX_INIT_STRUCT(&sRectOut, OMX_CONFIG_RECTTYPE);
	sRectOut.nWidth = DISP_WIDTH;
	sRectOut.nHeight = DISP_HEIGHT;
	sRectOut.nTop = 0;
	sRectOut.nLeft = 0;

	bInitDev = OMX_FALSE;
	lock = NULL;
	pShowFrame = NULL;
	nFrameLen = 0;
	bSuspend = OMX_FALSE;
	fsl_osal_memset(&ipu_handle, 0, sizeof(ipu_lib_handle_t));

	OMX_INIT_STRUCT(&sCapture, OMX_CONFIG_CAPTUREFRAME);
	sCapture.eType = CAP_NONE;
}
开发者ID:hicks0074,项目名称:freescale_omx_framework,代码行数:43,代码来源:IpulibRender.cpp



注:本文中的OMX_INIT_STRUCT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ OMX_INIT_STRUCTURE函数代码示例发布时间:2022-05-30
下一篇:
C++ OMX_GetParameter函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap