gs--常见函数说明

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/evsqiezi/article/details/82938496

个人理解,仅供参考。

    gchar * caps_string1 = gst_caps_to_string(caps);
    gchar * caps_string2 = gst_caps_to_string(framerate_caps);
    gchar * caps_string3 = gst_caps_to_string(intersected_caps);

    g_free(caps_string1);
    g_free(caps_string2);
    g_free(caps_string3);

        gchar * caps_string = gst_caps_to_string (caps);
        g_debug ("%s: \n'%s'", G_STRFUNC, caps_string);
        g_free (caps_string);
 

按字典结构排序

gst_base_transform_find_transform

//获取src的属性,依据是capstemple跟下一个的sink的caps。
static GstCaps * gst_base_transform_find_transform (GstBaseTransform * trans, GstPad * pad, GstCaps * caps)
trans为element,pad为element的一端,caps为此pad的属性,得到另一PAD的最可能属性(必须为固定值)。这个函数返回的是能被处理的,而且能被下个元素接受的属性。

gst_caps_is_fixed

gboolean gst_caps_is_fixed (const GstCaps * caps),描述值是否是具体的,不能是范围,或者枚举。
gst_caps_intersect_full
GstCaps * gst_caps_intersect_full (GstCaps * caps1, GstCaps * caps2,GstCapsIntersectMode mode)
得到一个交织,即属于1,也属于2.
GST_CAPS_INTERSECT_FIRST is useful when an element wants topreserve another element's caps priority order when intersecting with its owncaps. Example: If caps1 is [A,B, C] and caps2 is [E, B, D, A], the resultwould be [A, B], maintaining the first caps priority on the intersection.
GST_CAPS_INTERSECT_ZIG_ZAG Zig-zags over both caps.
GST_CAPS_INTERSECT_FIRST Keeps the first caps order.
gst_caps_is_equal
gboolean  gst_caps_is_equal (const GstCaps * caps1, const GstCaps * caps2)
检查两个CAPS的集合是否一样。

gst_pad_accept_caps
gboolean  
gst_pad_accept_caps(GstPad * pad, GstCaps * caps)
检测PAD能否接受CAPS,最终还还是调用gst_base_transform_acceptcaps(acceptfunc = GST_PAD_ACCEPTCAPSFUNC (pad);),最终调用的是gst_base_transform_acceptcaps_default。

gst_pad_get_caps
GstCaps * gst_pad_get_caps (GstPad * pad)
得到这个PAD能够产生或者处理的CAPS。
gst_pad_get_allowed_caps

GstCaps * gst_pad_get_allowed_caps (GstPad * pad), 允许通过的CAPS,PAD跟PEER都能接收。

gst_pad_set_caps

 gboolean gst_pad_set_caps (GstPad * pad, GstCaps * caps), 给pad设置CAPS,如果一样就不用设置了,如果不一样,调用gst_base_transform_configure_caps(setcaps = GST_PAD_SETCAPSFUNC (pad);)进行设置,

在gst_base_transform_configure_caps中,还对另一端的PAD进行设置(调用gst_pad_set_caps )。

猜你喜欢

转载自blog.csdn.net/evsqiezi/article/details/82938496