zoukankan      html  css  js  c++  java
  • GStreamer使用playbin,如何给动态生成的source组件设置属性?

    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);
  • 相关阅读:
    ssh 远程命令
    POJ 2287
    POJ 2376
    hihoCoder1488
    POJ1854
    HDU 5510
    HDU 4352
    CodeForces 55D
    HDU 1517
    CodeForces 1200F
  • 原文地址:https://www.cnblogs.com/super119/p/1924440.html
Copyright © 2011-2022 走看看