使用egypt+graphviz分析ffplay的函数调用关系图

在《Ffplay视频播放流程》文章中我给出了一个ffplay的函数调用关系图,在分析代码上会有不小的帮助。那么本文就详细的描述如何从源码中一步步的得到我们想要的函数调用关系图。

前置条件

下载ffmpeg源码

安装graphviz:sudo>http://www.gson.org/egypt/

编译整个ffmepg

我采用的是默认配置+直接编译的方式,即./configure &&>ffmpeg$ makeCC ffplay.oLD ffplay_gCP ffplaySTRIP ffplay
我们从上述输出中可以看到,编译ffplay主要有四步:编译(CC),链接(LD),重命名(CP),去除符号表操作(STRIP),其中编译阶段是我们重点要分析的,因为编译是对源码的直接分析和处理。

生成RTL文件

确定了需要在编译ffplay的步骤后,我们在makefile中找到具体的编译函数:

define COMPILE
       $(call $(1)DEP,$(1))
       $($(1)) $($(1)FLAGS) $($(1)_DEPFLAGS) $($(1)_C) $($(1)_O) $<
endef

因为是编译ffplay.c文件,即此处的$(1)指的是CC,对应的$($(1)FLAGS)就是$(CCFLAGS),而CCFLAGS的定义中包含$(CFLAGS),即按照 egypt中的说明,我们在$(CFLAGS)的定义中添加-fdump-rtl-expand参数即可在make的时候成成RTL文件:

CFLAGS     += $(ECFLAGS) -fdump-rtl-expand<
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
以下是使用HTML绘制气泡的示例代码,展示了15个国家的GDP和人口之间的关系: ```html <!DOCTYPE html> <html> <head> <title>Bubble Chart Example</title> <style> .chart { width: 600px; height: 400px; margin: 0 auto; position: relative; } .chart .country { position: absolute; display: inline-block; width: 10px; height: 10px; border-radius: 50%; background-color: #0077CC; opacity: 0.8; transition: all 0.3s ease-in-out; cursor: pointer; } .chart .country:hover { transform: scale(1.5); opacity: 1; } .chart .country[data-country="China"] { left: 20%; top: 50%; width: 50px; height: 50px; } .chart .country[data-country="India"] { left: 40%; top: 30%; width: 30px; height: 30px; } .chart .country[data-country="United States"] { left: 60%; top: 20%; width: 40px; height: 40px; } .chart .country[data-country="Indonesia"] { left: 70%; top: 50%; width: 20px; height: 20px; } .chart .country[data-country="Pakistan"] { left: 30%; top: 60%; width: 15px; height: 15px; } .chart .country[data-country="Brazil"] { left: 50%; top: 70%; width: 25px; height: 25px; } .chart .country[data-country="Nigeria"] { left: 80%; top: 70%; width: 18px; height: 18px; } .chart .country[data-country="Bangladesh"] { left: 10%; top: 20%; width: 12px; height: 12px; } .chart .country[data-country="Russia"] { left: 30%; top: 10%; width: 35px; height: 35px; } .chart .country[data-country="Japan"] { left: 60%; top: 50%; width: 28px; height: 28px; } .chart .country[data-country="Mexico"] { left: 30%; top: 40%; width: 22px; height: 22px; } .chart .country[data-country="Philippines"] { left: 80%; top: 40%; width: 14px; height: 14px; } .chart .country[data-country="Ethiopia"] { left: 70%; top: 20%; width: 16px; height: 16px; } .chart .country[data-country="Egypt"] { left: 50%; top: 10%; width: 30px; height: 30px; } .chart .country[data-country="Vietnam"] { left: 40%; top: 70%; width: 18px; height: 18px; } </style> </head> <body> <div class="chart"> <div class="country" data-country="China" title="China GDP: $14.14T, Population: 1.39B"></div> <div class="country" data-country="India" title="India GDP: $2.94T, Population: 1.34B"></div> <div class="country" data-country="United States" title="United States GDP: $21.44T, Population: 0.33B"></div> <div class="country" data-country="Indonesia" title="Indonesia GDP: $1.15T, Population: 0.27B"></div> <div class="country" data-country="Pakistan" title="Pakistan GDP: $0.31T, Population: 0.22B"></div> <div class="country" data-country="Brazil" title="Brazil GDP: $2.05T, Population: 0.21B"></div> <div class="country" data-country="Nigeria" title="Nigeria GDP: $0.45T, Population: 0.20B"></div> <div class="country" data-country="Bangladesh" title="Bangladesh GDP: $0.31T, Population: 0.16B"></div> <div class="country" data-country="Russia" title="Russia GDP: $1.64T, Population: 0.14B"></div> <div class="country" data-country="Japan" title="Japan GDP: $5.15T, Population: 0.13B"></div> <div class="country" data-country="Mexico" title="Mexico GDP: $1.27T, Population: 0.13B"></div> <div class="country" data-country="Philippines" title="Philippines GDP: $0.31T, Population: 0.10B"></div> <div class="country" data-country="Ethiopia" title="Ethiopia GDP: $0.10T, Population: 0.10B"></div> <div class="country" data-country="Egypt" title="Egypt GDP: $0.30T, Population: 0.10B"></div> <div class="country" data-country="Vietnam" title="Vietnam GDP: $0.24T, Population: 0.10B"></div> </div> </body> </html> ``` 上述代码中,我们使用了一个包含15个国家的气泡。每个国家都用一个带有 `country` 类名的 div 元素表示,同时使用 `data-country` 属性指定了国家名称,`title` 属性指定了国家的GDP和人口信息。 我们通过CSS设置每个国家的位置、大小、颜色等属性,使它们按照GDP和人口之间的关系呈现出不同的大小和颜色。同时,我们还使用了 CSS 动画效果来使鼠标悬停在某个国家上时它放大并变得更加明显。 你可以将上述代码复制到一个 HTML 文件中并在浏览器中打开,以查看最终效果。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值