static OMX_ERRORTYPE update_pcm_mode (mp3d_prc_t * ap_prc, const OMX_U32 a_samplerate, const OMX_U32 a_channels) { assert (ap_prc); if (a_samplerate != ap_prc->pcmmode_.nSamplingRate || a_channels != ap_prc->pcmmode_.nChannels) { TIZ_DEBUG (handleOf (ap_prc), "Updating pcm mode : old samplerate [%d] new samplerate [%d]", ap_prc->pcmmode_.nSamplingRate, a_samplerate); TIZ_DEBUG (handleOf (ap_prc), "Updating pcm mode : old channels [%d] new channels [%d]", ap_prc->pcmmode_.nChannels, a_channels); ap_prc->pcmmode_.nSamplingRate = a_samplerate; ap_prc->pcmmode_.nChannels = a_channels; tiz_check_omx (tiz_krn_SetParameter_internal ( tiz_get_krn (handleOf (ap_prc)), handleOf (ap_prc), OMX_IndexParamAudioPcm, &(ap_prc->pcmmode_))); tiz_srv_issue_event ((OMX_PTR) ap_prc, OMX_EventPortSettingsChanged, ARATELIA_MP3_DECODER_OUTPUT_PORT_INDEX, OMX_IndexParamAudioPcm, /* the index of the struct that has been modififed */ NULL); } return OMX_ErrorNone; }
static OMX_ERRORTYPE set_auto_detect_on_port (dirble_prc_t * ap_prc) { OMX_PARAM_PORTDEFINITIONTYPE port_def; assert (ap_prc); TIZ_INIT_OMX_PORT_STRUCT (port_def, ARATELIA_HTTP_SOURCE_PORT_INDEX); tiz_check_omx ( tiz_api_GetParameter (tiz_get_krn (handleOf (ap_prc)), handleOf (ap_prc), OMX_IndexParamPortDefinition, &port_def)); /* Set the new value */ port_def.format.audio.eEncoding = OMX_AUDIO_CodingAutoDetect; tiz_check_omx (tiz_krn_SetParameter_internal ( tiz_get_krn (handleOf (ap_prc)), handleOf (ap_prc), OMX_IndexParamPortDefinition, &port_def)); return OMX_ErrorNone; }