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

C++ OMX_SendCommand函数代码示例

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

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



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

示例1: ilcore_flush_tunnel

ret_code_t ilcore_flush_tunnel(ilcore_tunnel_h h)
{
    OMX_ERRORTYPE omx_err;
    omx_tunnel_t *tunnel = (omx_tunnel_t *)h;

    if (!tunnel || !tunnel->src_comp || !tunnel->dst_comp)
    {
        DBG_E("%s: Incorrect parameters\n", __FUNCTION__);
        return L_FAILED;
    }

    omx_err = OMX_SendCommand(ilcore_get_handle(tunnel->src_comp), OMX_CommandFlush, tunnel->src_port, NULL);
    if(omx_err != OMX_ErrorNone && omx_err != OMX_ErrorSameState)
    {
        DBG_E("%s: Error flush port %d on component %s err = 0x%08x\n", __FUNCTION__, tunnel->src_port,
            ilcore_get_comp_name(tunnel->src_comp), omx_err);
    }

    omx_err = OMX_SendCommand(ilcore_get_handle(tunnel->dst_comp), OMX_CommandFlush, tunnel->dst_port, NULL);
    if(omx_err != OMX_ErrorNone && omx_err != OMX_ErrorSameState)
    {
        DBG_E("%s: Error flush port %d on component %s err = 0x%08x\n", __FUNCTION__, tunnel->dst_port,
            ilcore_get_comp_name(tunnel->dst_comp), omx_err);
    }

    omx_core_comp_wait_command(tunnel->src_comp, OMX_CommandFlush, tunnel->src_port, 2000);
    omx_core_comp_wait_command(tunnel->dst_comp, OMX_CommandFlush, tunnel->dst_port, 2000);

    return L_OK;
}
开发者ID:Andrewftv,项目名称:lbmc,代码行数:30,代码来源:ilcore.c


示例2: DBGT_PROLOG

OMX_ERRORTYPE EnableDataFlow::resetComponents()
{
    DBGT_PROLOG("");

    OMX_ERRORTYPE err = OMX_ErrorNone;

    DBGT_PTRACE("Sending Command StateIdle to SwJpegEnc");
    err = OMX_SendCommand(mSwJpegEnc, OMX_CommandStateSet, OMX_StateIdle, NULL);
    if(OMX_ErrorNone != err) {
        DBGT_CRITICAL("Sending OMX_StateIdle failed for SwJpegEnc err = %d", err);
        DBGT_EPILOG("");
        return err;
    }

    DBGT_PTRACE("Sending Command StateIdle to ArmIv");
    err = OMX_SendCommand(mArmIvProc, OMX_CommandStateSet, OMX_StateIdle, NULL);
    if(OMX_ErrorNone != err) {
        DBGT_CRITICAL("Sending OMX_StateIdle failed for ArmIVProc err = %d", err);
        DBGT_EPILOG("");
        return err;
    }

    mStateArmIvSem.wait();
    mStateSWJpegSem.wait();

    DBGT_PTRACE("Sending Command StateLoaded to ArmIv");
    err = OMX_SendCommand(mArmIvProc, OMX_CommandStateSet, OMX_StateLoaded, NULL);
    if(OMX_ErrorNone != err) {
        DBGT_CRITICAL("Sending OMX_StateLoaded failed for ArmIVProc err = %d", err);
        DBGT_EPILOG("");
        return err;
    }

    DBGT_PTRACE("Sending Command StateLoaded to SwJpegEnc");
    err = OMX_SendCommand(mSwJpegEnc, OMX_CommandStateSet, OMX_StateLoaded, NULL);
    if(OMX_ErrorNone != err) {
        DBGT_CRITICAL("Sending OMX_StateLoaded failed for SwJpegEnc err = %d", err);
        DBGT_EPILOG("");
        return err;
    }

    err = freeBuffers();
    if(OMX_ErrorNone != err) {
        DBGT_CRITICAL("Free buffers err = %d", err);
        DBGT_EPILOG("");
        return err;
    }

    mStateSWJpegSem.wait();
    mStateArmIvSem.wait();

    DBGT_EPILOG("");
    return err;
}
开发者ID:Meticulus,项目名称:vendor_st-ericsson_u8500,代码行数:54,代码来源:STECamThumbnailHandler.cpp


示例3: Close

static void Close(vlc_object_t *obj)
{
    filter_t *filter = (filter_t*) obj;
    filter_sys_t *sys = filter->p_sys;
    unsigned int i, j;

    if (sys->omx_handle) {
        OMX_STATETYPE state;
        OMX_GetState(sys->omx_handle, &state);

        if (state == OMX_StateExecuting) {
            OMX_SendCommand(sys->omx_handle, OMX_CommandStateSet,
                    OMX_StateIdle, 0);
            while (1) {
                OMX_U32 cmd, state;
                WaitForSpecificOmxEvent(&sys->event_queue, OMX_EventCmdComplete,
                        &cmd, &state, 0);
                if (cmd == OMX_CommandStateSet && state == OMX_StateIdle)
                    break;
            }
        }

        OMX_GetState(sys->omx_handle, &state);
        if (state == OMX_StateIdle) {
            OMX_SendCommand(sys->omx_handle, OMX_CommandStateSet,
                    OMX_StateLoaded, 0);

            for (i = 0; i < sys->num_ports; i++) {
                OmxPort *port = &sys->ports[i];
                for (j = 0; j < sys->ports[i].i_buffers; j++) {
                    OMX_BUFFERHEADERTYPE *buffer;
                    OMX_FIFO_GET(&port->fifo, buffer);
                    OMX_FreeBuffer(sys->omx_handle, port->i_port_index,
                            buffer);
                }
            }

            WaitForSpecificOmxEvent(&sys->event_queue, OMX_EventCmdComplete,
                    0, 0, 0);
        }
        for (i = 0; i < sys->num_ports; i++)
            free(sys->ports[i].pp_buffers);
        pf_free_handle(sys->omx_handle);
        DeinitOmxEventQueue(&sys->event_queue);
    }

    free(sys);
    DeinitOmxCore();
}
开发者ID:krieger-od,项目名称:vlc-omx,代码行数:49,代码来源:deinterlace.c


示例4: cleanup

static av_cold void cleanup(OMXCodecContext *s)
{
    int i, executing;

    pthread_mutex_lock(&s->state_mutex);
    executing = s->state == OMX_StateExecuting;
    pthread_mutex_unlock(&s->state_mutex);

    if (executing) {
        OMX_SendCommand(s->handle, OMX_CommandStateSet, OMX_StateIdle, NULL);
        wait_for_state(s, OMX_StateIdle);
        OMX_SendCommand(s->handle, OMX_CommandStateSet, OMX_StateLoaded, NULL);
        for (i = 0; i < s->num_in_buffers; i++) {
            OMX_BUFFERHEADERTYPE *buffer = get_buffer(&s->input_mutex, &s->input_cond,
                                                      &s->num_free_in_buffers, s->free_in_buffers, 1);
            if (s->input_zerocopy)
                buffer->pBuffer = NULL;
            OMX_FreeBuffer(s->handle, s->in_port, buffer);
        }
        for (i = 0; i < s->num_out_buffers; i++) {
            OMX_BUFFERHEADERTYPE *buffer = get_buffer(&s->output_mutex, &s->output_cond,
                                                      &s->num_done_out_buffers, s->done_out_buffers, 1);
            OMX_FreeBuffer(s->handle, s->out_port, buffer);
        }
        wait_for_state(s, OMX_StateLoaded);
    }
    if (s->handle) {
        s->omx_context->ptr_FreeHandle(s->handle);
        s->handle = NULL;
    }

    omx_deinit(s->omx_context);
    s->omx_context = NULL;
    if (s->mutex_cond_inited) {
        pthread_cond_destroy(&s->state_cond);
        pthread_mutex_destroy(&s->state_mutex);
        pthread_cond_destroy(&s->input_cond);
        pthread_mutex_destroy(&s->input_mutex);
        pthread_cond_destroy(&s->output_cond);
        pthread_mutex_destroy(&s->output_mutex);
        s->mutex_cond_inited = 0;
    }
    av_freep(&s->in_buffer_headers);
    av_freep(&s->out_buffer_headers);
    av_freep(&s->free_in_buffers);
    av_freep(&s->done_out_buffers);
    av_freep(&s->output_buf);
}
开发者ID:Hero2000,项目名称:CainCamera,代码行数:48,代码来源:omx.c


示例5: ResourceExhaustionTest_TransitionWait

    OMX_ERRORTYPE ResourceExhaustionTest_TransitionWait(ResourceExhaustionTestContext* pCtxt,
            OMX_STATETYPE eToState)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;
        OMX_BOOL bTimeout = OMX_FALSE;
        OMX_STATETYPE eState;

        OMX_OSAL_EventReset(pCtxt->hStateSetEvent);
        pCtxt->eLastError = OMX_ErrorNone;
        OMX_CONF_BAIL_IF_ERROR(OMX_GetState(pCtxt->hWComp[pCtxt->nInst], &eState));

        eError = OMX_SendCommand(pCtxt->hWComp[pCtxt->nInst], OMX_CommandStateSet, eToState, 0);
        OMX_CONF_BAIL_IF_ERROR(eError);

        if (eToState == OMX_StateIdle && (eState == OMX_StateLoaded))
        {
            OMX_CONF_BAIL_IF_ERROR(ResourceExhaustionTest_AllocateAllBuffers(pCtxt));
        }
        else if (eToState == OMX_StateLoaded && eState == OMX_StateIdle)
        {
            OMX_CONF_BAIL_IF_ERROR(ResourceExhaustionTest_DeInitBuffer(pCtxt));
        }

        OMX_OSAL_EventWait(pCtxt->hStateSetEvent, OMX_CONF_TIMEOUT_EXPECTING_SUCCESS, &bTimeout);
        OMX_CONF_BAIL_IF_ERROR(pCtxt->eLastError);

        if (bTimeout == OMX_TRUE)
            OMX_CONF_SET_ERROR_BAIL("Timeout on state transition\n", OMX_ErrorUndefined);

        OMX_CONF_BAIL_IF_ERROR(OMX_GetState(pCtxt->hWComp[pCtxt->nInst], &eState));
        if (eState != eToState)
            OMX_CONF_SET_ERROR_BAIL("Incorrect transition\n", OMX_ErrorUndefined);

OMX_CONF_TEST_BAIL:
        if (OMX_ErrorNone != eError && eToState == OMX_StateIdle && (eState == OMX_StateLoaded))
        {

            /* Add some delay before cleaning up */
            OMX_OSAL_EventWait(pCtxt->hStateSetEvent, OMX_CONF_TIMEOUT_EXPECTING_FAILURE, &bTimeout);

            /* Disable all ports to free buffers*/
            OMX_SendCommand(pCtxt->hWComp[pCtxt->nInst], OMX_CommandPortDisable, OMX_ALL, 0x0);

            /* Cleanup last instance */
            ResourceExhaustionTest_DeInitBuffer(pCtxt);
        }
        return eError;
    }
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:48,代码来源:omx_conf_resourceexhaustiontest.c


示例6: PortCommTest_TransitionWait

    OMX_ERRORTYPE PortCommTest_TransitionWait(OMX_STATETYPE eToState,
            PortCommTestCtxt* pContext)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;
        OMX_BOOL bTimeout = OMX_FALSE;

        OMX_OSAL_EventReset(pContext->hStateSetEvent);
        eError = OMX_SendCommand(pContext->hWComp, OMX_CommandStateSet, eToState, 0);
        OMX_CONF_BAIL_IF_ERROR(eError);

        if (eToState == OMX_StateIdle && (pContext->eState == OMX_StateLoaded))
        {
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_OperateOnPorts(pContext, AllocBuf));
        }
        else if (eToState == OMX_StateLoaded && pContext->eState == OMX_StateIdle)
        {
            OMX_CONF_BAIL_IF_ERROR(PortCommTest_DeInitBuffer(pContext));
        }

        OMX_OSAL_EventWait(pContext->hStateSetEvent, OMX_CONF_TIMEOUT_EXPECTING_SUCCESS, &bTimeout);

        if (bTimeout == OMX_TRUE)
            OMX_CONF_SET_ERROR_BAIL("Transition timed out\n", OMX_ErrorUndefined);

        if (pContext->eState != eToState)
            OMX_CONF_SET_ERROR_BAIL("Incorrect transition\n", OMX_ErrorUndefined);

OMX_CONF_TEST_BAIL:
        return eError;
    }
开发者ID:Andproject,项目名称:platform_external_opencore,代码行数:30,代码来源:omx_conf_portcommunicationtest.c


示例7: ilctts_delete

int32_t ilctts_delete(TTSRENDER_STATE_T *st) {
	int32_t ret;
	OMX_ERRORTYPE omx_err;

	ret = ilclient_change_component_state(st->audio_render, OMX_StateIdle);
	if (ret < 0) {
		ERROR("ilctts_change_component_state returned error in ilctts_delete: %d", ret);
		return -1;
	}

	omx_err = OMX_SendCommand(ILC_GET_HANDLE(st->audio_render), OMX_CommandStateSet, OMX_StateLoaded, NULL);
	if (omx_err != OMX_ErrorNone) {
		ERROR("OMX_SendCommand returned error in ilctts_delete: %d", omx_err);
		return -1;
	}


	ilclient_disable_port_buffers(st->audio_render, 100, st->user_buffer_list, NULL, NULL);
	ilclient_change_component_state(st->audio_render, OMX_StateLoaded);
	ilclient_cleanup_components(st->list);

	ilclient_destroy(st->client);
	//sem_destroy(&st->buffer_list_sema);
	destroy_semaphores(st);
	destroy_mutexes(st);
	free(st);
	return 0;
} // end ilctts_delete
开发者ID:cromarty,项目名称:ttsprojects,代码行数:28,代码来源:core.c


示例8: _GoToState

static inline void _GoToState(int state) {

    OMX_ERRORTYPE err;
    err = OMX_SendCommand(decoderhandle, OMX_CommandStateSet, state, NULL);
    OMXE(err);

};
开发者ID:muromec,项目名称:omx-demo,代码行数:7,代码来源:demo_demux.c


示例9: portSettingsChanged

static int portSettingsChanged(JPEG_DECODER *decoder, IMAGE *jpeg){
	
	OMX_PARAM_PORTDEFINITIONTYPE portdef;
	int ret;
	
	portdef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
	portdef.nVersion.nVersion = OMX_VERSION;
	portdef.nPortIndex = decoder->outPort;
	OMX_GetParameter(decoder->handle,OMX_IndexParamPortDefinition, &portdef);
	
	jpeg->width = portdef.format.image.nFrameWidth;
	jpeg->height = portdef.format.image.nFrameHeight;
	jpeg->nData = portdef.nBufferSize;
	
	jpeg->colorSpace = COLOR_SPACE_YUV420P;
	
	OMX_SendCommand(decoder->handle, OMX_CommandPortEnable, decoder->outPort, NULL);  
	
	jpeg->pData=malloc(jpeg->nData);
	if(jpeg->pData == NULL){
		jpeg->nData=0;
		return OMX_IMAGE_ERROR_MEMORY;
	}
	
	ret = OMX_UseBuffer(decoder->handle, &decoder->pOutputBufferHeader, 
			decoder->outPort, NULL, portdef.nBufferSize, (OMX_U8 *) jpeg->pData);
	
	if (ret != OMX_ErrorNone) {
		return OMX_IMAGE_ERROR_MEMORY;
	}
	return OMX_IMAGE_OK;
}
开发者ID:HaarigerHarald,项目名称:omxiv,代码行数:32,代码来源:omx_image.c


示例10: disablePort

/**
 * Disable unwanted ports, or we can't transition to Idle state
 */
void disablePort(OMX_INDEXTYPE paramType) {
	OMX_PORT_PARAM_TYPE param;
	int nPorts;
	int startPortNumber;
	int n;

	setHeader(&param, sizeof(OMX_PORT_PARAM_TYPE));
	err = OMX_GetParameter(handle, paramType, &param);
	if(err != OMX_ErrorNone){
	fprintf(stderr, "Error in getting OMX_PORT_PARAM_TYPE parameter\n", 0);
	exit(1);
	}
	startPortNumber = ((OMX_PORT_PARAM_TYPE)param).nStartPortNumber;
	nPorts = ((OMX_PORT_PARAM_TYPE)param).nPorts;
	if (nPorts > 0) {
		fprintf(stderr, "Other has %d ports\n", nPorts);
		/* and disable it */
		for (n = 0; n < nPorts; n++) {
			err = OMX_SendCommand(handle, OMX_CommandPortDisable, n + startPortNumber, NULL);
			if (err != OMX_ErrorNone) {
				fprintf(stderr, "Error on setting port to disabled\n");
				exit(1);
			}
		}
	}
}
开发者ID:bouncingnote,项目名称:omx-test,代码行数:29,代码来源:test-video_render.c


示例11: MAKEME

static OMX_BUFFERHEADERTYPE *allocbufs(OMX_HANDLETYPE h, int port, int enable)
{
	int i;
	OMX_BUFFERHEADERTYPE *list = NULL, **end = &list;
	OMX_PARAM_PORTDEFINITIONTYPE *portdef;

	MAKEME(portdef, OMX_PARAM_PORTDEFINITIONTYPE);
	portdef->nPortIndex = port;
	OERRq(OMX_GetParameter(h, OMX_IndexParamPortDefinition, portdef));

	if (enable)
		OERRq(OMX_SendCommand(h, OMX_CommandPortEnable, port, NULL));

	for (i = 0; i < portdef->nBufferCountActual; i++) {
		OMX_U8 *buf;

		buf = vcos_malloc_aligned(portdef->nBufferSize,
			portdef->nBufferAlignment, "buffer");
//		printf("Allocated a buffer of %d bytes\n", portdef->nBufferSize);
		OERRq(OMX_UseBuffer(h, end, port, NULL, portdef->nBufferSize,
			buf));
		end = (OMX_BUFFERHEADERTYPE **) &((*end)->pAppPrivate);
	}

	free(portdef);

	return list;
}
开发者ID:arjenv,项目名称:omxtx,代码行数:28,代码来源:omxtxres.c


示例12: change_state

static inline void
change_state (GOmxCore *core,
              OMX_STATETYPE state)
{
    GST_DEBUG_OBJECT (core->object, "state=%d", state);
    OMX_SendCommand (core->omx_handle, OMX_CommandStateSet, state, NULL);
}
开发者ID:lhzhang,项目名称:gst-openmax,代码行数:7,代码来源:gstomx_util.c


示例13: omx_set_state

void
omx_set_state(omx_component_t *oc, OMX_STATETYPE reqstate)
{
  OMX_STATETYPE state;
  int attempts = 20;
  omxchk(OMX_GetState(oc->oc_handle, &state));
  omxdbg("Telling component '%s' to go from state %d -> to state %d\n", oc->oc_name, state, reqstate);


  while(1) {
    oc->oc_cmd_done = 0;

    int r = OMX_SendCommand(oc->oc_handle, OMX_CommandStateSet,
                          reqstate, NULL);

    if(r == OMX_ErrorInsufficientResources && attempts) {
      usleep(10000);
      attempts--;
      continue;
    }

    if(r != 0) {
      panic("OMX Setstate %s from %d to %d error 0x%x",
            oc->oc_name, state, reqstate, r);
    }

    if(reqstate == OMX_StateExecuting)
      omx_wait_command(oc);

    return;
  }
}
开发者ID:Ezio-PS,项目名称:movian,代码行数:32,代码来源:omx.c


示例14: removeComponent

OMX_ERRORTYPE removeComponent(OMX_COMPONENTTYPE *pOMXComponent)
{
    OMX_ERRORTYPE             ret               = OMX_ErrorNone;
    EXYNOS_OMX_BASECOMPONENT *pExynosComponent  = NULL;

    pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
    if (pExynosComponent->currentState == OMX_StateIdle) {
        (*(pExynosComponent->pCallbacks->EventHandler))(pOMXComponent,
                                                        pExynosComponent->callbackData,
                                                        OMX_EventError,
                                                        OMX_ErrorResourcesLost,
                                                        0,
                                                        NULL);
        ret = OMX_SendCommand(pOMXComponent, OMX_CommandStateSet, OMX_StateLoaded, NULL);
        if (ret != OMX_ErrorNone) {
            ret = OMX_ErrorUndefined;
            goto EXIT;
        }
    } else if ((pExynosComponent->currentState == OMX_StateExecuting) ||
               (pExynosComponent->currentState == OMX_StatePause)) {
        /* Todo */
    }

    ret = OMX_ErrorNone;

EXIT:
    return ret;
}
开发者ID:Exynos-CyanogenMod,项目名称:android_hardware_samsung_slsi_openmax,代码行数:28,代码来源:Exynos_OMX_Resourcemanager.c


示例15: Exynos_OMX_Release_Resource

OMX_ERRORTYPE Exynos_OMX_Release_Resource(OMX_COMPONENTTYPE *pOMXComponent)
{
    OMX_ERRORTYPE                 ret                   = OMX_ErrorNone;
    EXYNOS_OMX_BASECOMPONENT     *pExynosComponent      = NULL;
    EXYNOS_OMX_RM_COMPONENT_LIST *pRMComponentList      = NULL;
    EXYNOS_OMX_RM_COMPONENT_LIST *pRMComponentWaitList  = NULL;
    EXYNOS_OMX_RM_COMPONENT_LIST *pComponentTemp        = NULL;
    OMX_COMPONENTTYPE            *pOMXWaitComponent     = NULL;
    int numElem = 0;

    FunctionIn();

    Exynos_OSAL_MutexLock(ghVideoRMComponentListMutex);

    pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
    pRMComponentList = getRMList(pExynosComponent, gpRMList, NULL);
    if (pRMComponentList == NULL) {
        ret = OMX_ErrorUndefined;
        goto EXIT;
    }

    ret = removeElementList(&pRMComponentList, pOMXComponent);
    if (ret != OMX_ErrorNone)
        goto EXIT;

    ret = setRMList(pExynosComponent, gpRMList, pRMComponentList);
    if (ret != OMX_ErrorNone)
        goto EXIT;

    pRMComponentWaitList    = getRMList(pExynosComponent, gpRMWaitList, NULL);
    pComponentTemp          = pRMComponentWaitList;

    while (pComponentTemp) {
        numElem++;
        pComponentTemp = pComponentTemp->pNext;
    }

    if (numElem > 0) {
        pOMXWaitComponent = pRMComponentWaitList->pOMXStandComp;
        ret = removeElementList(&pRMComponentWaitList, pOMXWaitComponent);
        if (ret != OMX_ErrorNone)
            goto EXIT;

        ret = setRMList(pExynosComponent, gpRMWaitList, pRMComponentWaitList);
        if (ret != OMX_ErrorNone)
            goto EXIT;

        ret = OMX_SendCommand(pOMXWaitComponent, OMX_CommandStateSet, OMX_StateIdle, NULL);
        if (ret != OMX_ErrorNone)
            goto EXIT;
    }

EXIT:
    Exynos_OSAL_MutexUnlock(ghVideoRMComponentListMutex);

    FunctionOut();

    return ret;
}
开发者ID:Exynos-CyanogenMod,项目名称:android_hardware_samsung_slsi_openmax,代码行数:59,代码来源:Exynos_OMX_Resourcemanager.c


示例16: Lock

OMX_ERRORTYPE COMXCoreComponent::DisableAllPorts()
{
  if(!m_handle)
    return OMX_ErrorUndefined;

  Lock();

  OMX_ERRORTYPE omx_err = OMX_ErrorNone;

  OMX_INDEXTYPE idxTypes[] = {
    OMX_IndexParamAudioInit,
    OMX_IndexParamImageInit,
    OMX_IndexParamVideoInit, 
    OMX_IndexParamOtherInit
  };

  OMX_PORT_PARAM_TYPE ports;
  OMX_INIT_STRUCTURE(ports);

  int i;
  for(i=0; i < 4; i++)
  {
    omx_err = OMX_GetParameter(m_handle, idxTypes[i], &ports);
    if(omx_err == OMX_ErrorNone) {

      uint32_t j;
      for(j=0; j<ports.nPorts; j++)
      {
        OMX_PARAM_PORTDEFINITIONTYPE portFormat;
        OMX_INIT_STRUCTURE(portFormat);
        portFormat.nPortIndex = ports.nStartPortNumber+j;

        omx_err = OMX_GetParameter(m_handle, OMX_IndexParamPortDefinition, &portFormat);
        if(omx_err != OMX_ErrorNone)
        {
          if(portFormat.bEnabled == OMX_FALSE)
            continue;
        }

        omx_err = OMX_SendCommand(m_handle, OMX_CommandPortDisable, ports.nStartPortNumber+j, NULL);
        if(omx_err != OMX_ErrorNone)
        {
          CLog::Log(LOGERROR, "COMXCoreComponent::DisableAllPorts - Error disable port %d on component %s omx_err(0x%08x)", 
            (int)(ports.nStartPortNumber) + j, m_componentName.c_str(), (int)omx_err);
        }
        omx_err = WaitForCommand(OMX_CommandPortDisable, ports.nStartPortNumber+j);
        if(omx_err != OMX_ErrorNone && omx_err != OMX_ErrorSameState)
        {
          UnLock();
          return omx_err;
        }
      }
    }
  }

  UnLock();

  return OMX_ErrorNone;
}
开发者ID:AnXi-TieGuanYin-Tea,项目名称:plex-home-theatre,代码行数:59,代码来源:OMXCore.cpp


示例17: send

 CommandHelper const& send() const {
     print(__FUNCTION__);
     if (Cmd < OMX_CommandMax) {
         OMX_ERRORTYPE err = OMX_SendCommand(self->component, Cmd, nParam1, pCmdData);
         ERR_EXIT_IF(err!=OMX_ErrorNone, "OMX_SendCommand");
     }
     return *this;
 }
开发者ID:hyz,项目名称:dotfiles,代码行数:8,代码来源:demo.cpp


示例18: startupDecoder

static int startupDecoder(JPEG_DECODER * decoder){
	ilclient_change_component_state(decoder->component,OMX_StateIdle);
	
	OMX_IMAGE_PARAM_PORTFORMATTYPE imagePortFormat;
	memset(&imagePortFormat, 0, sizeof(OMX_IMAGE_PARAM_PORTFORMATTYPE));
	imagePortFormat.nSize = sizeof(OMX_IMAGE_PARAM_PORTFORMATTYPE);
	imagePortFormat.nVersion.nVersion = OMX_VERSION;
	imagePortFormat.nPortIndex = decoder->inPort;
	imagePortFormat.eCompressionFormat = OMX_IMAGE_CodingJPEG;
	OMX_SetParameter(decoder->handle,OMX_IndexParamImagePortFormat, &imagePortFormat);
	
	OMX_PARAM_PORTDEFINITIONTYPE portdef;
	portdef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
	portdef.nVersion.nVersion = OMX_VERSION;
	portdef.nPortIndex = decoder->inPort;
	OMX_GetParameter(decoder->handle,OMX_IndexParamPortDefinition, &portdef);
	
	portdef.nBufferCountActual = DECODER_BUFFER_NUM;
	
	OMX_SetParameter(decoder->handle,OMX_IndexParamPortDefinition, &portdef);
	
	OMX_SendCommand(decoder->handle, OMX_CommandPortEnable, decoder->inPort, NULL);
	
	int i;
	for (i = 0; i < DECODER_BUFFER_NUM; i++) {
		if (OMX_AllocateBuffer(decoder->handle,
					&(decoder->ppInputBufferHeader[i]),
					decoder->inPort,
					NULL, portdef.nBufferSize) != OMX_ErrorNone) {
			return OMX_IMAGE_ERROR_MEMORY;
		}
	}
	
	int ret = ilclient_wait_for_event(decoder->component, OMX_EventCmdComplete, 
				OMX_CommandPortEnable, 0, decoder->inPort, 0, 0, TIMEOUT_MS);
	if (ret != 0) {
		return OMX_IMAGE_ERROR_PORTS;
	}
	
	ret = OMX_SendCommand(decoder->handle, OMX_CommandStateSet, OMX_StateExecuting, NULL);
	if (ret != OMX_ErrorNone) {
		return OMX_IMAGE_ERROR_EXECUTING;
	}
	
	return OMX_IMAGE_OK;
}
开发者ID:HaarigerHarald,项目名称:omxiv,代码行数:46,代码来源:omx_image.c


示例19: SampleTest_TransitionWait

/*========================================================*/
OMX_ERRORTYPE SampleTest_TransitionWait(OMX_STATETYPE eToState,
    SampleCompTestCtxt * pContext)
{
	OMX_ERRORTYPE eError = OMX_ErrorNone;
	OMX_PARAM_PORTDEFINITIONTYPE tPortDef;
	OMX_U32 i, j;

	eError = OMX_SendCommand(pContext->hComp, OMX_CommandStateSet,
	    eToState, NULL);
	OMX_TEST_BAIL_IF_ERROR(eError);

	if ((eToState == OMX_StateIdle) &&
	    (pContext->eState == OMX_StateLoaded))
	{
		for (i = 0; i < NUM_DOMAINS; i++)
		{
			for (j = pContext->sPortParam[i].nStartPortNumber;
			    j < pContext->sPortParam[i].nStartPortNumber
			    + pContext->sPortParam[i].nPorts; j++)
			{

				OMX_TEST_INIT_STRUCT(tPortDef,
				    OMX_PARAM_PORTDEFINITIONTYPE);
				tPortDef.nPortIndex = j;
//printf("\nCalling GetParam before UseBuf on port %d\n",j);
				eError = OMX_GetParameter(pContext->hComp,
				    OMX_IndexParamPortDefinition,
				    (OMX_PTR) & tPortDef);
				OMX_TEST_BAIL_IF_ERROR(eError);

//                    if(tPortDef.bEnabled)//AD
				eError =
				    SampleTest_AllocateBuffers(pContext,
				    &tPortDef);

				OMX_TEST_BAIL_IF_ERROR(eError);
			}
		}
	} else if ((eToState == OMX_StateLoaded) &&
	    (pContext->eState == OMX_StateIdle))
	{

		eError = SampleTest_DeInitBuffers(pContext);
		OMX_TEST_BAIL_IF_ERROR(eError);

	}
	printf("\nWaiting for state set event\n");
	TIMM_OSAL_SemaphoreObtain(pContext->hStateSetEvent,
	    TIMM_OSAL_SUSPEND);
	printf("\nState set event recd.\n");

	if (pContext->eState != eToState)
		OMX_TEST_SET_ERROR_BAIL(OMX_ErrorUndefined,
		    " InComplete Transition \n");

      OMX_TEST_BAIL:
	return eError;
}
开发者ID:0xD34D,项目名称:android_device_amazon_tate,代码行数:59,代码来源:test_sample_proxy.c


示例20: lock

OMX_ERRORTYPE Component::disablePort(unsigned int port)//default: wait=false
{

	

	lock();
#ifdef DEBUG_PORTS
    ofLogVerbose(__func__) << componentName << " port: " << port;
#endif
    
    OMX_ERRORTYPE error;
	error = OMX_SendCommand(handle, OMX_CommandPortDisable, port, NULL);
    OMX_TRACE(error);
    unlock();
    return error;
#if 0
	if(error == OMX_ErrorNone)
	{
		unlock();
		return error;
	}
	OMX_PARAM_PORTDEFINITIONTYPE portFormat;
	OMX_INIT_STRUCTURE(portFormat);
	portFormat.nPortIndex = port;

	error = OMX_GetParameter(handle, OMX_IndexParamPortDefinition, &portFormat);
    OMX_TRACE(error);



	if(portFormat.bEnabled == OMX_TRUE)
	{
		error = OMX_SendCommand(handle, OMX_CommandPortDisable, port, NULL);
        OMX_TRACE(error);

		if(error != OMX_ErrorNone)
		{
			unlock();
			return error;
		}
    }
	unlock();
	return error;
#endif
}
开发者ID:freesnail,项目名称:ofxOMXPlayer,代码行数:45,代码来源:Component.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ OMX_SetParameter函数代码示例发布时间:2022-05-30
下一篇:
C++ OMX_INIT_STRUCTURE函数代码示例发布时间: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