static OMX_ERRORTYPE cc_youtube_cfgport_GetParameter (const void * ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { const cc_youtube_cfgport_t * p_obj = ap_obj; OMX_ERRORTYPE rc = OMX_ErrorNone; assert (p_obj); TIZ_TRACE (ap_hdl, "PORT [%d] GetParameter [%s]...", tiz_port_index (ap_obj), tiz_idx_to_str (a_index)); if (OMX_TizoniaIndexParamAudioYoutubeSession == a_index) { memcpy (ap_struct, &(p_obj->session_), sizeof (OMX_TIZONIA_AUDIO_PARAM_YOUTUBESESSIONTYPE)); } else if (OMX_TizoniaIndexParamAudioYoutubePlaylist == a_index) { memcpy (ap_struct, &(p_obj->playlist_), sizeof (OMX_TIZONIA_AUDIO_PARAM_YOUTUBEPLAYLISTTYPE)); } else { /* Delegate to the base port */ rc = super_GetParameter (typeOf (ap_obj, "cc_youtubecfgport"), ap_obj, ap_hdl, a_index, ap_struct); } return rc; }
static OMX_ERRORTYPE httpr_mp3port_SetParameter (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_TizoniaIndexParamIcecastMountpoint == a_index) { memcpy (&(p_obj->mountpoint_), ap_struct, sizeof(OMX_TIZONIA_ICECASTMOUNTPOINTTYPE)); p_obj->mountpoint_.cStationName[OMX_MAX_STRINGNAME_SIZE - 1] = '\000'; p_obj->mountpoint_.cStationDescription[OMX_MAX_STRINGNAME_SIZE - 1] = '\000'; p_obj->mountpoint_.cStationGenre[OMX_MAX_STRINGNAME_SIZE - 1] = '\000'; p_obj->mountpoint_.cStationUrl[OMX_MAX_STRINGNAME_SIZE - 1] = '\000'; TIZ_TRACE (ap_hdl, "Station Name [%s]...", p_obj->mountpoint_.cStationName); } else { /* Try the parent's indexes */ rc = super_SetParameter (typeOf (ap_obj, "httprmp3port"), ap_obj, ap_hdl, a_index, ap_struct); } return rc; }
static OMX_ERRORTYPE httpr_mp3port_GetParameter (const void *ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { const httpr_mp3port_t *p_obj = ap_obj; OMX_ERRORTYPE rc = OMX_ErrorNone; TIZ_TRACE (ap_hdl, "[%s]...", tiz_idx_to_str (a_index)); assert (NULL != p_obj); if (OMX_TizoniaIndexParamIcecastMountpoint == a_index) { memcpy (ap_struct, &(p_obj->mountpoint_), sizeof(OMX_TIZONIA_ICECASTMOUNTPOINTTYPE)); } else { /* Delegate to the base port */ rc = super_GetParameter (typeOf (ap_obj, "httprmp3port"), ap_obj, ap_hdl, a_index, ap_struct); } return rc; }
static OMX_ERRORTYPE loadedtoidle_SetParameter (const void * ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { /* In this transitional state, OMX_SetParameter should only be allowed */ /* until the first OMX_UseBuffer call is received */ TIZ_TRACE (ap_hdl, "[%s]", tiz_idx_to_str (a_index)); return super_SetParameter (typeOf (ap_obj, "tizloadedtoidle"), ap_obj, ap_hdl, a_index, ap_struct); }
static OMX_ERRORTYPE httpr_mp3port_GetConfig (const void *ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { const httpr_mp3port_t *p_obj = 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; p_metadata->nVersion.nVersion = OMX_VERSION; if (NULL != p_obj->p_stream_title_) { OMX_U32 metadata_buf_size = p_metadata->nSize - sizeof(OMX_U32) - sizeof(OMX_VERSIONTYPE) - sizeof(OMX_U32); OMX_U32 stream_title_len = strnlen ( p_obj->p_stream_title_, OMX_TIZONIA_MAX_SHOUTCAST_METADATA_SIZE); assert (stream_title_len < OMX_TIZONIA_MAX_SHOUTCAST_METADATA_SIZE); if (metadata_buf_size < (stream_title_len + 1) && metadata_buf_size < OMX_TIZONIA_MAX_SHOUTCAST_METADATA_SIZE) { rc = OMX_ErrorBadParameter; } else { strncpy ((char *)p_metadata->cStreamTitle, p_obj->p_stream_title_, stream_title_len); p_metadata->cStreamTitle[stream_title_len] = '\000'; } } else { p_metadata->cStreamTitle[0] = '\000'; } } else { /* Delegate to the base port */ rc = super_GetConfig (typeOf (ap_obj, "httprmp3port"), ap_obj, ap_hdl, a_index, ap_struct); } return rc; }
static OMX_ERRORTYPE demuxer_cfgport_GetConfig (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, "GetConfig [%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 to fill this info for us. */ void * p_prc = tiz_get_prc (ap_hdl); assert (p_prc); if (OMX_ErrorNone != (rc = tiz_api_GetConfig (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_GetConfig (typeOf (ap_obj, "tizdemuxercfgport"), ap_obj, ap_hdl, a_index, ap_struct); } }; return rc; }
static OMX_ERRORTYPE httpsrc_port_GetParameter (const void *ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { const httpsrc_port_t *p_obj = ap_obj; OMX_ERRORTYPE rc = OMX_ErrorNone; assert (p_obj); TIZ_TRACE (ap_hdl, "PORT [%d] GetParameter [%s]...", tiz_port_index (ap_obj), tiz_idx_to_str (a_index)); switch (a_index) { case OMX_IndexParamAudioMp3: { OMX_AUDIO_PARAM_MP3TYPE *p_mp3mode = (OMX_AUDIO_PARAM_MP3TYPE *) ap_struct; *p_mp3mode = p_obj->mp3type_; } break; case OMX_IndexParamAudioAac: { OMX_AUDIO_PARAM_AACPROFILETYPE *p_aacmode = (OMX_AUDIO_PARAM_AACPROFILETYPE *) ap_struct; *p_aacmode = p_obj->aactype_; } break; default: { if (OMX_TizoniaIndexParamAudioOpus == a_index) { OMX_TIZONIA_AUDIO_PARAM_OPUSTYPE *p_opusmode = (OMX_TIZONIA_AUDIO_PARAM_OPUSTYPE *) ap_struct; *p_opusmode = p_obj->opustype_; } else { /* Try the parent's indexes */ rc = super_GetParameter (typeOf (ap_obj, "httpsrcport"), ap_obj, ap_hdl, a_index, ap_struct); } } break; }; return rc; }
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 binaryport_SetParameter (const void * ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { tiz_binaryport_t * p_obj = (tiz_binaryport_t *) ap_obj; OMX_ERRORTYPE rc = OMX_ErrorNone; TIZ_TRACE (ap_hdl, "PORT [%d] SetParameter [%s]...", tiz_port_index (ap_obj), tiz_idx_to_str (a_index)); assert (p_obj); switch (a_index) { case OMX_IndexParamAudioPortFormat: case OMX_IndexParamVideoPortFormat: case OMX_IndexParamImagePortFormat: case OMX_IndexParamOtherPortFormat: { /* Delegate to the domain-specific port */ if (OMX_ErrorUnsupportedIndex != (rc = tiz_api_SetParameter (p_obj->p_port_, ap_hdl, a_index, ap_struct))) { return rc; } } /* NOTE: Fall through if GetParameter returned * OMX_ErrorUnsupportedIndex. So that we delegate to the parent */ /*@fallthrough@*/ default: { /* Delegate to the base port */ rc = super_SetParameter (typeOf (ap_obj, "tizbinaryport"), ap_obj, ap_hdl, a_index, ap_struct); } }; return rc; }
static OMX_ERRORTYPE scloud_cfgport_SetParameter (const void * ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { scloud_cfgport_t * p_obj = (scloud_cfgport_t *) ap_obj; OMX_ERRORTYPE rc = OMX_ErrorNone; assert (p_obj); TIZ_TRACE (ap_hdl, "PORT [%d] GetParameter [%s]...", tiz_port_index (ap_obj), tiz_idx_to_str (a_index)); if (OMX_TizoniaIndexParamAudioSoundCloudSession == a_index) { memcpy (&(p_obj->session_), ap_struct, sizeof (OMX_TIZONIA_AUDIO_PARAM_SOUNDCLOUDSESSIONTYPE)); p_obj->session_.cUserName[OMX_MAX_STRINGNAME_SIZE - 1] = '\000'; p_obj->session_.cUserPassword[OMX_MAX_STRINGNAME_SIZE - 1] = '\000'; p_obj->session_.cUserOauthToken[OMX_MAX_STRINGNAME_SIZE - 1] = '\000'; TIZ_TRACE (ap_hdl, "SoundCloud User's OAuth Token [%s]...", p_obj->session_.cUserOauthToken); } else if (OMX_TizoniaIndexParamAudioSoundCloudPlaylist == a_index) { memcpy (&(p_obj->playlist_), ap_struct, sizeof (OMX_TIZONIA_AUDIO_PARAM_SOUNDCLOUDPLAYLISTTYPE)); p_obj->playlist_.cPlaylistName[OMX_MAX_STRINGNAME_SIZE - 1] = '\000'; TIZ_TRACE (ap_hdl, "SoundCloud playlist [%s]...", p_obj->playlist_.cPlaylistName); } else { /* Delegate to the base port */ rc = super_SetParameter (typeOf (ap_obj, "scloudcfgport"), ap_obj, ap_hdl, a_index, ap_struct); } return rc; }
static OMX_ERRORTYPE spfysrc_cfgport_SetParameter (const void *ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { spfysrc_cfgport_t *p_obj = (spfysrc_cfgport_t *) ap_obj; OMX_ERRORTYPE rc = OMX_ErrorNone; assert (NULL != p_obj); TIZ_TRACE (ap_hdl, "PORT [%d] GetParameter [%s]...", tiz_port_index (ap_obj), tiz_idx_to_str (a_index)); if (OMX_TizoniaIndexParamAudioSpotifySession == a_index) { memcpy (&(p_obj->spotifysession_), ap_struct, sizeof(OMX_TIZONIA_AUDIO_PARAM_SPOTIFYSESSIONTYPE)); p_obj->spotifysession_.cUserName[OMX_MAX_STRINGNAME_SIZE - 1] = '\000'; p_obj->spotifysession_.cUserPassword[OMX_MAX_STRINGNAME_SIZE - 1] = '\000'; TIZ_TRACE (ap_hdl, "Spotify User Name [%s]...", p_obj->spotifysession_.cUserName); } else if (OMX_TizoniaIndexParamAudioSpotifyPlaylist == a_index) { memcpy (&(p_obj->playlist_), ap_struct, sizeof(OMX_TIZONIA_AUDIO_PARAM_SPOTIFYPLAYLISTTYPE)); p_obj->playlist_.cPlaylistName[OMX_MAX_STRINGNAME_SIZE - 1] = '\000'; TIZ_TRACE (ap_hdl, "Spotify playlist [%s]...", p_obj->playlist_.cPlaylistName); } else { /* Delegate to the base port */ rc = super_SetParameter (typeOf (ap_obj, "spfysrccfgport"), ap_obj, ap_hdl, a_index, ap_struct); } return rc; }
static OMX_ERRORTYPE cc_plex_cfgport_SetParameter (const void * ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { cc_plex_cfgport_t * p_obj = (cc_plex_cfgport_t *) ap_obj; OMX_ERRORTYPE rc = OMX_ErrorNone; assert (p_obj); TIZ_TRACE (ap_hdl, "PORT [%d] GetParameter [%s]...", tiz_port_index (ap_obj), tiz_idx_to_str (a_index)); if (OMX_TizoniaIndexParamAudioPlexSession == a_index) { memcpy (&(p_obj->session_), ap_struct, sizeof (OMX_TIZONIA_AUDIO_PARAM_PLEXSESSIONTYPE)); p_obj->session_.cBaseUrl[OMX_MAX_STRINGNAME_SIZE - 1] = '\0'; p_obj->session_.cAuthToken[OMX_MAX_STRINGNAME_SIZE - 1] = '\0'; TIZ_TRACE (ap_hdl, "Plex Auth Token [%s]...", p_obj->session_.cAuthToken); } else if (OMX_TizoniaIndexParamAudioPlexPlaylist == a_index) { memcpy (&(p_obj->playlist_), ap_struct, sizeof (OMX_TIZONIA_AUDIO_PARAM_PLEXPLAYLISTTYPE)); p_obj->playlist_.cPlaylistName[OMX_MAX_STRINGNAME_SIZE - 1] = '\0'; TIZ_TRACE (ap_hdl, "Plex playlist [%s]...", p_obj->playlist_.cPlaylistName); } else { /* Delegate to the base port */ rc = super_SetParameter (typeOf (ap_obj, "cc_plexcfgport"), ap_obj, ap_hdl, a_index, ap_struct); } return rc; }
static OMX_ERRORTYPE ivrport_GetConfig (const void * ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { const tiz_ivrport_t * p_obj = ap_obj; TIZ_TRACE (handleOf (ap_obj), "PORT [%d] GetConfig [%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_crotate = p_obj->crotate_; } break; case OMX_IndexConfigCommonMirror: { OMX_CONFIG_MIRRORTYPE * p_cmirror = (OMX_CONFIG_MIRRORTYPE *) ap_struct; *p_cmirror = p_obj->cmirror_; } break; case OMX_IndexConfigCommonScale: { OMX_CONFIG_SCALEFACTORTYPE * p_cscale = (OMX_CONFIG_SCALEFACTORTYPE *) ap_struct; *p_cscale = p_obj->cscale_; } break; case OMX_IndexConfigCommonInputCrop: { OMX_CONFIG_RECTTYPE * p_cincrop = (OMX_CONFIG_RECTTYPE *) ap_struct; *p_cincrop = p_obj->cincrop_; } break; case OMX_IndexConfigTimeRenderingDelay: { OMX_TIME_CONFIG_RENDERINGDELAYTYPE * p_crendelay = (OMX_TIME_CONFIG_RENDERINGDELAYTYPE *) ap_struct; *p_crendelay = p_obj->crendelay_; } break; default: { /* Try the parent's indexes */ return super_GetConfig (typeOf (ap_obj, "tizivrport"), ap_obj, ap_hdl, a_index, ap_struct); } }; return OMX_ErrorNone; }
std::string graph::omx_event_info::to_string () const { std::string info ("["); info.append (tiz_evt_to_str (static_cast< OMX_EVENTTYPE >(event_))); info.append ("]"); switch (event_) { case OMX_EventCmdComplete: { info.append (" ["); info.append (tiz_cmd_to_str (static_cast< OMX_COMMANDTYPE >(ndata1_))); info.append ("]"); if (OMX_CommandStateSet == ndata1_) { info.append (" ["); info.append (tiz_state_to_str (static_cast< OMX_STATETYPE >(ndata2_))); info.append ("]"); } else { info.append (" PORT ["); info.append (boost::lexical_cast< std::string >(ndata2_)); info.append ("]"); } } break; case OMX_EventError: { info.append (" ["); info.append (tiz_err_to_str (static_cast< OMX_ERRORTYPE >(ndata1_))); info.append ("]"); info.append (" ["); info.append (boost::lexical_cast< std::string >(ndata2_)); info.append ("]"); } break; case OMX_EventPortSettingsChanged: { info.append (" PORT ["); info.append (boost::lexical_cast< std::string >(ndata1_)); info.append ("]"); info.append (" ["); info.append (tiz_idx_to_str (static_cast< OMX_INDEXTYPE >(ndata2_))); info.append ("]"); } break; case OMX_EventBufferFlag: { info.append (" PORT ["); info.append (boost::lexical_cast< std::string >(ndata1_)); info.append ("]"); info.append (" nFlags ["); info.append (boost::lexical_cast< std::string >(ndata2_)); info.append ("]"); } break; default: { info.append (" [TO BE DONE]"); } break; }; return info; }
static OMX_ERRORTYPE httpsrc_port_apply_slaving_behaviour (void *ap_obj, void *ap_mos_port, const OMX_INDEXTYPE a_index, const OMX_PTR ap_struct, tiz_vector_t * ap_changed_idxs) { httpsrc_port_t *p_obj = ap_obj; tiz_port_t *p_base = ap_obj; OMX_ERRORTYPE rc = OMX_ErrorNone; /* OpenMAX IL 1.2 Section 3.5 : Slaving behaviour for nSamplingRate and * nChannels, both in OMX_AUDIO_PARAM_MP3TYPE and OMX_AUDIO_PARAM_AACPROFILETYPE */ assert (p_obj); assert (ap_struct); assert (ap_changed_idxs); { OMX_U32 new_rate = p_obj->mp3type_.nSampleRate; OMX_U32 new_channels = p_obj->mp3type_.nChannels; switch (a_index) { case OMX_IndexParamAudioPcm: { const OMX_AUDIO_PARAM_PCMMODETYPE *p_pcmmode = ap_struct; new_rate = p_pcmmode->nSamplingRate; new_channels = p_pcmmode->nChannels; TIZ_TRACE (handleOf (ap_obj), "OMX_IndexParamAudioPcm : new sampling rate[%d] " "new num channels[%d]", new_rate, new_channels); } break; case OMX_IndexParamAudioMp3: { const OMX_AUDIO_PARAM_MP3TYPE *p_mp3type = ap_struct; new_rate = p_mp3type->nSampleRate; new_channels = p_mp3type->nChannels; TIZ_TRACE (handleOf (ap_obj), "OMX_IndexParamAudioMp3 : new sampling rate[%d] " "new num channels[%d]", new_rate, new_channels); } break; case OMX_IndexParamAudioAac: { const OMX_AUDIO_PARAM_AACPROFILETYPE *p_aactype = ap_struct; new_rate = p_aactype->nSampleRate; new_channels = p_aactype->nChannels; TIZ_TRACE (handleOf (ap_obj), "OMX_IndexParamAudioAac : new sampling rate[%d] " "new num channels[%d]", new_rate, new_channels); } break; case OMX_IndexParamAudioVorbis: { const OMX_AUDIO_PARAM_VORBISTYPE *p_vortype = ap_struct; new_rate = p_vortype->nSampleRate; new_channels = p_vortype->nChannels; TIZ_TRACE (handleOf (ap_obj), "OMX_IndexParamAudioVorbis : new sampling rate[%d] " "new num channels[%d]", new_rate, new_channels); } break; case OMX_IndexParamAudioWma: { const OMX_AUDIO_PARAM_WMATYPE *p_wmatype = ap_struct; new_rate = p_wmatype->nSamplingRate; new_channels = p_wmatype->nChannels; TIZ_TRACE (handleOf (ap_obj), "OMX_IndexParamAudioWma : new sampling rate[%d] " "new num channels[%d]", new_rate, new_channels); } break; case OMX_IndexParamAudioRa: { const OMX_AUDIO_PARAM_RATYPE *p_ratype = ap_struct; new_rate = p_ratype->nSamplingRate; new_channels = p_ratype->nChannels; TIZ_TRACE (handleOf (ap_obj), "OMX_IndexParamAudioRa : new sampling rate[%d] " "new num channels[%d]", new_rate, new_channels); } break; case OMX_IndexParamAudioSbc: { const OMX_AUDIO_PARAM_SBCTYPE *p_sbctype = ap_struct; new_rate = p_sbctype->nSampleRate; new_channels = p_sbctype->nChannels; TIZ_TRACE (handleOf (ap_obj), "OMX_IndexParamAudioSbc : new sampling rate[%d] " "new num channels[%d]", new_rate, new_channels); } break; case OMX_IndexParamAudioAdpcm: { const OMX_AUDIO_PARAM_ADPCMTYPE *p_adpcmtype = ap_struct; new_rate = p_adpcmtype->nSampleRate; new_channels = p_adpcmtype->nChannels; TIZ_TRACE (handleOf (ap_obj), "OMX_IndexParamAudioAdpcm : new sampling rate[%d] " "new num channels[%d]", new_rate, new_channels); } break; default: { if (OMX_TizoniaIndexParamAudioOpus == a_index) { const OMX_TIZONIA_AUDIO_PARAM_OPUSTYPE *p_opustype = ap_struct; new_rate = p_opustype->nSampleRate; new_channels = p_opustype->nChannels; TIZ_TRACE (handleOf (ap_obj), "OMX_IndexParamAudioOpus : new sampling rate[%d] " "new num channels[%d]", new_rate, new_channels); } else if (OMX_TizoniaIndexParamAudioFlac == a_index) { const OMX_TIZONIA_AUDIO_PARAM_FLACTYPE *p_flactype = ap_struct; new_rate = p_flactype->nSampleRate; new_channels = p_flactype->nChannels; TIZ_TRACE (handleOf (ap_obj), "OMX_TizoniaIndexParamAudioFlac : new sampling rate[%d] " "new num channels[%d]", new_rate, new_channels); } } }; { const tiz_audioport_t *p_audio_port = ap_obj; const OMX_AUDIO_CODINGTYPE encoding = p_audio_port->port_format_.eEncoding; if (encoding == OMX_AUDIO_CodingMP3) { if ((p_obj->mp3type_.nSampleRate != new_rate) || (p_obj->mp3type_.nChannels != new_channels)) { OMX_INDEXTYPE id = OMX_IndexParamAudioMp3; p_obj->mp3type_.nSampleRate = new_rate; p_obj->mp3type_.nChannels = new_channels; tiz_vector_push_back (ap_changed_idxs, &id); TIZ_TRACE (handleOf (ap_obj), " original pid [%d] this pid [%d] : [%s] -> " "changed [OMX_IndexParamAudioMp3]...", tiz_port_index (ap_mos_port), p_base->portdef_.nPortIndex, tiz_idx_to_str (a_index)); } } else if (encoding == OMX_AUDIO_CodingAAC) { if ((p_obj->aactype_.nSampleRate != new_rate) || (p_obj->aactype_.nChannels != new_channels)) { OMX_INDEXTYPE id = OMX_IndexParamAudioAac; p_obj->aactype_.nSampleRate = new_rate; p_obj->aactype_.nChannels = new_channels; tiz_vector_push_back (ap_changed_idxs, &id); TIZ_TRACE (handleOf (ap_obj), " original pid [%d] this pid [%d] : [%s] -> " "changed [OMX_IndexParamAudioAac]...", tiz_port_index (ap_mos_port), p_base->portdef_.nPortIndex, tiz_idx_to_str (a_index)); } } } } return rc; }
static OMX_ERRORTYPE httpsrc_port_SetParameter (const void *ap_obj, OMX_HANDLETYPE ap_hdl, OMX_INDEXTYPE a_index, OMX_PTR ap_struct) { httpsrc_port_t *p_obj = (httpsrc_port_t *)ap_obj; OMX_ERRORTYPE rc = OMX_ErrorNone; assert (p_obj); TIZ_TRACE (ap_hdl, "[%s]...", tiz_idx_to_str (a_index)); switch (a_index) { case OMX_IndexParamAudioMp3: { const OMX_AUDIO_PARAM_MP3TYPE *p_mp3type = (OMX_AUDIO_PARAM_MP3TYPE *) ap_struct; switch (p_mp3type->nSampleRate) { case 16000: /* MPEG-2 */ case 24000: /* MPEG-2 */ case 22050: /* MPEG-2 */ case 32000: /* MPEG-1 */ case 44100: /* MPEG-1 */ case 48000: /* MPEG-1 */ { break; } default: { TIZ_TRACE (ap_hdl, "[%s] : OMX_ErrorBadParameter : " "Sample rate not supported [%d]. " "Returning...", tiz_idx_to_str (a_index), p_mp3type->nSampleRate); rc = OMX_ErrorBadParameter; } }; if (OMX_ErrorNone == rc) { /* Apply the new default values */ p_obj->mp3type_.nChannels = p_mp3type->nChannels; p_obj->mp3type_.nBitRate = p_mp3type->nBitRate; p_obj->mp3type_.nSampleRate = p_mp3type->nSampleRate; p_obj->mp3type_.nAudioBandWidth = p_mp3type->nAudioBandWidth; p_obj->mp3type_.eChannelMode = p_mp3type->eChannelMode; p_obj->mp3type_.eFormat = p_mp3type->eFormat; } } break; case OMX_IndexParamAudioAac: { const OMX_AUDIO_PARAM_AACPROFILETYPE *p_aactype = (OMX_AUDIO_PARAM_AACPROFILETYPE *) ap_struct; switch (p_aactype->nSampleRate) { case 8000: case 11025: case 12000: case 16000: case 22050: case 24000: case 32000: case 44100: case 48000: { break; } default: { TIZ_TRACE (ap_hdl, "[%s] : OMX_ErrorBadParameter : " "Sample rate not supported [%d]. " "Returning...", tiz_idx_to_str (a_index), p_aactype->nSampleRate); rc = OMX_ErrorBadParameter; } }; if (OMX_ErrorNone == rc) { /* Apply the new default values */ p_obj->aactype_.nChannels = p_aactype->nChannels; p_obj->aactype_.nSampleRate = p_aactype->nSampleRate; p_obj->aactype_.nBitRate = p_aactype->nBitRate; p_obj->aactype_.nAudioBandWidth = p_aactype->nAudioBandWidth; p_obj->aactype_.nFrameLength = p_aactype->nFrameLength; p_obj->aactype_.nAACtools = p_aactype->nAACtools; p_obj->aactype_.nAACERtools = p_aactype->nAACERtools; p_obj->aactype_.eAACProfile = p_aactype->eAACProfile; p_obj->aactype_.eAACStreamFormat = p_aactype->eAACStreamFormat; p_obj->aactype_.eChannelMode = p_aactype->eChannelMode; } } break; default: { if (OMX_TizoniaIndexParamAudioOpus == a_index) { const OMX_TIZONIA_AUDIO_PARAM_OPUSTYPE *p_opustype = (OMX_TIZONIA_AUDIO_PARAM_OPUSTYPE *) ap_struct; switch (p_opustype->nSampleRate) { case 8000: case 16000: case 24000: case 22050: case 32000: case 44100: case 48000: { break; } default: { TIZ_ERROR (ap_hdl, "[%s] : OMX_ErrorBadParameter : " "Sample rate not supported [%d]. " "Returning...", tiz_idx_to_str (a_index), p_opustype->nSampleRate); rc = OMX_ErrorBadParameter; } }; if (OMX_ErrorNone == rc) { /* Apply the new default values */ p_obj->opustype_.nChannels = p_opustype->nChannels; p_obj->opustype_.nBitRate = p_opustype->nBitRate; p_obj->opustype_.nSampleRate = p_opustype->nSampleRate; p_obj->opustype_.nFrameDuration = p_opustype->nFrameDuration; p_obj->opustype_.nEncoderComplexity = p_opustype->nEncoderComplexity; p_obj->opustype_.bPacketLossResilience = p_opustype->bPacketLossResilience; p_obj->opustype_.bForwardErrorCorrection = p_opustype->bForwardErrorCorrection; p_obj->opustype_.bDtx = p_opustype->bDtx; p_obj->opustype_.eChannelMode = p_opustype->eChannelMode; p_obj->opustype_.eFormat = p_opustype->eFormat; } } else { /* Try the parent's indexes */ rc = super_SetParameter (typeOf (ap_obj, "httpsrcport"), 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; }