百度的网站名山东省建设项目监理协会网站

news/2025/9/30 22:25:22/文章来源:
百度的网站名,山东省建设项目监理协会网站,注册好域名之后怎么做个人网站,wordpress 网站排名优化前言#xff1a; pad 是每个 element实例 都有的#xff0c;是 elemenet 之间沟通的代理人#xff0c;没有 pad 的 element 没法于其他element交流。 考虑到gstreamer存在继承体系#xff0c;那么如果继承类element不在init函数里创建pad#xff0c;那么在gst_element_l…前言 pad 是每个 element实例 都有的是 elemenet 之间沟通的代理人没有 pad 的 element 没法于其他element交流。 考虑到gstreamer存在继承体系那么如果继承类element不在init函数里创建pad那么在gst_element_link的时候是否可以使用父类element实例的pad呢? 下面从源码来找答案。 gst_element_link 在 gstutils.c 找到 gst_element_link(...) 的实现。 /*** gst_element_link:* src: (transfer none): a #GstElement containing the source pad.* dest: (transfer none): the #GstElement containing the destination pad.** Links src to dest. The link must be from source to* destination; the other direction will not be tried. The function looks for* existing pads that arent linked yet. It will request new pads if necessary.* Such pads need to be released manually when unlinking.* If multiple links are possible, only one is established.** Make sure you have added your elements to a bin or pipeline with* gst_bin_add() before trying to link them.** Returns: %TRUE if the elements could be linked, %FALSE otherwise.*/ gboolean gst_element_link (GstElement * src, GstElement * dest) {return gst_element_link_pads (src, NULL, dest, NULL); } 直接调用 gst_element_link_pads(...) , 同样在 gstutils.c 入参为上有element和下游element 。 gst_element_link_pads 实现同样在 gstutils.c  里。 /*** gst_element_link_pads:* src: a #GstElement containing the source pad.* srcpadname: (nullable): the name of the #GstPad in source element* or %NULL for any pad.* dest: (transfer none): the #GstElement containing the destination pad.* destpadname: (nullable): the name of the #GstPad in destination element,* or %NULL for any pad.** Links the two named pads of the source and destination elements.* Side effect is that if one of the pads has no parent, it becomes a* child of the parent of the other element. If they have different* parents, the link fails.** Returns: %TRUE if the pads could be linked, %FALSE otherwise.*/ gboolean gst_element_link_pads (GstElement * src, const gchar * srcpadname,GstElement * dest, const gchar * destpadname) {return gst_element_link_pads_full (src, srcpadname, dest, destpadname,GST_PAD_LINK_CHECK_DEFAULT); } 回到gst_element_link第二个和第四个参数为NULL结合gst_element_link_pads第二个和第四个参数为padname因此gst_element_link的行为就是“链接两个element不在两个element中指定使用哪些pad实例进行互相链接”。 gst_element_link_pads_full 这个函数有点长我们节选全文同样在 gstutils.c  里。 定义及注释说明暂且略过。 /*** gst_element_link_pads_full:* src: a #GstElement containing the source pad.* srcpadname: (nullable): the name of the #GstPad in source element* or %NULL for any pad.* dest: (transfer none): the #GstElement containing the destination pad.* destpadname: (nullable): the name of the #GstPad in destination element,* or %NULL for any pad.* flags: the #GstPadLinkCheck to be performed when linking pads.** Links the two named pads of the source and destination elements.* Side effect is that if one of the pads has no parent, it becomes a* child of the parent of the other element. If they have different* parents, the link fails.** Calling gst_element_link_pads_full() with flags %GST_PAD_LINK_CHECK_DEFAULT* is the same as calling gst_element_link_pads() and the recommended way of* linking pads with safety checks applied.** This is a convenience function for gst_pad_link_full().** Returns: %TRUE if the pads could be linked, %FALSE otherwise.*/ gboolean gst_element_link_pads_full (GstElement * src, const gchar * srcpadname,GstElement * dest, const gchar * destpadname, GstPadLinkCheck flags) 如果指定了上游element的padname 则在上游element里面查找pad实例如果查找过程出现问题则return false(对应name的pad没找到 / pad不是src pad / pad已经有peer pad了即pad已经被链接过了)。 /* get a src pad */if (srcpadname) {/* name specified, look it up */if (!(srcpad gst_element_get_static_pad (src, srcpadname))) {if ((srcpad gst_element_request_pad_simple (src, srcpadname)))srcrequest TRUE;}if (!srcpad) {GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, no pad %s:%s,GST_ELEMENT_NAME (src), srcpadname);return FALSE;} else {if (!(GST_PAD_DIRECTION (srcpad) GST_PAD_SRC)) {GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS, pad %s:%s is no src pad,GST_DEBUG_PAD_NAME (srcpad));release_and_unref_pad (src, srcpad, srcrequest);return FALSE;}if (GST_PAD_PEER (srcpad) ! NULL) {GST_CAT_DEBUG (GST_CAT_ELEMENT_PADS,pad %s:%s is already linked to %s:%s, GST_DEBUG_PAD_NAME (srcpad),GST_DEBUG_PAD_NAME (GST_PAD_PEER (srcpad)));/* already linked request pads look like static pads, so the request pad* was never requested a second time above, so no need to release it */gst_object_unref (srcpad);return FALSE;}}srcpads NULL;} 如果没有指定上有element的padname 从上游element中找到所有pad即padlist。 else {/* no name given, get the first available pad */GST_OBJECT_LOCK (src);srcpads GST_ELEMENT_PADS (src);srcpad srcpads ? GST_PAD_CAST (srcpads-data) : NULL;if (srcpad)gst_object_ref (srcpad);GST_OBJECT_UNLOCK (src);} 注意这里用的是 GST_ELEMENT_PADS (src) 是直接吧当前 element 转换为 GstElement然后获取GstElement的 pads 成员。记住 这里是 “获取 GstElement 的pads 成员”。到这里我想大家应该已经猜出来pad的继承关系了如果还没懂我们回忆一下自定义Element如何给自己添加pad。 在instance结构体里定义两个pad成员。 typedef struct _GstMyFilter {GstElement element;//padsGstPad* srcpad; //src padGstPad* sinkpad; //sink pad } GstMyFilter; 在init函数里实例化pad并且append 到 其 parent element GstElement 的 pads 列表中。 static void gst_my_filter_init(GstMyFilter *filter) {...//instantiates and assigns padsfilter-srcpad gst_pad_new_from_static_template(src_factory,src);filter-sinkpad gst_pad_new_from_static_template(sink_factory, sink);//add pads to elementgst_element_add_pad(GST_ELEMENT(filter),filter-srcpad);gst_element_add_pad(GST_ELEMENT(filter), filter-sinkpad);... } 结论 至此结合上下文我们已经可以知道 pad 是如何在继承体系中存在的了。 pad仅仅由GstElement使用所有继承自GstElement 的 element 仅仅是为 GstElement 提供了自定义的 pad实例同时参与 pad的生命周期管理(fixme if wrong)。 所以即便 自定义 element 不创建自己的 pad那么只要其 继承树里某个父类 element 在 init 函数里通过 add pad 函数向 根节点 GstElement里添加过 pad 那么这个pad就会作为总代理。

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/923304.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

软件测试工程师面试刷题:简单JAVA算法题以及解法

软件测试工程师面试刷题:简单JAVA算法题以及解法找不同给定两个字符串 s 和 t ,它们只包含小写字母。 字符串 t 由字符串 s 随机重排,然后在随机位置添加一个字母。 请找出在 t 中被添加的字母。示例 1: 输入:s =…

济南专业的设计网站免费网站建设 百度收录

NVIDIA Corporation 在 GitHub 的官方主页 References https://github.com/NVIDIA References [1] Yongqiang Cheng, https://yongqiang.blog.csdn.net/

蚌埠做网站有哪些公司买个域名

本文主要向大家详细介绍了jQuery的绑定事件和移除事件的使用方法和示例分享,这里推荐给有需要的小伙伴们参考下。有时候事件执行完了,想取消事件的效果可以通过一定的办法来处理。比如bind()(绑定事件)和unbind()(移除通过bind()方法添加的事件)方法来移…

巩义网站建设价格天津滨海新区落户政策

前言 这是我在这个网站整理的笔记,关注我,接下来还会持续更新。 作者:RodmaChen PostgreSQL--实现数据库备份恢复详细教学 一. 数据库备份二. 数据库恢复三. 存留问题 数据库备份恢复功能是每个产品所需的,以下是简单的脚本案例&a…

实用指南:React基础到进阶

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

如何做营销型手机网站优化做网站招聘的职业顾问

关于DRL的WTI模块: Weighted Token-wise Interaction: 直觉上,并非所有的单词和视频帧都同等重要。我们提供一种自适应方法,来调整每个标记的权重大小: 注:其中两个f函数都是MLP和softmax构成。 WTI的算…

九龙坡网站建设哪家好宝塔 wordpress 教程

在使用M1 在安装cocopods 前时,安装 rvm install 3.0.0遇到 rvm install 3.0.0 Error running __rvm_make -j8 备注: 该图片是借用其他博客图片,因为我的环境解决完没有保留之前错误信息。 解决方法如下: 1. brew uninstall --ignore-depe…

网站上内容列表怎么做的网站开发为什么要用框架

概述分享下最近做的一个mysql大表归档方案,仅供参考。整体思路一、明确哪些大表需做归档1、数据库表概要信息统计SELECTt1.table_schema,t1.table_name,ENGINE,table_rows,CAST( data_length / 1024.0 / 1024.0 AS DECIMAL ( 10, 2 ) ) data_size(M),CAST( index_le…

bat批处理设置临时PATH路径不能访问

前言全局说明一、说明 1.1 环境: Windows 7 旗舰版二、通常设置路径方法 set adb_PATH=d:\adb_dir set PATH=%PATH%;%adb_PATH%直接在命令行里这么写没问题 在bat脚本中,会提示找不到路径下命令三、解决方法 使用环境…

电子商务网站开发工具网站营销外包公司简介

来源:博客丨政策管理作者:贺飞(北京大学)摘要:量子计算:前途光明 道路曲折量子计算:前途光明 道路曲折(一)本周,美国国家科学院、工程院和医学院的一个由13…

2025-2026-1 20231301 《信息安全设计》第九周学习总结

View Post2025-2026-1 20231301 《信息安全设计》第九周学习总结2025-2026-1 20231301 《信息安全设计》第九周学习总结 目录作业信息学习内容总结1. 进程的本质2. 系统调用层次结构3. 进程创建与执行完整流程exec() 函…

手机网站锁定竖屏看代码建设部网站水利设计资质

合作官宣 TopOn 正式成为亚太地区首家支持自动创建Admob bidding广告源的聚合平台。目前,在TopOn后台添加Admob广告平台,您只需要重新授权Google账号,即可开通自动创建功能。此前,TopOn 已在24年2月6日官方聚合支持Google biddin…

10. Spring AI + RAG - Rainbow

10. Spring AI + RAG @目录10. Spring AI + RAGRAG概念向量:文本向量化向量数据库匹配检索SearchRequest接入ChatClientRetrievalAugmentationAdvisor最后: RAG 检索增强生成(Retrieval-augmented Generation) 对…

《AI智能体实战研发教程(从0到企业级项目落地)》全网上线|CSDN B站同步首发

《AI智能体实战研发教程(从0到企业级项目落地)》全网上线|CSDN & B站同步首发pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; f…

网站更改备案信息在哪好网站开发

Hive常用函数_20个字符串处理 以下是Hive中常用的字符串处理函数,可用于执行各种字符串处理转换操作。 1. CONCAT():将多个字符串连接在一起。 SELECT CONCAT(Hello, World); -- Output: HelloWorld2. SUBSTR():从字符串中提取子字符串&…

9. Spring AI 当中对应 MCP 的操作 - Rainbow

9. Spring AI 当中对应 MCP 的操作 @目录9. Spring AI 当中对应 MCP 的操作MCP问题:使用MCP STDIO 输出配置实操MCP Server现成共用MCP ServerMCP Client通过工具通过 Spring AI 接入 第三方的 MCP Server使用 Spring…

深入解析:JVM 内存结构

pre { white-space: pre !important; word-wrap: normal !important; overflow-x: auto !important; display: block !important; font-family: "Consolas", "Monaco", "Courier New", …

gudao网站建设闸北东莞网站建设

7-13 p070找出全部子串位置 分数 5 作者 吴敏华 单位 首都师范大学 输入两个串s1,s2,找出s2在s1中所有出现的位置。 前后两个子串的出现不能重叠。例如’aa’在 aaaa 里出现的位置只有0,2 输入格式: 第一行是整数n 接下来有n行,每行两个不带空格的字符…

深圳微信网站建设报价九游手游平台app

一、利用webapps文件夹自动部署这是最简单的方式,只要将网站直接拷贝到:tomcat根目录下的webapps文件夹里举例:helloworld文件夹下创建里index.html文件,然后把helloworld文件夹移动到tomcat根目录下webapps文件夹里,重…