关于 gst-rtsp-server 和 g_main_loop 的一些问题

问题描述

我正在尝试通过线程中的 gst-rtsp-server 通过一些视频文件进行流式传输。我试图了解 gst-rtsp-server lib 的使用是否需要使用 GMainLoop。如在,您应该采用的框架如下:

GMainLoop *loop;
gst_init (&argc,&argv);

loop = g_main_loop_new (NULL,FALSE);

// do whatever u need 
// create and set rtsp server,mount point
// connect signal and create callback
// ..........

g_main_loop_run (loop);

或者你不能使用 GMainLoop 吗?了解在 Gstreamer 中,使用 GMainLoop 和 g_main_loop_run() 不是必须的,而是为了方便,即您可以编写类似

int main()
{
   // do whatever u need 
   // create and set rtsp server,mount point
   // connect signal and create callback
   // ..........

   while(1)
   {
      //wait for event and respond accordingly
   }
}

额外的查询,是否还需要为这个线程创建一个新的 GMainContext 并设置?我对 Glib 和 Gobject 的编码不太熟悉

谢谢

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...