void graph::httpclntops::do_load ()
{
  assert (!comp_lst_.empty ());
  assert (!role_lst_.empty ());

  // At this point we are going to instantiate the two remaining components in
  // the graph, the audio decoder and the pcm renderer. The http source is
  // already instantiated and in Executing state.

  assert (comp_lst_.size () == 1);

  dump_stream_metadata ();

  G_OPS_BAIL_IF_ERROR (
      get_encoding_type_from_http_source (),
      "Unable to retrieve the audio encoding from the http source.");

  omx_comp_name_lst_t comp_list;
  omx_comp_role_lst_t role_list;
  G_OPS_BAIL_IF_ERROR (add_decoder_to_component_list (comp_list, role_list),
                       "Unknown/unhandled stream format.");

  comp_list.push_back (tiz::graph::util::get_default_pcm_renderer ());
  role_list.push_back ("audio_renderer.pcm");

  tiz::graph::cbackhandler &cbacks = get_cback_handler ();
  G_OPS_BAIL_IF_ERROR (
      util::instantiate_comp_list (comp_list, handles_, h2n_, &(cbacks),
                                   cbacks.get_omx_cbacks ()),
      "Unable to instantiate the component list.");

  // Now add the the new components to the base class lists
  comp_lst_.insert (comp_lst_.begin (), comp_list.begin (), comp_list.end ());
  role_lst_.insert (role_lst_.begin (), role_list.begin (), role_list.end ());
}
void graph::youtubeops::do_load_decoder ()
{
  assert (comp_lst_.size () == 2);
  assert (role_lst_.size () == 2);
  assert (handles_.size () == 2);

  // The audio decoder needs to be instantiated next.

  G_OPS_BAIL_IF_ERROR (
      get_encoding_type_from_container_demuxer (),
      "Unable to retrieve the audio encoding from the container demuxer.");

  omx_comp_name_lst_t comp_list;
  omx_comp_role_lst_t role_list;
  G_OPS_RECORD_IF_ERROR (add_decoder_to_component_list (comp_list, role_list),
                         "Unknown/unhandled stream format.");

  tiz::graph::cbackhandler &cbacks = get_cback_handler ();
  G_OPS_RECORD_IF_ERROR (
      util::instantiate_comp_list (comp_list, handles_, h2n_, &(cbacks),
                                   cbacks.get_omx_cbacks ()),
      "Unable to instantiate the component list.");

  // Now add the new components to the base class lists
  comp_lst_.insert (comp_lst_.begin (), comp_list.begin (), comp_list.end ());
  role_lst_.insert (role_lst_.begin (), role_list.begin (), role_list.end ());
}