Example #1
0
void media_init()
{
  GstBus *bus;

  gst_init (NULL, NULL);
  //gst_debug_set_default_threshold(GST_LEVEL_MEMDUMP);

#if (TRANS_TYPE == TRANS_TYPE_TCP)
  gst_pipeline_tcp_init();
#else
  gst_pipeline_rtp_init();
#endif
  
  int i;
  for (i = 0; i < SERVER_LIST_NUM; i++)
    {
#if (TRANS_TYPE == TRANS_TYPE_TCP)
      add_server_to_pipeline_tcp(control_service_data[i].server_ip);
#else
      add_server_to_pipeline_rtp(control_service_data[i].server_ip);
#endif
    }
  
  bus = gst_element_get_bus (gst_data.playbin);
  gst_bus_add_watch (bus, bus_call, NULL);
  g_object_unref (bus);
}
Example #2
0
void media_init()
{
  GstBus *bus;

  get_local_ip_addr();
  gst_init (NULL, NULL);

#if (TRANS_TYPE == TRANS_TYPE_TCP)
  gst_pipeline_tcp_init();
#else
  gst_pipeline_rtp_init();
#endif
  
  g_signal_connect (gst_data.decode_bin, "pad-added", G_CALLBACK (pad_added_handler), NULL);

  bus = gst_element_get_bus (gst_data.playbin);
  gst_bus_add_watch (bus, bus_call, NULL);
  g_object_unref (bus);

  gst_element_set_state (gst_data.playbin, GST_STATE_PLAYING);
}