qtcreator调试gstreamer-meson编译

gstreamer目前有cerbora和meson两种编译方式,meson是gstreamer现在合并到一个git仓库后用的编译方式,编译参考另外一篇:使用meson编译gstreamer

step 1:进入gstreamer devenv

使用meson编译gstreamer后,gstreamer的库分布在不同的目录,如果要通过qtcreator调试,通过devenv进入dev环境:

$ ninja -C build/ devenv 
ninja: Entering directory `build/'
[0/1] Running external command devenv (wrapped by meson to set env)

这时候,环境变量都被设置好了,找到gstreamer运行需要的环境变量,在这里,配置了四个,包括GST_PLUGIN_PATH,LD_LIBRARY_PATH,GST_PLUGIN_SCANNER,GST_REGISTRY。

step 2:获取GST相关环境变量

$ env | grep GST

GST_PLUGIN_SYSTEM_PATH=

GST_PLUGIN_PATH=/home/hui/ # ... 这个很长很长,省略掉

GST_REGISTRY=/home/hui/disk4t/codes/gstreamer/gst-open-source/gstreamer-meson/build/registry.dat
GST_ENCODING_TARGET_PATH=/home/hui/disk4t/codes/gstreamer/gst-open-source/gstreamer-meson/subprojects/gst-plugins-bad/data/targets

GST_PLUGIN_SCANNER=/home/hui/disk4t/codes/gstreamer/gst-open-source/gstreamer-meson/build/subprojects/gstreamer/libs/gst/helpers/gst-plugin-scanner

GST_PRESET_PATH=/home/hui/disk4t/codes/gstreamer/gst-open-source/gstreamer-meson/subprojects/gst-plugins-ugly/ext/x264:/home/hui/disk4t/codes/gstreamer/gst-open-source/gstreamer-meson/subprojects/gst-plugins-good/gst/isomp4:/home/hui/disk4t/codes/gstreamer/gst-open-source/gstreamer-meson/subprojects/gst-plugins-good/gst/equalizer:/home/hui/disk4t/codes/gstreamer/gst-open-source/gstreamer-meson/subprojects/gst-plugins-bad/gst/freeverb

step 3:获取LD_LIBRARY_PATH环境变量

$ env | grep LD_

LD_LIBRARY_PATH=/home/hui/ # ... 这个很长很长

step 4:导入代码到qtcreator

在这里插入图片描述

在这里插入图片描述

project name自己写一个就行,Location选择代码路径然后open,选择next->finish就可以了

/home/hui/disk4t/codes/gstreamer/gst-open-source/gstreamer-meson/subprojects

进入qtcreator主界面,删掉Build directory,build相关的都不需要,直接用gstreamer原始的meson build就可以

在这里插入图片描述

进入Run标签页

step 5:配置Run三项

Executable:

/home/hui/disk4t/codes/gstreamer/gst-open-source/gstreamer-meson/build/subprojects/gstreamer/tools/gst-launch-1.0

Command line arguments:

playbin uri=file:///home/hui/hbc9_h264.avi

Working directory:

/home/hui/disk4t/codes/gstreamer/gst-open-source/gstreamer-meson/

环境变量配置为前面找到的环境变量值

GST_PLUGIN_PATH
GST_PLUGIN_SCANNER
GST_REGISTRY
LD_LIBRARY_PATH

配置好后如下

在这里插入图片描述

然后在需要的地方设置断点,F5就可以进入debug模式了。

step 6:进入debug模式

上个效果图

在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值