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

C++ OMX_SetParameter函数代码示例

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

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



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

示例1: omx_clk_init

static void
omx_clk_init(omx_clk_t *clk, int has_audio)
{
  OMX_TIME_CONFIG_CLOCKSTATETYPE cstate;
  clk->has_audio = has_audio;
  clk->seek_in_progress = 0;
  OMX_INIT_STRUCTURE(cstate);
  cstate.eState = OMX_TIME_ClockStateStopped;
  omxchk(OMX_SetParameter(clk->c->oc_handle,
			  OMX_IndexConfigTimeClockState, &cstate));

  omx_set_state(clk->c, OMX_StateIdle);



  OMX_INIT_STRUCTURE(cstate);

  cstate.eState = OMX_TIME_ClockStateWaitingForStartTime;
  cstate.nWaitMask = has_audio ? 1 : 2;

  omxchk(OMX_SetParameter(clk->c->oc_handle,
			  OMX_IndexConfigTimeClockState, &cstate));

  OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE refClock;
  OMX_INIT_STRUCTURE(refClock);
  refClock.eClock = has_audio ? OMX_TIME_RefClockAudio : OMX_TIME_RefClockVideo;

  omxchk(OMX_SetConfig(clk->c->oc_handle,
		       OMX_IndexConfigTimeActiveRefClock, &refClock));

  omx_set_state(clk->c, OMX_StateExecuting);

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


示例2: omx_mp_init

static void
omx_mp_init(media_pipe_t *mp)
{
  if(!(mp->mp_flags & MP_VIDEO))
    return;

#if 0
  if(0) {
    mp->mp_seek_initiate = omx_mp_begin_seek;
    mp->mp_seek_audio_done = omx_mp_seek_audio_done;
    mp->mp_seek_video_done = omx_mp_seek_video_done;
  }
#endif

  mp->mp_hold_changed = omx_mp_hold_changed;


  omx_clk_t *clk = calloc(1, sizeof(omx_clk_t));
  TAILQ_INIT(&clk->q);
  clk->mp = mp;
  clk->c = omx_component_create("OMX.broadcom.clock", &mp->mp_mutex, NULL);
  hts_cond_init(&clk->cond, &mp->mp_mutex);
  mp->mp_extra = clk;

  omx_set_state(clk->c, OMX_StateIdle);
#if 0
  OMX_TIME_CONFIG_CLOCKSTATETYPE cstate;
  OMX_INIT_STRUCTURE(cstate);
  cstate.eState = OMX_TIME_ClockStateWaitingForStartTime;
  cstate.nWaitMask = 1;
  omxchk(OMX_SetParameter(c->oc_handle,
			  OMX_IndexConfigTimeClockState, &cstate));

  OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE refClock;
  OMX_INIT_STRUCTURE(refClock);
  refClock.eClock = OMX_TIME_RefClockAudio;
  //  refClock.eClock = OMX_TIME_RefClockVideo;
  // refClock.eClock = OMX_TIME_RefClockNone;
#else
  OMX_TIME_CONFIG_CLOCKSTATETYPE cstate;
  OMX_INIT_STRUCTURE(cstate);
  cstate.eState = OMX_TIME_ClockStateRunning;
  omxchk(OMX_SetParameter(clk->c->oc_handle,
			  OMX_IndexConfigTimeClockState, &cstate));

  OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE refClock;
  OMX_INIT_STRUCTURE(refClock);
  refClock.eClock = OMX_TIME_RefClockAudio;
#endif

  omxchk(OMX_SetConfig(clk->c->oc_handle,
		       OMX_IndexConfigTimeActiveRefClock, &refClock));

  omx_set_state(clk->c, OMX_StateExecuting);

  hts_thread_create_joinable("omxclkctrl", &clk->tid, omx_clk_thread, clk,
			     THREAD_PRIO_DEMUXER);
}
开发者ID:kshostak,项目名称:showtime,代码行数:58,代码来源:omx.c


示例3: 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


示例4: omxSetAudioRenderInput

OMX_ERRORTYPE omxSetAudioRenderInput(struct OMX_COMPONENT_T *component, int sample_rate, int bits_per_coded_sample, int channels)
{
	OMX_ERRORTYPE omxErr;

	OMX_AUDIO_PARAM_PCMMODETYPE pcmInput;

	OMX_INIT_STRUCTURE(pcmInput);
	pcmInput.nPortIndex = component->inputPort;

	pcmInput.eNumData		= OMX_NumericalDataSigned;
	pcmInput.eEndian		= OMX_EndianLittle;
	pcmInput.bInterleaved		= OMX_TRUE;
	pcmInput.nBitPerSample		= bits_per_coded_sample;
	pcmInput.ePCMMode		= OMX_AUDIO_PCMModeLinear;
	pcmInput.nChannels		= channels;
	pcmInput.nSamplingRate		= sample_rate;
	pcmInput.eChannelMapping[0]	= OMX_AUDIO_ChannelLF;
	pcmInput.eChannelMapping[1]	= OMX_AUDIO_ChannelRF;

	omxErr = OMX_SetParameter(component->handle, OMX_IndexParamAudioPcm, &pcmInput);
	if(omxErr != OMX_ErrorNone) {
		logInfo(LOG_OMX, "Error SetParameter OMX_IndexParamAudioPcm for port %d status on component %s omxErr(0x%08x)\n", component->inputPort, component->componentName, (int)omxErr);
		return omxErr;
	}

	OMX_AUDIO_PARAM_PORTFORMATTYPE formatType;
	OMX_INIT_STRUCTURE(formatType);
	formatType.nPortIndex = component->inputPort;

	formatType.eEncoding = OMX_AUDIO_CodingPCM;

	omxErr = OMX_SetParameter(component->handle, OMX_IndexParamAudioPortFormat, &formatType);
	if(omxErr != OMX_ErrorNone) {
		logInfo(LOG_OMX, "Error SetParameter OMX_IndexParamAudioPortFormat for port %d status on component %s omxErr(0x%08x)\n", component->inputPort, component->componentName, (int)omxErr);
		return omxErr;
	}

	OMX_PARAM_PORTDEFINITIONTYPE portDef;
	OMX_INIT_STRUCTURE(portDef);
	portDef.nPortIndex = component->inputPort;

	portDef.format.audio.eEncoding = OMX_AUDIO_CodingPCM;

	portDef.nBufferSize = ((6144 * 2) + 15) & ~15;
	portDef.nBufferCountActual = 60;

	omxErr = OMX_SetParameter(component->handle, OMX_IndexParamPortDefinition, &portDef);
	if(omxErr != OMX_ErrorNone) {
		logInfo(LOG_OMX, "Error SetParameter OMX_IndexParamPortDefinition for port %d status on component %s omxErr(0x%08x)\n", component->inputPort, component->componentName, (int)omxErr);
		return omxErr;
	}

	return OMX_ErrorNone;
}
开发者ID:1stsetup,项目名称:piMythclient,代码行数:54,代码来源:omxAudio.c


示例5: autolock

status_t OMXNodeInstance::prepareForAdaptivePlayback(
        OMX_U32 portIndex, OMX_BOOL enable, OMX_U32 maxFrameWidth,
        OMX_U32 maxFrameHeight) {
    Mutex::Autolock autolock(mLock);

    OMX_INDEXTYPE index;
    OMX_STRING name = const_cast<OMX_STRING>(
            "OMX.google.android.index.prepareForAdaptivePlayback");

    OMX_ERRORTYPE err = OMX_GetExtensionIndex(mHandle, name, &index);
    if (err != OMX_ErrorNone) {
        ALOGW_IF(enable, "OMX_GetExtensionIndex %s failed", name);
        return StatusFromOMXError(err);
    }

    PrepareForAdaptivePlaybackParams params;
    params.nSize = sizeof(params);
    params.nVersion.s.nVersionMajor = 1;
    params.nVersion.s.nVersionMinor = 0;
    params.nVersion.s.nRevision = 0;
    params.nVersion.s.nStep = 0;

    params.nPortIndex = portIndex;
    params.bEnable = enable;
    params.nMaxFrameWidth = maxFrameWidth;
    params.nMaxFrameHeight = maxFrameHeight;
    if ((err = OMX_SetParameter(mHandle, index, &params)) != OMX_ErrorNone) {
        ALOGW("OMX_SetParameter failed for PrepareForAdaptivePlayback "
              "with error %d (0x%08x)", err, err);
        return UNKNOWN_ERROR;
    }
    return err;
}
开发者ID:FirefoxSTE,项目名称:android_frameworks_av,代码行数:33,代码来源:OMXNodeInstance.cpp


示例6: TIZ_INIT_OMX_PORT_STRUCT

void graph::gmusicops::do_reconfigure_second_tunnel ()
{
  // Retrieve the pcm settings from the decoder component
  OMX_AUDIO_PARAM_PCMMODETYPE decoder_pcmtype;
  const OMX_U32 decoder_port_id = 1;
  TIZ_INIT_OMX_PORT_STRUCT (decoder_pcmtype, decoder_port_id);
  G_OPS_BAIL_IF_ERROR (
      OMX_GetParameter (handles_[1], OMX_IndexParamAudioPcm, &decoder_pcmtype),
      "Unable to retrieve the PCM settings from the Mp3 decoder");

  // Retrieve the pcm settings from the renderer component
  OMX_AUDIO_PARAM_PCMMODETYPE renderer_pcmtype;
  const OMX_U32 renderer_port_id = 0;
  TIZ_INIT_OMX_PORT_STRUCT (renderer_pcmtype, renderer_port_id);
  G_OPS_BAIL_IF_ERROR (
      OMX_GetParameter (handles_[2], OMX_IndexParamAudioPcm, &renderer_pcmtype),
      "Unable to retrieve the PCM settings from the pcm renderer");

  // Now assign the current settings to the renderer structure
  renderer_pcmtype.nChannels = decoder_pcmtype.nChannels;
  renderer_pcmtype.nSamplingRate = decoder_pcmtype.nSamplingRate;

  // Set the new pcm settings
  G_OPS_BAIL_IF_ERROR (
      OMX_SetParameter (handles_[2], OMX_IndexParamAudioPcm, &renderer_pcmtype),
      "Unable to set the PCM settings on the audio renderer");

  TIZ_PRINTF_MAG (
      "     %ld Ch, %g KHz, %lu:%s:%s\n", renderer_pcmtype.nChannels,
      ((float)renderer_pcmtype.nSamplingRate) / 1000,
      renderer_pcmtype.nBitPerSample,
      renderer_pcmtype.eNumData == OMX_NumericalDataSigned ? "s" : "u",
      renderer_pcmtype.eEndian == OMX_EndianBig ? "b" : "l");
}
开发者ID:tizonia,项目名称:tizonia-openmax-il,代码行数:34,代码来源:tizgmusicgraphops.cpp


示例7: TIZ_LOG

OMX_ERRORTYPE
graph::gmusicops::set_channels_and_rate_on_decoder (
    const OMX_U32 channels, const OMX_U32 sampling_rate)
{
  const OMX_HANDLETYPE handle = handles_[1];  // decoder's handle
  const OMX_U32 port_id = 0;                  // decoder's input port

  TIZ_LOG (TIZ_PRIORITY_TRACE, "channels = [%d] sampling_rate = [%d]", channels,
           sampling_rate);

  // Retrieve the mp3 settings from the decoder component
  TIZ_INIT_OMX_PORT_STRUCT (decoder_mp3type_, port_id);
  tiz_check_omx (
      OMX_GetParameter (handle, OMX_IndexParamAudioMp3, &decoder_mp3type_));

  TIZ_LOG (TIZ_PRIORITY_TRACE, "channels = [%d] sampling_rate = [%d]", channels,
           sampling_rate);

  // Now assign the actual settings to the pcmtype structure
  decoder_mp3type_.nChannels = channels;
  decoder_mp3type_.nSampleRate = sampling_rate;

  // Set the new mp3 settings
  tiz_check_omx (
      OMX_SetParameter (handle, OMX_IndexParamAudioMp3, &decoder_mp3type_));

  TIZ_LOG (TIZ_PRIORITY_TRACE, "channels = [%d] sampling_rate = [%d]", channels,
           sampling_rate);

  return OMX_ErrorNone;
}
开发者ID:tizonia,项目名称:tizonia-openmax-il,代码行数:31,代码来源:tizgmusicgraphops.cpp


示例8: ForceSuppliersPerDomain

/* For each domain: force all the component's ports to be suppliers/non-suppliers */
OMX_ERRORTYPE ForceSuppliersPerDomain(OMX_INDEXTYPE nIndex, OMX_HANDLETYPE hComp, OMX_BOOL bSupplier)
{
    OMX_PORT_PARAM_TYPE oParam;
    OMX_U32 i;
    OMX_U32 iPort;
    OMX_ERRORTYPE eError;
    OMX_PARAM_BUFFERSUPPLIERTYPE oSupplier;
    OMX_PARAM_PORTDEFINITIONTYPE oPortDef;
 
    INIT_PARAM(oSupplier);
    INIT_PARAM(oParam);
    INIT_PARAM(oPortDef);
    oSupplier.eBufferSupplier = bSupplier ? OMX_BufferSupplyInput : OMX_BufferSupplyOutput;

	if (OMX_ErrorNone != (eError = OMX_GetParameter(hComp, nIndex, &oParam))) return eError;
    for (i=0;i<oParam.nPorts;i++)
    {
        iPort = oParam.nStartPortNumber + i;
        oPortDef.nPortIndex = iPort;
        OMX_GetParameter(hComp, OMX_IndexParamPortDefinition, &oPortDef);
        
        /* only set inputs */
        if (oPortDef.eDir == OMX_DirInput){
            oSupplier.nPortIndex = iPort;
            OMX_SetParameter(hComp, OMX_IndexParamCompBufferSupplier, &oSupplier);
        }
    }

	return OMX_ErrorNone;
}
开发者ID:acassis,项目名称:emlinux-ssd1935,代码行数:31,代码来源:omx_conf_testharness.c


示例9: SetFormat

static OMX_ERRORTYPE SetFormat(filter_t *filter, OmxPort *port)
{
    OMX_PARAM_PORTDEFINITIONTYPE *definition;
    filter_sys_t *sys = filter->p_sys;
    OMX_ERRORTYPE omx_error;

    definition = &port->definition;
    definition->format.image.nFrameWidth =
        filter->fmt_in.video.i_width;
    definition->format.image.nFrameHeight =
        filter->fmt_in.video.i_height;
    definition->format.image.nStride =
        ALIGN(definition->format.image.nFrameWidth, 32);
    definition->format.image.nSliceHeight =
        ALIGN(definition->format.image.nFrameHeight, 16);
    definition->nBufferSize = definition->format.image.nStride *
        definition->format.image.nSliceHeight * 3 / 2;

    omx_error = OMX_SetParameter(sys->omx_handle,
            OMX_IndexParamPortDefinition, definition);
    if (omx_error != OMX_ErrorNone)
        msg_Warn(filter, "Could not configure port format (%x: %s).",
            omx_error, ErrorToString(omx_error));
    OMX_GetParameter(sys->omx_handle, OMX_IndexParamPortDefinition,
            &definition);
    msg_Dbg(filter, "Port %u\nFormat: %ux%u (%ux%u)\nnBufferSize: %u",
            (unsigned)definition->nPortIndex,
            (unsigned)definition->format.image.nFrameWidth,
            (unsigned)definition->format.image.nFrameHeight,
            (unsigned)definition->format.image.nStride,
            (unsigned)definition->format.image.nSliceHeight,
            (unsigned)definition->nBufferSize);

    return omx_error;
}
开发者ID:krieger-od,项目名称:vlc-omx,代码行数:35,代码来源:deinterlace.c


示例10: omx_mp_init

static void
omx_mp_init(media_pipe_t *mp)
{
  if(!(mp->mp_flags & MP_VIDEO))
    return;

  omx_component_t *c;

  c = omx_component_create("OMX.broadcom.clock", &mp->mp_mutex, NULL);
  mp->mp_extra = c;

  omx_set_state(c, OMX_StateIdle);

  OMX_TIME_CONFIG_CLOCKSTATETYPE cstate;
  OMX_INIT_STRUCTURE(cstate);
  cstate.eState = OMX_TIME_ClockStateWaitingForStartTime;
  cstate.nWaitMask = 1;
  omxchk(OMX_SetParameter(c->oc_handle,
			  OMX_IndexConfigTimeClockState, &cstate));

  OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE refClock;
  OMX_INIT_STRUCTURE(refClock);
  refClock.eClock = OMX_TIME_RefClockAudio;
  //  refClock.eClock = OMX_TIME_RefClockVideo;
  // refClock.eClock = OMX_TIME_RefClockNone;

  omxchk(OMX_SetConfig(c->oc_handle,
		       OMX_IndexConfigTimeActiveRefClock, &refClock));

  omx_set_state(c, OMX_StateExecuting);
}
开发者ID:alexandrezia,项目名称:showtime,代码行数:31,代码来源:omx.c


示例11: OMX_INIT_STRUCTURE

OMX_ERRORTYPE NonTextureEngine::setupDisplay()
{

	OMX_CONFIG_DISPLAYREGIONTYPE region;
	
	OMX_INIT_STRUCTURE(region);
	region.nPortIndex = VIDEO_RENDER_INPUT_PORT; /* Video render input port */
	
	region.set = (OMX_DISPLAYSETTYPE)(OMX_DISPLAY_SET_DEST_RECT | OMX_DISPLAY_SET_FULLSCREEN | OMX_DISPLAY_SET_NOASPECT);
	
	region.fullscreen = OMX_FALSE;
	region.noaspect = OMX_TRUE;
	
	region.dest_rect.x_offset = 0;
	region.dest_rect.y_offset = 0;
	region.dest_rect.width	= omxCameraSettings.width;
	region.dest_rect.height = omxCameraSettings.height;
	
	OMX_ERRORTYPE error  = OMX_SetParameter(render, OMX_IndexConfigDisplayRegion, &region);
	
	if(error == OMX_ErrorNone)
	{
		ofLogVerbose(__func__) << "render OMX_IndexConfigDisplayRegion PASS";
	}else 
	{
		ofLog(OF_LOG_ERROR, "render OMX_IndexConfigDisplayRegion FAIL error: 0x%08x", error);
	}
	
	return error;
	
}
开发者ID:n1ckfg,项目名称:ofxRPiCameraVideoGrabber,代码行数:31,代码来源:NonTextureEngine.cpp


示例12: TIZ_INIT_OMX_STRUCT

OMX_ERRORTYPE
graph::gmusicops::set_gmusic_playlist (const OMX_HANDLETYPE handle,
                                       const std::string &playlist)
{
  // Set the Google Music playlist
  OMX_TIZONIA_AUDIO_PARAM_GMUSICPLAYLISTTYPE playlisttype;
  TIZ_INIT_OMX_STRUCT (playlisttype);
  tiz_check_omx_err (OMX_GetParameter (
      handle,
      static_cast< OMX_INDEXTYPE >(OMX_TizoniaIndexParamAudioGmusicPlaylist),
      &playlisttype));
  copy_omx_string (playlisttype.cPlaylistName, playlist);

  tizgmusicconfig_ptr_t gmusic_config
    = boost::dynamic_pointer_cast< gmusicconfig >(config_);
  assert (gmusic_config);

  playlisttype.ePlaylistType = gmusic_config->get_playlist_type ();
  playlisttype.bShuffle = playlist_->shuffle ();

  return OMX_SetParameter (
      handle,
      static_cast< OMX_INDEXTYPE >(OMX_TizoniaIndexParamAudioGmusicPlaylist),
      &playlisttype);
}
开发者ID:commshare,项目名称:tizonia-openmax-il,代码行数:25,代码来源:tizgmusicgraphops.cpp


示例13: TIZ_LOG

OMX_ERRORTYPE
graph::gmusicops::set_channels_and_rate_on_renderer (
    const OMX_U32 channels, const OMX_U32 sampling_rate,
    const std::string encoding_str)
{
  const OMX_HANDLETYPE handle = handles_[2];  // renderer's handle
  const OMX_U32 port_id = 0;                  // renderer's input port

  TIZ_LOG (TIZ_PRIORITY_TRACE, "channels = [%d] sampling_rate = [%d]", channels,
           sampling_rate);

  // Retrieve the pcm settings from the renderer component
  TIZ_INIT_OMX_PORT_STRUCT (renderer_pcmtype_, port_id);
  tiz_check_omx_err (
      OMX_GetParameter (handle, OMX_IndexParamAudioPcm, &renderer_pcmtype_));

  // Now assign the actual settings to the pcmtype structure
  renderer_pcmtype_.nChannels = channels;
  renderer_pcmtype_.nSamplingRate = sampling_rate;
  renderer_pcmtype_.eNumData = OMX_NumericalDataSigned;
  renderer_pcmtype_.eEndian
      = (encoding_ == OMX_AUDIO_CodingMP3 ? OMX_EndianBig : OMX_EndianLittle);

  // Set the new pcm settings
  tiz_check_omx_err (
      OMX_SetParameter (handle, OMX_IndexParamAudioPcm, &renderer_pcmtype_));

  std::string coding_type_str ("gmusic");
  tiz::graph::util::dump_graph_info (coding_type_str.c_str (),
                                     "Connection established",
                                     playlist_->get_current_uri ().c_str ());
  dump_stream_metadata ();

  return OMX_ErrorNone;
}
开发者ID:commshare,项目名称:tizonia-openmax-il,代码行数:35,代码来源:tizgmusicgraphops.cpp


示例14: autoLock

// XXX: This function is here for backwards compatibility.  Once the OMX
// implementations have been updated this can be removed and useGraphicBuffer2
// can be renamed to useGraphicBuffer.
status_t OMXNodeInstance::useGraphicBuffer(
        OMX_U32 portIndex, const sp<GraphicBuffer>& graphicBuffer,
        OMX::buffer_id *buffer) {
    Mutex::Autolock autoLock(mLock);

    // See if the newer version of the extension is present.
    OMX_INDEXTYPE index;
    if (OMX_GetExtensionIndex(
            mHandle,
            const_cast<OMX_STRING>("OMX.google.android.index.useAndroidNativeBuffer2"),
            &index) == OMX_ErrorNone) {
        return useGraphicBuffer2_l(portIndex, graphicBuffer, buffer);
    }

    OMX_STRING name = const_cast<OMX_STRING>(
        "OMX.google.android.index.useAndroidNativeBuffer");
    OMX_ERRORTYPE err = OMX_GetExtensionIndex(mHandle, name, &index);

    if (err != OMX_ErrorNone) {
        ALOGE("OMX_GetExtensionIndex %s failed", name);

        return StatusFromOMXError(err);
    }

    BufferMeta *bufferMeta = new BufferMeta(graphicBuffer);

    OMX_BUFFERHEADERTYPE *header;

    OMX_VERSIONTYPE ver;
    ver.s.nVersionMajor = 1;
    ver.s.nVersionMinor = 0;
    ver.s.nRevision = 0;
    ver.s.nStep = 0;
    UseAndroidNativeBufferParams params = {
        sizeof(UseAndroidNativeBufferParams), ver, portIndex, bufferMeta,
        &header, graphicBuffer,
    };

    err = OMX_SetParameter(mHandle, index, &params);

    if (err != OMX_ErrorNone) {
        ALOGE("OMX_UseAndroidNativeBuffer failed with error %d (0x%08x)", err,
                err);

        delete bufferMeta;
        bufferMeta = NULL;

        *buffer = 0;

        return UNKNOWN_ERROR;
    }

    CHECK_EQ(header->pAppPrivate, bufferMeta);

    *buffer = header;

    addActiveBuffer(portIndex, *buffer);

    return OK;
}
开发者ID:FirefoxSTE,项目名称:android_frameworks_av,代码行数:63,代码来源:OMXNodeInstance.cpp


示例15: decoding_thread_setSpeed

int decoding_thread_setSpeed(float speed){
    
    printf("try to lock thread\n");
    
    if(ILC_GET_HANDLE(omx_clock) == NULL) return -1;
    
    pthread_mutex_lock(&m_lock);

    OMX_ERRORTYPE omx_err = OMX_ErrorNone;
    OMX_TIME_CONFIG_SCALETYPE scaleType;
    OMX_INIT_STRUCTURE(scaleType);
    
    scaleType.xScale = floor((speed * pow(2,16)));
    
    printf("set speed to : %.2f, %d\n", speed, scaleType.xScale);
    
    omx_err = OMX_SetParameter(ILC_GET_HANDLE(omx_clock), OMX_IndexConfigTimeScale, &scaleType);
    if(omx_err != OMX_ErrorNone)
    {
        printf("Speed error setting OMX_IndexConfigTimeClockState : %d\n", omx_err);
        pthread_mutex_unlock(&m_lock);
        return -1;
    }
    
    printf("unlock thread\n");   
    
    pthread_mutex_unlock(&m_lock);
    return 0;
    
}
开发者ID:avilleret,项目名称:rpi_osc_video_player,代码行数:30,代码来源:video.c


示例16: 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


示例17: pixmap_decoder_create

static rpi_pixmap_decoder_t *
pixmap_decoder_create(int cfmt)
{
  rpi_pixmap_decoder_t *rpd = calloc(1, sizeof(rpi_pixmap_decoder_t));
  hts_mutex_init(&rpd->rpd_mtx);
  hts_cond_init(&rpd->rpd_cond, &rpd->rpd_mtx);

  rpd->rpd_decoder = omx_component_create("OMX.broadcom.image_decode",
					  &rpd->rpd_mtx, &rpd->rpd_cond);

  rpd->rpd_decoder->oc_port_settings_changed_cb = decoder_port_settings_changed;
  rpd->rpd_decoder->oc_opaque = rpd;

  rpd->rpd_resizer = omx_component_create("OMX.broadcom.resize",
					  &rpd->rpd_mtx, &rpd->rpd_cond);

  omx_set_state(rpd->rpd_decoder, OMX_StateIdle);

  OMX_IMAGE_PARAM_PORTFORMATTYPE fmt;
  OMX_INIT_STRUCTURE(fmt);
  fmt.nPortIndex = rpd->rpd_decoder->oc_inport;
  fmt.eCompressionFormat = cfmt;
  omxchk(OMX_SetParameter(rpd->rpd_decoder->oc_handle,
			  OMX_IndexParamImagePortFormat, &fmt));

#ifndef NOCOPY
  omx_alloc_buffers(rpd->rpd_decoder, rpd->rpd_decoder->oc_inport);
  omx_set_state(rpd->rpd_decoder, OMX_StateExecuting);
#endif
  return rpd;
}
开发者ID:Bibamaru,项目名称:showtime,代码行数:31,代码来源:rpi_pixmap.c


示例18: omx_setup

static void
omx_setup (GstOmxBaseFilter * omx_base)
{
  GstOmxBaseVideoDec *self;
  GOmxCore *gomx;

  self = GST_OMX_BASE_VIDEODEC (omx_base);
  gomx = (GOmxCore *) omx_base->gomx;

  GST_INFO_OBJECT (omx_base, "begin");

  {
    OMX_PARAM_PORTDEFINITIONTYPE param;

    G_OMX_INIT_PARAM (param);

    /* Input port configuration. */
    {
      param.nPortIndex = omx_base->in_port->port_index;
      OMX_GetParameter (gomx->omx_handle, OMX_IndexParamPortDefinition, &param);

      param.format.video.eCompressionFormat = self->compression_format;

      OMX_SetParameter (gomx->omx_handle, OMX_IndexParamPortDefinition, &param);
    }
  }

  GST_INFO_OBJECT (omx_base, "end");
}
开发者ID:tizenorg,项目名称:framework.multimedia.gst-openmax,代码行数:29,代码来源:gstomx_base_videodec.c


示例19: set_video_decoder_input_format

static void set_video_decoder_input_format(COMPONENT_T *component)
{
    int err;

    // set input video format
    printf("Setting video decoder format\n");
    OMX_VIDEO_PARAM_PORTFORMATTYPE videoPortFormat;
    //setHeader(&videoPortFormat,  sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE));
    memset(&videoPortFormat, 0, sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE));
    videoPortFormat.nSize = sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE);
    videoPortFormat.nVersion.nVersion = OMX_VERSION;

    videoPortFormat.nPortIndex = 130;
    videoPortFormat.eCompressionFormat = OMX_VIDEO_CodingMPEG2;
    //    videoPortFormat.eCompressionFormat = OMX_VIDEO_CodingAVC;

    err = OMX_SetParameter(ilclient_get_handle(component),
                           OMX_IndexParamVideoPortFormat, &videoPortFormat);
    if (err != OMX_ErrorNone)
    {
        fprintf(stderr, "Error setting video decoder format %s\n", err2str(err));
        return; // err;
    }
    else
    {
        printf("Video decoder format set up ok\n");
    }
}
开发者ID:bennettpeter,项目名称:mythscripts,代码行数:28,代码来源:il_deinterlace.c


示例20: TIZ_INIT_OMX_PORT_STRUCT

OMX_ERRORTYPE
graph::oggopusdecops::set_opus_settings ()
{
  // Retrieve the current opus settings from the decoder's port #0
  OMX_TIZONIA_AUDIO_PARAM_OPUSTYPE opustype_orig;
  TIZ_INIT_OMX_PORT_STRUCT (opustype_orig, 0 /* port id */);

  tiz_check_omx_err (OMX_GetParameter (
      handles_[1], static_cast< OMX_INDEXTYPE >(OMX_TizoniaIndexParamAudioOpus),
      &opustype_orig));

  // Set the opus settings on decoder's port #0
  OMX_TIZONIA_AUDIO_PARAM_OPUSTYPE opustype;
  TIZ_INIT_OMX_PORT_STRUCT (opustype, 0 /* port id */);

  probe_ptr_->get_opus_codec_info (opustype);
  opustype.nPortIndex = 0;
  tiz_check_omx_err (OMX_SetParameter (
      handles_[1], static_cast< OMX_INDEXTYPE >(OMX_TizoniaIndexParamAudioOpus),
      &opustype));

  // Record whether we need to wait for a port settings change event or not
  // (the decoder output port implements the "slaving" behaviour)
  //
  // TODO: Add bitrate to the list of things that might change. And then remove
  // the probe_stream_hook hack (see function below)
  need_port_settings_changed_evt_
      = ((opustype_orig.nSampleRate != opustype.nSampleRate)
         || (opustype_orig.nChannels != opustype.nChannels));

  return OMX_ErrorNone;
}
开发者ID:commshare,项目名称:tizonia-openmax-il,代码行数:32,代码来源:tizoggopusgraph.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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