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

C++ OMX_GetParameter函数代码示例

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

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



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

示例1: autoLock

status_t OMXNodeInstance::getParameter(
        OMX_INDEXTYPE index, void *params, size_t size) {
    Mutex::Autolock autoLock(mLock);

    OMX_ERRORTYPE err = OMX_GetParameter(mHandle, index, params);
    return StatusFromOMXError(err);
}
开发者ID:RealVNC,项目名称:AndroidFrameworksBase,代码行数:7,代码来源:OMXNodeInstance.cpp


示例2: 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:hicks0074,项目名称:freescale_omx_framework,代码行数:33,代码来源:video_source_test.cpp


示例3: while

void graph::gmusicops::do_retrieve_metadata ()
{
  OMX_U32 index = 0;
  const int gmusic_index = 0;
  // Extract metadata from the gmusic source
  while (OMX_ErrorNone == dump_metadata_item (index++, gmusic_index))
  {
  };

  // Now extract metadata from the decoder
  const int decoder_index = 1;
  index = 0;
  const bool use_first_as_heading = false;
  while (OMX_ErrorNone
         == dump_metadata_item (index++, decoder_index, use_first_as_heading))
  {
  };

  OMX_GetParameter (handles_[2], OMX_IndexParamAudioPcm, &renderer_pcmtype_);

  // Now print renderer metadata
  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,代码行数:28,代码来源:tizgmusicgraphops.cpp


示例4: omx_alloc_buffers

/* Based on allocbufs from omxtx.
   Buffers are connected as a one-way linked list using pAppPrivate as the pointer to the next element */
void omx_alloc_buffers(struct omx_component_t *component, int port)
{
  int i;
  OMX_BUFFERHEADERTYPE *list = NULL, **end = &list;
  OMX_PARAM_PORTDEFINITIONTYPE portdef;

  OMX_INIT_STRUCTURE(portdef);
  portdef.nPortIndex = port;

  OERR(OMX_GetParameter(component->h, OMX_IndexParamPortDefinition, &portdef));

  if (component == &component->pipe->audio_render) {
    DEBUGF("Allocating %d buffers of %d bytes\n",(int)portdef.nBufferCountActual,(int)portdef.nBufferSize);
    DEBUGF("portdef.bEnabled=%d\n",portdef.bEnabled);
  }

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

    buf = vcos_malloc_aligned(portdef.nBufferSize, portdef.nBufferAlignment, "buffer");

    //    printf("Allocated a buffer of %u bytes\n",(unsigned int)portdef.nBufferSize);

    OERR(OMX_UseBuffer(component->h, end, port, NULL, portdef.nBufferSize, buf));

    end = (OMX_BUFFERHEADERTYPE **) &((*end)->pAppPrivate);
  }

  component->buffers = list;
}
开发者ID:andyb2000,项目名称:pidvbip,代码行数:32,代码来源:omx_utils.c


示例5: TIZ_INIT_OMX_PORT_STRUCT

OMX_ERRORTYPE
graph::vorbisdecops::set_vorbis_settings ()
{
  // Retrieve the current vorbis settings from the decoder's port #0
  OMX_AUDIO_PARAM_VORBISTYPE vorbistype_orig;
  TIZ_INIT_OMX_PORT_STRUCT (vorbistype_orig, 0 /* port id */);

  tiz_check_omx_err (OMX_GetParameter (handles_[1], OMX_IndexParamAudioVorbis,
                                       &vorbistype_orig));

  // Set the vorbis settings on decoder's port #0
  OMX_AUDIO_PARAM_VORBISTYPE vorbistype;
  TIZ_INIT_OMX_PORT_STRUCT (vorbistype, 0 /* port id */);

  probe_ptr_->get_vorbis_codec_info (vorbistype);
  vorbistype.nPortIndex = 0;
  tiz_check_omx_err (
      OMX_SetParameter (handles_[1], OMX_IndexParamAudioVorbis, &vorbistype));

  // Record whether we need to wait for a port settings change event or not
  // (the decoder output port implements the "slaving" behaviour)
  need_port_settings_changed_evt_
      = ((vorbistype_orig.nSampleRate != vorbistype.nSampleRate)
         || (vorbistype_orig.nChannels != vorbistype.nChannels));

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


示例6: omx_alloc_buffers

void
omx_alloc_buffers(omx_component_t *oc, int port)
{
  OMX_PARAM_PORTDEFINITIONTYPE portdef;

  memset(&portdef, 0, sizeof(portdef));
  portdef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
  portdef.nVersion.nVersion = OMX_VERSION;
  portdef.nPortIndex = port;

  omxchk(OMX_GetParameter(oc->oc_handle, OMX_IndexParamPortDefinition, &portdef));
  if(portdef.bEnabled != OMX_FALSE || portdef.nBufferCountActual == 0 || portdef.nBufferSize == 0)
    exit(2);

  omxdbg("Allocating buffers for %s:%d\n", oc->oc_name, port);
  omxdbg("  buffer count = %d\n", (int)portdef.nBufferCountActual);
  omxdbg("  buffer size  = %d\n", (int)portdef.nBufferSize);

  omx_send_command(oc, OMX_CommandPortEnable, port, NULL, 0);
  int i;
  for(i = 0; i < portdef.nBufferCountActual; i++) {
    OMX_BUFFERHEADERTYPE *buf;
    omxchk(OMX_AllocateBuffer(oc->oc_handle, &buf, port, NULL, portdef.nBufferSize));
    omxdbg("buf=%p\n", buf);
    buf->pAppPrivate = oc->oc_avail;
    oc->oc_avail = buf;
  }
  omx_wait_command(oc); // Waits for the OMX_CommandPortEnable command

}
开发者ID:alexandrezia,项目名称:showtime,代码行数:30,代码来源:omx.c


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


示例8: OMX_INIT_STRUCTURE

int NonTextureEngine::getFrameCounter()
{
	
	if (!isOpen) 
	{
		return 0;
	}
	OMX_CONFIG_BRCMPORTSTATSTYPE stats;
	
	OMX_INIT_STRUCTURE(stats);
	stats.nPortIndex = VIDEO_RENDER_INPUT_PORT;
	OMX_ERRORTYPE error =OMX_GetParameter(render, OMX_IndexConfigBrcmPortStats, &stats);
	if (error == OMX_ErrorNone)
	{
		/*OMX_U32 nImageCount;
		 OMX_U32 nBufferCount;
		 OMX_U32 nFrameCount;
		 OMX_U32 nFrameSkips;
		 OMX_U32 nDiscards;
		 OMX_U32 nEOS;
		 OMX_U32 nMaxFrameSize;
		 
		 OMX_TICKS nByteCount;
		 OMX_TICKS nMaxTimeDelta;
		 OMX_U32 nCorruptMBs;*/
		//ofLogVerbose(__func__) << "nFrameCount: " << stats.nFrameCount;
		frameCounter = stats.nFrameCount;
	}else
	{		
		ofLog(OF_LOG_ERROR, "error OMX_CONFIG_BRCMPORTSTATSTYPE FAIL error: 0x%08x", error);
		//frameCounter = 0;
	}
	return frameCounter;
}
开发者ID:n1ckfg,项目名称:ofxRPiCameraVideoGrabber,代码行数:34,代码来源:NonTextureEngine.cpp


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


示例10: rpi_video_port_settings_changed

static void
rpi_video_port_settings_changed(omx_component_t *oc)
{
  media_codec_t *mc = oc->oc_opaque;
  const rpi_video_codec_t *rvc = mc->opaque;
  media_pipe_t *mp = mc->mp;
  frame_info_t *fi = calloc(1, sizeof(frame_info_t));


  int sar_num = 1;
  int sar_den = 1;

  if(rvc->rvc_sar_num && rvc->rvc_sar_den) {

    sar_num = rvc->rvc_sar_num;
    sar_den = rvc->rvc_sar_den;

  } else {

    OMX_CONFIG_POINTTYPE pixel_aspect;
    OMX_INIT_STRUCTURE(pixel_aspect);
    pixel_aspect.nPortIndex = 131;
    if(OMX_GetParameter(oc->oc_handle, OMX_IndexParamBrcmPixelAspectRatio,
			&pixel_aspect) == OMX_ErrorNone) {
      sar_num = pixel_aspect.nX ?: sar_num;
      sar_den = pixel_aspect.nY ?: sar_den;
    }
  }
开发者ID:tajmouati,项目名称:showtime,代码行数:28,代码来源:rpi_video.c


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


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


示例13: StdCompCommonImage_PortFormatSupported

    static OMX_ERRORTYPE StdCompCommonImage_PortFormatSupported(
        TEST_CTXTYPE *pCtx,
        OMX_U32 nPortIndex,
        OMX_IMAGE_CODINGTYPE eCompressionFormat,
        OMX_COLOR_FORMATTYPE eColorFormat)
    {
        OMX_ERRORTYPE eError = OMX_ErrorNone;

        OMX_IMAGE_PARAM_PORTFORMATTYPE sPortFormat;

        OMX_CONF_INIT_STRUCT(sPortFormat, OMX_IMAGE_PARAM_PORTFORMATTYPE);

        OMX_OSAL_Trace(OMX_OSAL_TRACE_INFO, "Verifying port format support\n");

        sPortFormat.nPortIndex = nPortIndex;

        for (sPortFormat.nIndex = 0; ; sPortFormat.nIndex++)
        {
            eError = OMX_GetParameter(pCtx->hWrappedComp, OMX_IndexParamImagePortFormat, (OMX_PTR) & sPortFormat);
            if (OMX_ErrorNoMore == eError)
                eError = OMX_ErrorBadParameter;  // OMX_ErrorBadPortFormatEncoding
            OMX_CONF_BAIL_ON_ERROR(eError);

            if ((sPortFormat.eCompressionFormat == eCompressionFormat) &&
                    (sPortFormat.eColorFormat == eColorFormat))
                break;
        }

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


示例14: get_property

static void
get_property (GObject * obj, guint prop_id, GValue * value, GParamSpec * pspec)
{
  GstOmxBaseSink *self;

  self = GST_OMX_BASE_SINK (obj);

  if (gstomx_get_property_helper (self->gomx, prop_id, value))
    return;

  switch (prop_id) {
    case ARG_NUM_INPUT_BUFFERS:
    {
      OMX_PARAM_PORTDEFINITIONTYPE param;
      OMX_HANDLETYPE omx_handle = self->gomx->omx_handle;

      if (G_UNLIKELY (!omx_handle)) {
        GST_WARNING_OBJECT (self, "no component");
        g_value_set_uint (value, 0);
        break;
      }

      G_OMX_INIT_PARAM (param);

      param.nPortIndex = self->in_port->port_index;
      OMX_GetParameter (omx_handle, OMX_IndexParamPortDefinition, &param);

      g_value_set_uint (value, param.nBufferCountActual);
    }
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
      break;
  }
}
开发者ID:adesurya,项目名称:gst-mobile,代码行数:35,代码来源:gstomx_base_sink.c


示例15: sink_setcaps

static gboolean
sink_setcaps (GstPad * pad, GstCaps * caps)
{
  GstStructure *structure;
  GstOmxBaseFilter *omx_base;
  OMX_AUDIO_PARAM_AACPROFILETYPE param;
  gint channels = 0;
  gint sample_rate = 0;
  gint mpegversion = 0;
  const gchar *stream_format;
  G_OMX_INIT_PARAM (param);

  omx_base = GST_OMX_BASE_FILTER (GST_PAD_PARENT (pad));

  GST_INFO_OBJECT (omx_base, "setcaps (sink): %" GST_PTR_FORMAT, caps);

  structure = gst_caps_get_structure (caps, 0);

  {
    const GValue *codec_data;
    GstBuffer *buffer;

    codec_data = gst_structure_get_value (structure, "codec_data");
    if (codec_data) {
      buffer = gst_value_get_buffer (codec_data);
      omx_base->codec_data = buffer;
      gst_buffer_ref (buffer);
    }
  }

  gst_structure_get_int(structure, "mpegversion", &mpegversion);
  gst_structure_get_int(structure, "channels", &channels);
  gst_structure_get_int(structure, "rate", &sample_rate);
  stream_format = gst_structure_get_string(structure, "stream-format");

  /* retrieve current in port params */
  param.nPortIndex = omx_base->in_port->port_index;
  OMX_GetParameter (omx_base->gomx->omx_handle, OMX_IndexParamAudioAac, &param);

  if(channels > 0)
    param.nChannels = (OMX_U32)channels;
  if(sample_rate > 0)
    param.nSampleRate = (OMX_U32)sample_rate;
  if(!g_strcmp0(stream_format, "adif")) {
    param.eAACStreamFormat = OMX_AUDIO_AACStreamFormatADIF;
  }
  else if(!g_strcmp0(stream_format, "raw")) {
    param.eAACStreamFormat = OMX_AUDIO_AACStreamFormatRAW;
  }
  else if(!g_strcmp0(stream_format, "adts")) {
    if(mpegversion == 2)
      param.eAACStreamFormat = OMX_AUDIO_AACStreamFormatMP2ADTS;
    else if(mpegversion == 4)
      param.eAACStreamFormat = OMX_AUDIO_AACStreamFormatMP4ADTS;
  }
  OMX_SetParameter(omx_base->gomx->omx_handle, OMX_IndexParamAudioAac, &param);

  return gst_pad_set_caps (pad, caps);
}
开发者ID:freedesktop-unofficial-mirror,项目名称:gstreamer__attic__gst-openmax,代码行数:59,代码来源:gstomx_aacdec.c


示例16: ofLogError

OMX_ERRORTYPE Component::allocOutputBuffers()
{
	
    if(!handle) 
    {
        ofLogError(__func__) << getName() << " NO HANDLE";
        return OMX_ErrorNone;
    }
    OMX_ERRORTYPE error = OMX_ErrorNone;
	

	OMX_PARAM_PORTDEFINITIONTYPE portFormat;
	OMX_INIT_STRUCTURE(portFormat);
	portFormat.nPortIndex = outputPort;

	error = OMX_GetParameter(handle, OMX_IndexParamPortDefinition, &portFormat);
    OMX_TRACE(error);
	if(error != OMX_ErrorNone)
	{
		return error;
	}


	if(getState() != OMX_StateIdle)
	{
		if(getState() != OMX_StateLoaded)
		{
			setState(OMX_StateLoaded);
		}
		setState(OMX_StateIdle);
	}

	error = enablePort(outputPort);
    OMX_TRACE(error);
	if(error != OMX_ErrorNone)
	{
		return error;
	}

	for (size_t i = 0; i < portFormat.nBufferCountActual; i++)
	{
		OMX_BUFFERHEADERTYPE *buffer = NULL;
        error = OMX_AllocateBuffer(handle, &buffer, outputPort, NULL, portFormat.nBufferSize);
        OMX_TRACE(error);
        if(error != OMX_ErrorNone)
        {
            return error;
        }
		buffer->nOutputPortIndex = outputPort;
		buffer->nFilledLen       = 0;
		buffer->nOffset          = 0;
		buffer->pAppPrivate      = (void*)i;
        outputBuffers.push_back(buffer);
        outputBuffersAvailable.push(buffer);
	}


	return error;
}
开发者ID:freesnail,项目名称:ofxOMXPlayer,代码行数:59,代码来源:Component.cpp


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


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


示例19: Init_Decoder

int Init_Decoder(OMX_STRING audio_component)
{
    DEBUG_PRINT("Inside %s \n", __FUNCTION__);
    OMX_ERRORTYPE omxresult;
    OMX_U32 total = 0;
    typedef OMX_U8* OMX_U8_PTR;
    char *role ="audio_decoder.aac";

    static OMX_CALLBACKTYPE call_back = {
        &EventHandler,&EmptyBufferDone,&FillBufferDone
    };

    /* Init. the OpenMAX Core */
    DEBUG_PRINT("\nInitializing OpenMAX Core....\n");
    omxresult = OMX_Init();

    if(OMX_ErrorNone != omxresult) {
        DEBUG_PRINT("\n Failed to Init OpenMAX core");
          return -1;
    }
    else {
        DEBUG_PRINT("\nOpenMAX Core Init Done\n");
    }

    /* Query for audio decoders*/
    DEBUG_PRINT("Aac_test: Before entering OMX_GetComponentOfRole");
    OMX_GetComponentsOfRole(role, &total, 0);
    DEBUG_PRINT ("\nTotal components of role=%s :%lu", role, total);


    omxresult = OMX_GetHandle((OMX_HANDLETYPE*)(&aac_dec_handle),
                        (OMX_STRING)audio_component, NULL, &call_back);
    if (FAILED(omxresult)) {
        DEBUG_PRINT("\nFailed to Load the component:%s\n", audio_component);
    return -1;
    }
    else
    {
        DEBUG_PRINT("\nComponent %s is in LOADED state\n", audio_component);
    }

    /* Get the port information */
    CONFIG_VERSION_SIZE(portParam);
    omxresult = OMX_GetParameter(aac_dec_handle, OMX_IndexParamAudioInit,
                                (OMX_PTR)&portParam);

    if(FAILED(omxresult)) {
        DEBUG_PRINT("\nFailed to get Port Param\n");
    return -1;
    }
    else
    {
        DEBUG_PRINT("\nportParam.nPorts:%lu\n", portParam.nPorts);
    DEBUG_PRINT("\nportParam.nStartPortNumber:%lu\n",
                                             portParam.nStartPortNumber);
    }
    return 0;
}
开发者ID:Jasi2169,项目名称:android_device_samsung_delos3geur,代码行数:58,代码来源:omx_aac_dec_test.c


示例20: setup_ports

static void
setup_ports (GstOmxBaseFilter *self)
{
    GOmxCore *core;
    OMX_PARAM_PORTDEFINITIONTYPE param;

    core = self->gomx;

    memset (&param, 0, sizeof (param));
    param.nSize = sizeof (OMX_PARAM_PORTDEFINITIONTYPE);
    param.nVersion.s.nVersionMajor = 1;
    param.nVersion.s.nVersionMinor = 1;

    /* Input port configuration. */

    param.nPortIndex = 0;
    OMX_GetParameter (core->omx_handle, OMX_IndexParamPortDefinition, &param);
    self->in_port = g_omx_core_setup_port (core, &param);
    gst_pad_set_element_private (self->sinkpad, self->in_port);

    /* Output port configuration. */

    param.nPortIndex = 1;
    OMX_GetParameter (core->omx_handle, OMX_IndexParamPortDefinition, &param);
    self->out_port = g_omx_core_setup_port (core, &param);
    gst_pad_set_element_private (self->srcpad, self->out_port);

    if (g_getenv ("OMX_ALLOCATE_ON"))
    {
        self->in_port->omx_allocate = TRUE;
        self->out_port->omx_allocate = TRUE;
        self->share_input_buffer = FALSE;
        self->share_output_buffer = FALSE;
    }
    else if (g_getenv ("OMX_SHARE_HACK_ON"))
    {
        self->share_input_buffer = TRUE;
        self->share_output_buffer = TRUE;
    }
    else if (g_getenv ("OMX_SHARE_HACK_OFF"))
    {
        self->share_input_buffer = FALSE;
        self->share_output_buffer = FALSE;
    }
}
开发者ID:roopar,项目名称:gst-openmax,代码行数:45,代码来源:gstomx_base_filter.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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