相关连接:https://blog.csdn.net/knowledgebao/article/details/84621238
GstStructure — Generic structure containing fields of names and values。类似于map的一个结构。key的类型是:GQuary,value的类型是GValue,详见参考资料6.
关于GQuery的详细描述,详见参考资料的1,2,3.
关于GValue的详细描述,详见参考资料4。
关于GstValue的详细描述,详见参考资料5.
//功能:tries to transform the given value into a string representation that allows getting back this string later on using gst_value_deserialize().
//value:a GValue to serialize
//Returns:the serialization for value or NULL if none exists.
//必须调用g_free释放。
gchar *gst_value_serialize (
const GValue *value
):
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);
参考资料:
有任何问题,请联系:knowledgebao@163.com