使用 gst-element-maker 创建一个完全透传的 videofilter 插件
最佳答案 问答题库918位专家为你答疑解惑
系列文章目录
创建 gstreamer 插件的几种方式
使用 gst-template 创建自己的 gstreamer 插件
使用 gst-plugins-bad 里面的 gst-element-maker 工具创建gstreamer 插件
使用 gst-element-maker 创建一个完全透传的 videofilter 插件
文章目录
- 系列文章目录
- 前言
- 一、使用gst-element-maker 创建一个videofilter 插件
- 1. 使用 gst-element-maker 基于videofilter 基类模板创建一个 g2dfilter 插件
- 2. 修改 g2dfilter 插件源码,支持透传功能
- 3. 编译修改后添加透传功能的 g2dfilter 插件
- 4. 本地电脑安装 g2dfilter 插件
- 二、测试 g2dfilter 插件的透传功能
- 总结
- 参考资料
前言
本文主要介绍如何使用gst-plugins-bad 里面的 gst-element-maker 工具创建一个基于 videofilter base class 的透传功能videofilter gstreamer插件(上一篇文章 使用 gst-plugins-bad 里面的 gst-element-maker 工具创建gstreamer 插件 只是创建了一个最基础的videofilter 插件,但是它不支持透传功能,即进入该插件 sink pad 的数据不能从该插件的 src pad 发送出去)
软硬件环境:
ubuntu18.04
meson 0.55.0
gstreamer 1.14.5
ninja 1.8.2
python 3.6.9
一、使用gst-element-maker 创建一个videofilter 插件
1. 使用 gst-element-maker 基于videofilter 基类模板创建一个 g2dfilter 插件
如下图所示,使用 gst-element-maker g2dfilter videofilter 命令生成 g2dfilter 插件相关的代码
cd gst-plugins-bad/tools
./gst-element-maker g2dfilter videofilter
2. 修改 g2dfilter 插件源码,支持透传功能
如下图所示,在 gstg2dfilter.c 文件中的 **gst_g2dfilter_start() **函数中添加一句 gst_base_transform_set_passthrough(trans, TRUE) 函数调用,就实现了透传功能, 至于gst_base_transform_set_passthrough() 函数的相关说明,请参考 gstreamer官网 GstBaseTransform 基类的相关资料
修改后的完整的gstg2dfilter.c 代码(包括添加的一些打印信息)如下:
/* GStreamer* Copyright (C) 2023 FIXME <fixme@example.com>** This library is free software; you can redistribute it and/or* modify it under the terms of the GNU Library General Public* License as published by the Free Software Foundation; either* version 2 of the License, or (at your option) any later version.** This library is distributed in the hope that it will be useful,* but WITHOUT ANY WARRANTY; without even the implied warranty of* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU* Library General Public License for more details.** You should have received a copy of the GNU Library General Public* License along with this library; if not, write to the* Free Software Foundation, Inc., 51 Franklin Street, Suite 500,* Boston, MA 02110-1335, USA.*/
/*** SECTION:element-gstg2dfilter** The g2dfilter element does FIXME stuff.** <refsect2>* <title>Example launch line</title>* |[* gst-launch-1.0 -v fakesrc ! g2dfilter ! FIXME ! fakesink* ]|* FIXME Describe what the pipeline does.* </refsect2>*/#ifdef HAVE_CONFIG_H
#include "config.h"
#endif#include <stdint.h>
#include <gst/gst.h>
#include <gst/video/video.h>
#include <gst/video/gstvideofilter.h>
#include "gstg2dfilter.h"GST_DEBUG_CATEGORY_STATIC (gst_g2dfilter_debug_category);
#define GST_CAT_DEFAULT gst_g2dfilter_debug_category/* prototypes */static void gst_g2dfilter_set_property (GObject * object,guint property_id, const GValue * value, GParamSpec * pspec);
static void gst_g2dfilter_get_property (GObject * object,guint property_id, GValue * value, GParamSpec * pspec);
static void gst_g2dfilter_dispose (GObject * object);
static void gst_g2dfilter_finalize (GObject * object);static gboolean gst_g2dfilter_start (GstBaseTransform
99%的人还看了
相似问题
- IDEA中安装Docker插件实现远程访问Docker
- vscode使用插件KoroFileHeader添加注释
- Java实现的插件化策略模式
- WordPress画廊插件Envira Gallery v1.9.7河蟹版下载
- 【IDEA 使用easyAPI、easyYapi、Apifox helper等插件时,导出接口文档缺少代码字段注释的相关内容、校验规则的解决方法】
- Figma 插件学习(一)
- Portraiture2024PS/LR专用智能磨皮插件,AI算法美颜,提高P图效率
- 033-从零搭建微服务-日志插件(一)
- install YAPI MongoDB 备份mongo 安装yapi插件cross-request 笔记
- 验证码案例 —— Kaptcha 插件介绍 后端生成验证码,前端展示并进行session验证(带完整前后端源码)
猜你感兴趣
版权申明
本文"使用 gst-element-maker 创建一个完全透传的 videofilter 插件":http://eshow365.cn/6-15481-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!