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);

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章