static void *
cc_youtube_cfgport_ctor (void * ap_obj, va_list * app)
{
  cc_youtube_cfgport_t * p_obj
    = super_ctor (typeOf (ap_obj, "cc_youtubecfgport"), ap_obj, app);

  assert (p_obj);

  tiz_check_omx_ret_null (
    tiz_port_register_index (p_obj, OMX_TizoniaIndexParamAudioYoutubeSession));
  tiz_check_omx_ret_null (
    tiz_port_register_index (p_obj, OMX_TizoniaIndexParamAudioYoutubePlaylist));

  /* Initialize the OMX_TIZONIA_AUDIO_PARAM_YOUTUBESESSIONTYPE structure */
  TIZ_INIT_OMX_STRUCT (p_obj->session_);
  snprintf ((char *) p_obj->session_.cApiKey, sizeof (p_obj->session_.cApiKey),
            "xyzxyzxyzxyzxyz");

  /* Initialize the OMX_TIZONIA_AUDIO_PARAM_YOUTUBEPLAYLISTTYPE structure */
  TIZ_INIT_OMX_STRUCT (p_obj->playlist_);
  snprintf ((char *) p_obj->playlist_.cPlaylistName,
            sizeof (p_obj->playlist_.cPlaylistName), "playlist");
  p_obj->playlist_.ePlaylistType = OMX_AUDIO_YoutubePlaylistTypeUnknown;
  p_obj->playlist_.bShuffle = OMX_FALSE;

  return p_obj;
}
static void *
gmusic_cfgport_ctor (void * ap_obj, va_list * app)
{
  gmusic_cfgport_t * p_obj
    = super_ctor (typeOf (ap_obj, "gmusiccfgport"), ap_obj, app);

  assert (p_obj);

  tiz_check_omx_ret_null (
    tiz_port_register_index (p_obj, OMX_TizoniaIndexParamAudioGmusicSession));
  tiz_check_omx_ret_null (
    tiz_port_register_index (p_obj, OMX_TizoniaIndexParamAudioGmusicPlaylist));

  /* Initialize the OMX_TIZONIA_AUDIO_PARAM_GMUSICSESSIONTYPE structure */
  TIZ_INIT_OMX_STRUCT (p_obj->session_);
  snprintf ((char *) p_obj->session_.cUserName,
            sizeof (p_obj->session_.cUserName), "tizonia");
  snprintf ((char *) p_obj->session_.cUserPassword,
            sizeof (p_obj->session_.cUserPassword), "pass");
  snprintf ((char *) p_obj->session_.cDeviceId,
            sizeof (p_obj->session_.cDeviceId), "deviceId");

  /* Initialize the OMX_TIZONIA_AUDIO_PARAM_GMUSICPLAYLISTTYPE structure */
  TIZ_INIT_OMX_STRUCT (p_obj->playlist_);
  snprintf ((char *) p_obj->playlist_.cPlaylistName,
            sizeof (p_obj->playlist_.cPlaylistName), "playlist");
  p_obj->playlist_.ePlaylistType = OMX_AUDIO_GmusicPlaylistTypeUnknown;
  p_obj->playlist_.bShuffle = OMX_FALSE;
  p_obj->playlist_.bUnlimitedSearch = OMX_FALSE;

  return p_obj;
}
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 *
scloud_cfgport_ctor (void * ap_obj, va_list * app)
{
  scloud_cfgport_t * p_obj
    = super_ctor (typeOf (ap_obj, "scloudcfgport"), ap_obj, app);

  assert (p_obj);

  tiz_check_omx_ret_null (tiz_port_register_index (
    p_obj, OMX_TizoniaIndexParamAudioSoundCloudSession));
  tiz_check_omx_ret_null (tiz_port_register_index (
    p_obj, OMX_TizoniaIndexParamAudioSoundCloudPlaylist));

  /* Initialize the OMX_TIZONIA_AUDIO_PARAM_SOUNDCLOUDSESSIONTYPE structure */
  TIZ_INIT_OMX_STRUCT (p_obj->session_);
  snprintf ((char *) p_obj->session_.cUserName,
            sizeof (p_obj->session_.cUserName), "tizonia");
  snprintf ((char *) p_obj->session_.cUserPassword,
            sizeof (p_obj->session_.cUserPassword), "pass");
  snprintf ((char *) p_obj->session_.cUserOauthToken,
            sizeof (p_obj->session_.cUserOauthToken),
            "1-111111-11111111-11111111111111");

  /* Initialize the OMX_TIZONIA_AUDIO_PARAM_SOUNDCLOUDPLAYLISTTYPE structure */
  TIZ_INIT_OMX_STRUCT (p_obj->playlist_);
  snprintf ((char *) p_obj->playlist_.cPlaylistName,
            sizeof (p_obj->playlist_.cPlaylistName), "playlist");
  p_obj->playlist_.ePlaylistType = OMX_AUDIO_SoundCloudPlaylistTypeUnknown;
  p_obj->playlist_.bShuffle = OMX_FALSE;

  return p_obj;
}
Esempio n. 5
0
static OMX_ERRORTYPE
scloud_prc_config_change (void * ap_prc, OMX_U32 TIZ_UNUSED (a_pid),
                          OMX_INDEXTYPE a_config_idx)
{
  scloud_prc_t * p_prc = ap_prc;
  OMX_ERRORTYPE rc = OMX_ErrorNone;

  assert (p_prc);

  if (OMX_TizoniaIndexConfigPlaylistSkip == a_config_idx && p_prc->p_trans_)
    {
      TIZ_INIT_OMX_STRUCT (p_prc->playlist_skip_);
      tiz_check_omx (tiz_api_GetConfig (
        tiz_get_krn (handleOf (p_prc)), handleOf (p_prc),
        OMX_TizoniaIndexConfigPlaylistSkip, &p_prc->playlist_skip_));
      p_prc->playlist_skip_.nValue > 0 ? obtain_next_url (p_prc, 1)
                                       : obtain_next_url (p_prc, -1);
      /* Changing the URL has the side effect of halting the current
         download */
      tiz_urltrans_set_uri (p_prc->p_trans_, p_prc->p_uri_param_);
      if (p_prc->port_disabled_)
        {
          /* Record that the URI has changed, so that when the port is
             re-enabled, we restart the transfer */
          p_prc->uri_changed_ = true;
        }
      else
        {
          /* re-start the transfer */
          tiz_urltrans_start (p_prc->p_trans_);
        }
    }
  return rc;
}
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);
}
Esempio n. 7
0
static void *
dirble_prc_ctor (void * ap_obj, va_list * app)
{
  dirble_prc_t * p_prc = super_ctor (typeOf (ap_obj, "dirbleprc"), ap_obj, app);
  p_prc->p_outhdr_ = NULL;
  TIZ_INIT_OMX_STRUCT (p_prc->session_);
  TIZ_INIT_OMX_STRUCT (p_prc->playlist_);
  TIZ_INIT_OMX_STRUCT (p_prc->playlist_skip_);
  p_prc->p_uri_param_ = NULL;
  p_prc->p_trans_ = NULL;
  p_prc->p_dirble_ = NULL;
  p_prc->eos_ = false;
  p_prc->port_disabled_ = false;
  p_prc->uri_changed_ = false;
  p_prc->audio_coding_type_ = OMX_AUDIO_CodingUnused;
  p_prc->num_channels_ = 2;
  p_prc->samplerate_ = 44100;
  p_prc->auto_detect_on_ = false;
  p_prc->bitrate_ = ARATELIA_HTTP_SOURCE_DEFAULT_BIT_RATE_KBITS;
  update_cache_size (p_prc);
  p_prc->remove_current_url_ = false;
  return p_prc;
}
OMX_ERRORTYPE
graph::gmusicops::set_gmusic_user_and_device_id (const OMX_HANDLETYPE handle,
                                                 const std::string &user,
                                                 const std::string &pass,
                                                 const std::string &device_id)
{
  // Set the Google Music user and pass
  OMX_TIZONIA_AUDIO_PARAM_GMUSICSESSIONTYPE sessiontype;
  TIZ_INIT_OMX_STRUCT (sessiontype);
  tiz_check_omx_err (OMX_GetParameter (
      handle,
      static_cast< OMX_INDEXTYPE >(OMX_TizoniaIndexParamAudioGmusicSession),
      &sessiontype));
  copy_omx_string (sessiontype.cUserName, user);
  copy_omx_string (sessiontype.cUserPassword, pass);
  copy_omx_string (sessiontype.cDeviceId, device_id);
  return OMX_SetParameter (handle, static_cast< OMX_INDEXTYPE >(
                                       OMX_TizoniaIndexParamAudioGmusicSession),
                           &sessiontype);
}
Esempio n. 9
0
static OMX_ERRORTYPE
httpr_prc_allocate_resources (void * ap_prc, OMX_U32 a_pid)
{
  httpr_prc_t * p_prc = ap_prc;
  assert (p_prc);

  /* Retrieve http server configuration from the component's config port */
  TIZ_INIT_OMX_STRUCT (p_prc->server_info_);
  tiz_check_omx (tiz_api_GetParameter (
    tiz_get_krn (handleOf (p_prc)), handleOf (p_prc),
    OMX_TizoniaIndexParamHttpServer, &p_prc->server_info_));

  return httpr_srv_init (
    &(p_prc->p_server_), p_prc, p_prc->server_info_.cBindAddress, /* if this is
                                                            * null, the
                                                            * server will
                                                            * listen on
                                                            * all
                                                            * interfaces. */
    p_prc->server_info_.nListeningPort, p_prc->server_info_.nMaxClients,
    buffer_emptied, buffer_needed, p_prc);
}