Gstreamer-GstStructure

相关连接: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);

 

参考资料:

  1. Glib中Gquark浅析
  2. Glib中Gquark浅析
  3. glib库中的GQuark介绍
  4. GObject笔记-通用类型
  5. GstValue
  6. GstStructure

有任何问题,请联系:knowledgebao@163.com

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值