static void *spfysrc_cfgport_ctor (void *ap_obj, va_list *app) { spfysrc_cfgport_t *p_obj = super_ctor (typeOf (ap_obj, "spfysrccfgport"), ap_obj, app); assert (NULL != p_obj); tiz_check_omx_err_ret_null (tiz_port_register_index ( p_obj, OMX_TizoniaIndexParamAudioSpotifySession)); tiz_check_omx_err_ret_null (tiz_port_register_index ( p_obj, OMX_TizoniaIndexParamAudioSpotifyPlaylist)); /* Initialize the OMX_TIZONIA_AUDIO_PARAM_SPOTIFYSESSIONTYPE structure */ TIZ_INIT_OMX_STRUCT (p_obj->spotifysession_); snprintf ((char *)p_obj->spotifysession_.cUserName, sizeof(p_obj->spotifysession_.cUserName), "tizonia"); snprintf ((char *)p_obj->spotifysession_.cUserPassword, sizeof(p_obj->spotifysession_.cUserPassword), "pass"); p_obj->spotifysession_.bRememberCredentials = OMX_TRUE; p_obj->spotifysession_.ePreferredBitRate = OMX_AUDIO_SpotifyBitrate320Kbps; p_obj->spotifysession_.eConnectionType = OMX_AUDIO_SpotifyConnectionMobileWired; /* Initialize the OMX_TIZONIA_AUDIO_PARAM_SPOTIFYPLAYLISTTYPE structure */ TIZ_INIT_OMX_STRUCT (p_obj->playlist_); snprintf ((char *)p_obj->playlist_.cPlaylistName, sizeof(p_obj->playlist_.cPlaylistName), "playlist"); p_obj->playlist_.bShuffle = OMX_FALSE; return p_obj; }
static void * demuxer_cfgport_ctor (void *ap_obj, va_list * app) { tiz_demuxercfgport_t *p_obj = super_ctor (typeOf (ap_obj, "tizdemuxercfgport"), ap_obj, app); /* In addition to the indexes registered by the parent class, register here the demuxer-specific ones */ tiz_check_omx_err_ret_null (tiz_port_register_index (p_obj, OMX_IndexConfigTimePosition)); /* r/w */ tiz_check_omx_err_ret_null (tiz_port_register_index (p_obj, OMX_IndexConfigTimeSeekMode)); /* r/w */ return p_obj; }
static void * demuxerport_ctor (void *ap_obj, va_list * app) { tiz_demuxerport_t *p_obj = NULL; tiz_port_options_t *p_opts = NULL; va_list app_copy; /* Make a copy of the incoming va_list before it gets parsed by the parent class: The expected arguments are: port_opts */ va_copy (app_copy, *app); /* Now give the original to the base class */ if (NULL != (p_obj = super_ctor (typeOf (ap_obj, "tizdemuxerport"), ap_obj, app))) { /* Register the demuxer-specific indexes */ tiz_check_omx_err_ret_null (tiz_port_register_index (p_obj, OMX_IndexParamNumAvailableStreams)); tiz_check_omx_err_ret_null (tiz_port_register_index (p_obj, OMX_IndexParamActiveStream)); /* Grab the port options structure (mandatory argument) */ p_opts = va_arg (app_copy, tiz_port_options_t *); assert (NULL != p_opts); TIZ_TRACE (handleOf (ap_obj), "min_buf_size [%d]", p_opts->min_buf_size); switch (p_opts->domain) { case OMX_PortDomainAudio: { /* Let's instantiate a PCM port */ OMX_AUDIO_CODINGTYPE *p_encodings = NULL; OMX_AUDIO_PARAM_PCMMODETYPE *p_pcmmode = NULL; OMX_AUDIO_CONFIG_VOLUMETYPE *p_volume = NULL; OMX_AUDIO_CONFIG_MUTETYPE *p_mute = NULL; OMX_AUDIO_CODINGTYPE encodings[] = { OMX_AUDIO_CodingUnused, OMX_AUDIO_CodingMax }; /* Register the PCM port indexes, so this port receives the get/set requests */ tiz_check_omx_err_ret_null (tiz_port_register_index (p_obj, OMX_IndexParamAudioPcm)); tiz_check_omx_err_ret_null (tiz_port_register_index (p_obj, OMX_IndexConfigAudioVolume)); tiz_check_omx_err_ret_null (tiz_port_register_index (p_obj, OMX_IndexConfigAudioMute)); /* Get the array of OMX_AUDIO_CODINGTYPE values (mandatory argument) */ p_encodings = va_arg (app_copy, OMX_AUDIO_CODINGTYPE *); assert (NULL != p_encodings); /* Get the OMX_AUDIO_PARAM_PCMMODETYPE structure (mandatory argument) */ p_pcmmode = va_arg (app_copy, OMX_AUDIO_PARAM_PCMMODETYPE *); assert (NULL != p_pcmmode); /* Get the OMX_AUDIO_CONFIG_VOLUMETYPE structure (mandatory argument) */ p_volume = va_arg (app_copy, OMX_AUDIO_CONFIG_VOLUMETYPE *); assert (NULL != p_volume); TIZ_TRACE (handleOf (ap_obj), "p_volume->sVolume.nValue [%d]", p_volume->sVolume.nValue); /* Get the OMX_AUDIO_CONFIG_MUTETYPE structure (mandatory argument) */ p_mute = va_arg (app_copy, OMX_AUDIO_CONFIG_MUTETYPE *); assert (NULL != p_mute); p_obj->p_port_ = factory_new (typeOf (ap_obj, "tizpcmport"), p_opts, &encodings, p_pcmmode, p_volume, p_mute); if (NULL == p_obj->p_port_) { return NULL; } } break; case OMX_PortDomainVideo: { OMX_VIDEO_PORTDEFINITIONTYPE *p_portdef = NULL; OMX_VIDEO_CODINGTYPE *p_encodings = NULL; OMX_COLOR_FORMATTYPE *p_formats = NULL; /* Register the raw video port indexes, so this port receives the get/set requests */ tiz_check_omx_err_ret_null (tiz_port_register_index (p_obj, OMX_IndexParamVideoPortFormat)); /* Get the OMX_VIDEO_PORTDEFINITIONTYPE structure (mandatory argument) */ p_portdef = va_arg (app_copy, OMX_VIDEO_PORTDEFINITIONTYPE *); assert (NULL != p_portdef); /* Get the array of OMX_VIDEO_CODINGTYPE values (mandatory argument) */ p_encodings = va_arg (app_copy, OMX_VIDEO_CODINGTYPE *); assert (NULL != p_encodings); /* Get the array of OMX_COLOR_FORMATTYPE values (mandatory argument) */ p_formats = va_arg (app_copy, OMX_COLOR_FORMATTYPE *); assert (NULL != p_formats); if (NULL == (p_obj->p_port_ = factory_new (typeOf (ap_obj, "tizvideoport"), p_opts, p_portdef, p_encodings, p_formats))) { return NULL; } } break; default: assert (0); }; }