Gstreamer-GstStructure

相关连接:https://blog.csdn.net/knowledgebao/article/details/84621238


https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/GstStructure.html#gst-structure

GstStructure — Generic structure containing fields of names and values。类似于map的一个结构。key的类型是:GQuary,value的类型是GValue。

关于GQuery的详细描述,详见下边链接(描述差不多,哪个可以访问用哪个):

https://blog.csdn.net/hiccupzhu/article/details/16832649

https://blog.csdn.net/wfreehorse/article/details/70238231

https://blog.csdn.net/xtx1990/article/details/8161390

关于GValue的详细描述,详见下边链接(描述差不多,哪个可以访问用哪个):

http://blog.sina.com.cn/s/blog_3e97f02b0100bf2c.html

关于GstValue的链接:

https://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gstreamer-GstValue.html

gchar *gst_value_serialize (const GValue *value):

tries to transform the given value into a string representation that allows getting back this string later on using gst_value_deserialize().

Free-function: g_free,必须free掉。

Parameters

value

GValue to serialize

 

Returns:the serialization for value or NULL if none exists.


gst_structure_foreach:
功能:遍历structure,通过回调的方式列举,举例如下: 

gboolean gst_structure_foreach (const GstStructure *structure,
                       GstStructureForeachFunc func,
                       gpointer user_data);
static gboolean print_field(GQuark field, const GValue * value, gpointer pfx) {
    gchar *str = gst_value_serialize(value);
    g_print("%s  %15s: %s\n", (gchar *)pfx, g_quark_to_string(field), str);
    g_free(str);
    return TRUE;
}
void print_caps(const GstCaps * caps, const gchar * pfx) {
    guint i;
    for (i = 0; i < gst_caps_get_size(caps); i++) {
        GstStructure *structure = gst_caps_get_structure(caps, i);
        gst_structure_foreach(structure, print_field, (gpointer)pfx); 
    }
}

gst_structure_id_get_value ():

功能:通过GQark获取GValue。

const GValue * gst_structure_id_get_value (const GstStructure *structure,
                            GQuark field);

猜你喜欢

转载自blog.csdn.net/knowledgebao/article/details/84937559
今日推荐