static OMX_ERRORTYPE httpr_mp3port_SetConfig (const void *ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { httpr_mp3port_t *p_obj = (httpr_mp3port_t *)ap_obj; OMX_ERRORTYPE rc = OMX_ErrorNone; TIZ_TRACE (ap_hdl, "[%s]...", tiz_idx_to_str (a_index)); assert (NULL != p_obj); if (OMX_TizoniaIndexConfigIcecastMetadata == a_index) { OMX_TIZONIA_ICECASTMETADATATYPE *p_metadata = (OMX_TIZONIA_ICECASTMETADATATYPE *)ap_struct; OMX_U32 stream_title_len = strnlen ((char *)p_metadata->cStreamTitle, OMX_TIZONIA_MAX_SHOUTCAST_METADATA_SIZE + 1); if (stream_title_len > OMX_TIZONIA_MAX_SHOUTCAST_METADATA_SIZE) { rc = OMX_ErrorBadParameter; } else { TIZ_TRACE (ap_hdl, "stream_title_len [%d] Stream title [%s]...", stream_title_len, p_metadata->cStreamTitle); tiz_mem_free (p_obj->p_stream_title_); p_obj->p_stream_title_ = tiz_mem_calloc (1, stream_title_len + 1); if (NULL != p_obj->p_stream_title_) { strncpy (p_obj->p_stream_title_, (char *)p_metadata->cStreamTitle, stream_title_len); p_obj->p_stream_title_[stream_title_len] = '\000'; } TIZ_TRACE (ap_hdl, "stream_title_len [%d] Stream title [%s]...", stream_title_len, p_obj->p_stream_title_); } } else { /* Delegate to the base port */ rc = super_SetConfig (typeOf (ap_obj, "httprmp3port"), ap_obj, ap_hdl, a_index, ap_struct); } return rc; }
static OMX_ERRORTYPE demuxer_cfgport_SetConfig (const void * ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { tiz_demuxercfgport_t * p_obj = (tiz_demuxercfgport_t *) ap_obj; OMX_ERRORTYPE rc = OMX_ErrorNone; TIZ_TRACE (ap_hdl, "SetConfig [%s]...", tiz_idx_to_str (a_index)); assert (p_obj); switch (a_index) { case OMX_IndexConfigTimePosition: case OMX_IndexConfigTimeSeekMode: { /* Only the processor knows about current position or seek mode. So lets get the processor update this info for us. */ void * p_prc = tiz_get_prc (ap_hdl); assert (p_prc); if (OMX_ErrorNone != (rc = tiz_api_SetConfig (p_prc, ap_hdl, a_index, ap_struct))) { TIZ_ERROR (ap_hdl, "[%s] : Error retrieving [%s] " "from the processor", tiz_err_to_str (rc), tiz_idx_to_str (a_index)); } } break; default: { /* Delegate to the base port */ rc = super_SetConfig (typeOf (ap_obj, "tizdemuxercfgport"), ap_obj, ap_hdl, a_index, ap_struct); } }; return rc; }
static OMX_ERRORTYPE ivrport_SetConfig (const void * ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { tiz_ivrport_t * p_obj = (tiz_ivrport_t *) ap_obj; TIZ_TRACE (handleOf (ap_obj), "PORT [%d] SetConfig [%s]", tiz_port_index (ap_obj), tiz_idx_to_str (a_index)); assert (ap_obj); switch (a_index) { case OMX_IndexConfigCommonRotate: { OMX_CONFIG_ROTATIONTYPE * p_crotate = (OMX_CONFIG_ROTATIONTYPE *) ap_struct; p_obj->crotate_.nRotation = p_crotate->nRotation; } break; case OMX_IndexConfigCommonMirror: { OMX_CONFIG_MIRRORTYPE * p_cmirror = (OMX_CONFIG_MIRRORTYPE *) ap_struct; p_obj->cmirror_.eMirror = p_cmirror->eMirror; } break; case OMX_IndexConfigCommonScale: { OMX_CONFIG_SCALEFACTORTYPE * p_cscale = (OMX_CONFIG_SCALEFACTORTYPE *) ap_struct; p_obj->cscale_.xWidth = p_cscale->xWidth; p_obj->cscale_.xHeight = p_cscale->xHeight; } break; case OMX_IndexConfigCommonInputCrop: { OMX_CONFIG_RECTTYPE * p_cincrop = (OMX_CONFIG_RECTTYPE *) ap_struct; p_obj->cincrop_.nLeft = p_cincrop->nLeft; p_obj->cincrop_.nTop = p_cincrop->nTop; p_obj->cincrop_.nWidth = p_cincrop->nWidth; p_obj->cincrop_.nHeight = p_cincrop->nHeight; } break; case OMX_IndexConfigTimeRenderingDelay: { /* This is a read-only index. Simply ignore it. */ TIZ_NOTICE (ap_hdl, "Ignoring read-only index [%s] ", tiz_idx_to_str (a_index)); } break; default: { /* Try the parent's indexes */ return super_SetConfig (typeOf (ap_obj, "tizivrport"), ap_obj, ap_hdl, a_index, ap_struct); } }; return OMX_ErrorNone; }