您的位置:首页 > 其它

GStreamer使用playbin,如何给动态生成的source组件设置属性?

2011-01-03 11:25 826 查看
static void cb_playbin_notify_source(GObject *obj, GParamSpec *param, gpointer u_data)
{
// check whether this is rtsp source
gchar *objname = GST_OBJECT_NAME(obj);
g_message("objname is %s", objname);

// check whether has a `protocols' property
if (g_object_class_find_property(G_OBJECT_GET_CLASS(obj), "source")) {
GObject *source_element;
g_object_get(obj, "source", &source_element, NULL);
if (g_object_class_find_property(G_OBJECT_GET_CLASS(source_element), "protocols")) {
g_object_set(source_element, "protocols", 1, NULL);
}
g_object_unref(source_element);
}
}

// connect signal
g_signal_connect(G_OBJECT(playbin), "notify::source", G_CALLBACK(cb_playbin_notify_source), NULL);
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐