g_io_channel_set_close_on_unref(new_io, TRUE); bthost = hciemu_client_get_host(data->hciemu); g_io_add_watch(new_io, G_IO_IN, server_received_data,NULL); bthost_send_cid(bthost, data->handle, data->dcid, l2data->read_data, l2data->data_len);g_io_channel_unref(new_io);...
g_main_loop_unref (data.loop); g_io_channel_unref (io_stdin); gst_element_set_state (data.pipeline, GST_STATE_NULL); if (data.video_sink != NULL) gst_object_unref (data.video_sink); gst_object_unref (data.pipeline); return 0; } 通过下面的命令编译即可得到可执行文件,在终端输入相应...
data.loop = g_main_loop_new(NULL, FALSE); g_main_loop_run(data.loop); /* Free resources */ g_main_loop_unref(data.loop); g_io_channel_unref(io_stdin); gst_element_set_state(data.pipeline, GST_STATE_NULL); if(data.video_sink != NULL) gst_object_unref(data.video_sink); gst_...
gst_object_unref (data.playbin2); return -1; } /* Create a GLib Main Loop and set it to run */ data.main_loop = g_main_loop_new (NULL, FALSE); g_main_loop_run (data.main_loop); /* Free resources */ g_main_loop_unref (data.main_loop); g_io_channel_unref (io_stdin);...
g_io_channel_unref(channel); return 0; } 在这个例子中,我们使用g_io_add_watch函数来监视channel中是否有新的数据到达。如果有新数据可用,就调用回调函数read_callback来处理它。在read_callback函数中,我们不断尝试读取数据,直到没有更多数据可用或者发生了错误。如果发生了G_IO_STATUS_AGAIN错误,说明需要等待...
g_io_channel_set_buffered (channel, FALSE);g_io_add_watch(channel, G_IO_HUP, on_term_signal_pipe_closed, manager); g_io_channel_unref (channel); signal (SIGTERM, on_term_signal); } 开发者ID:lcp,项目名称:gnome-settings-daemon,代码行数:20,代码来源:main.c ...
g_io_channel_unref (io_stdin); gst_element_set_state (data.pipeline, GST_STATE_NULL); if(data.video_sink!=NULL) gst_object_unref (data.video_sink); gst_object_unref (data.pipeline); return0; } 工作流程 在主函数里面的初始化代码没有任何新的东西:初始化一个playbin2,跟踪按键,运行一...
g_io_channel_unref (io_stdin); gst_element_set_state (data.pipeline, GST_STATE_NULL); if (data.video_sink != NULL) gst_object_unref (data.video_sink); gst_object_unref (data.pipeline); return 0; } 工作流程 在主函数里面的初始化代码没有任何新的东西:初始化一个playbin2,跟踪按键,运...
g_io_channel_unref (io_stdin); gst_element_set_state (data.pipeline, GST_STATE_NULL); if (data.video_sink != NULL) gst_object_unref (data.video_sink); gst_object_unref (data.pipeline); return 0; } 复制代码 通过下面的命令编译即可得到可执行文件,在终端输入相应指令可修改播放速率。
{ g_io_channel_unix_get_fd(child_stdout), G_IO_IN | G_IO_HUP | G_IO_ERR, 0 }; gchar leftover = '\0'; gsize leftover_length = 0; gboolean result = FALSE; g_assert(self->child_pid); if (self->child_stdin) g_io_channel_unref(self->child_stdin); self->child_stdin = ...