问题描述
我正在尝试通过线程中的 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 (将#修改为@)