gstreamer
文章平均质量分 56
gstreamer
ykun089
这个作者很懒,什么都没留下…
展开
-
[Gstreamer] 所有类的根 --- GstElement
GstElement 是 Gstreamer 的最基础类,几乎所有的 Gstreamer 类都继承于此,它包装了GObject 同时提供了通用能力。原创 2023-11-10 17:45:18 · 83 阅读 · 0 评论 -
[Gstreamer] 最常用的Sink 基类 --- GstBaseSink
GstBaseSink 继承自 GstElement , 提供了 preroll,时钟同步,state change 处理,query 和 pad 模式激活流程 等功能,子类只需要再理解GstBaseSink属性使用的基础上实现一些虚函数(共18个)。原创 2023-11-03 16:41:20 · 188 阅读 · 0 评论 -
[GStreamer] 定义并使用多参数信号
***/定义一个信号,叫做cache-info,这个信号传递两个参数,都是 G_TYPE_UINT64 类型。这里的信号处理函数是4个参数,第一个是信号所属的element的实例,最后一个是g_signal_connect时指定传递给信号处理函数的额外入参,中间的参数就是信号的参数,参数个数在定义信号时有指定。原创 2023-10-19 14:26:46 · 105 阅读 · 0 评论 -
[Gstreamer] 环境变量
【代码】[Gstreamer] 环境变量。原创 2023-10-08 10:33:37 · 122 阅读 · 0 评论 -
[Gstreamer] Linux 下安装
【代码】[Gstreamer] Linux 下安装。原创 2023-07-05 15:39:36 · 328 阅读 · 0 评论 -
[GStreamer] GObject 和 QObject 相通的地方
GObject 和 QObject 都使用到了 metadata ,所谓的 metadata 就是一个类的 “元属性” ,直白点说就是 “描述这个类的相关属性”,这些属性是本类的固有特性,不因为类实例的不同的改变,从编程的角度来看,类似于 “类的static属性”,不同的地方在于,metadata基本上都是固定不变的一些值,而 static属性大多是可以变化的。GObject是如何实现的?描述一个 GObject类 需要两个 struct ,一个叫 类结构体,一个叫 对象结构体,类结构体内存放原创 2021-11-23 14:42:28 · 247 阅读 · 0 评论 -
[GStreamer] 使用 gst-build 编译 GStreamer 和 plugins
Files · 1.18 · GStreamer / gst-build · GitLabhttps://gitlab.freedesktop.org/gstreamer/gst-build/-/tree/1.18meson --debug --prefix=/ __BUILD_DEBUGninja -C __BUILD_DEBUGmeson install -C __BUILD_DEBUG原创 2022-01-12 17:36:52 · 668 阅读 · 0 评论 -
[GStreamer] design of gstreamer
Overview原创 2022-11-17 13:53:50 · 84 阅读 · 0 评论 -
[GStreamer] Ghost pads
You can see fromVisualisation of a GstBin element without ghost padshow a bin has no pads of its own. This is where "ghost pads" come into play.A ghost pad is a pad from some element in the bin that can be accessed directly from the bin as well. Comp..原创 2021-11-23 15:58:26 · 294 阅读 · 0 评论 -
[GStreamer] Bin
The bin will also manage the elements contained in it. It will perform state changes on the elements as well as collect and forward bus messages.A pipeline: a generic container that manages the synchronization and bus messages of the contained elemen...原创 2021-11-23 14:00:45 · 114 阅读 · 0 评论 -
[GStreamer] 版本更新历史
GStreamer: newshttps://gstreamer.freedesktop.org/news/原创 2022-03-06 17:36:37 · 744 阅读 · 0 评论 -
[GStreamer] State of Element
GST_STATE_NULL: this is the default state. No resources are allocated in this state, so, transitioning to it will free all resources. The element must be in this state when its refcount reaches 0 and it is freed. GST_STATE_READY: in the ready state,..原创 2021-11-23 13:44:55 · 185 阅读 · 0 评论 -
[GStreamer] 插件编写 —— filter element
源码:ObtFilter.h#pragma once#include <gst/gst.h>#define VERSION "1.0"#define PACKAGE "obtplugin" //mandatary for gst_plugin_descG_BEGIN_DECLS/* property id list*/enum{ PROP_0, PROP_SILENT, PROP_CNT};/* instance struct*/typede原创 2021-12-24 17:26:46 · 824 阅读 · 0 评论 -
[GStreamer] pipeline中动态替换element
Pipeline manipulationhttps://gstreamer.freedesktop.org/documentation/application-development/advanced/pipeline-manipulation.html?gi-language=c#原创 2021-12-30 18:38:48 · 452 阅读 · 0 评论 -
[GStreamer] GstStructure的用法
GstStructure 是一个键值对结构,每一个GstStructure 都只有一个 key 和一个 value , key 是 GQuark 类型,value 是 GType 类型。/****/};原创 2022-12-14 11:38:53 · 147 阅读 · 0 评论 -
[GStreamer] 插件编写 —— Test程序
源码:main.c#include <gst/gst.h>#include <gst/gstelement.h>#include <gst/gstbin.h>int main(int argc,char** argv){ gst_init(&argc,&argv); GMainLoop *loop; loop = g_main_loop_new (NULL, FALSE); GstElement* pipeline = g原创 2021-12-24 17:31:35 · 1690 阅读 · 0 评论 -
[GStreamer] 时钟 和 数据同步
GStreamer提供如下同步服务:非直播的音/视频播放,这种情况下,数据录入速度显著快于播放消耗的速度,这种情况下GStreamer会协调好音频、视频、字幕的同步情况。 录像录音场景下,GStreamer会协调视频录制和音频录制的同步。 流媒体场景下数据源的录入速度慢于播放速度,GStreamer会提供buffering服务。 直播场景下,GStreamer提供一个可配置的延迟服务,这样可以保证直播的流畅,比如采集直播视频流并添加一些后期效果,再推送给播放端。 音视频后期同步,比如实现录制好了原创 2021-11-23 16:31:01 · 1761 阅读 · 0 评论 -
[GStreamer] undefined symbol: gst_push_src_get_type
编写source element的时候发现提示 “undefined symbol: gst_push_src_get_type” , 表面上看就是符号表找不到,那么一定是相应的库没有链接进来,那么就需要知道 gst push src 在哪个包里,通过查询可知 gst_push_src 在 base plugin 里,因此找到 dev 文件。可见如果需要使用 base plugin ,则需要 -lgstbase-1.0 , 因此在我们的cmake里面添加这一个链接选项即可。...原创 2022-08-05 20:13:39 · 445 阅读 · 0 评论 -
[GStreamer] Element的状态
State Description NULL the NULL state or initial state of an element. READY the element is ready to go to PAUSED. PAUSED the element is PAUSED, it is ready to accept and process ...原创 2021-11-24 11:37:24 · 252 阅读 · 0 评论 -
[GLib] 什么是GType
The GLib Dynamic Type System原创 2022-07-28 14:34:20 · 466 阅读 · 0 评论 -
[GStreamer] GLib 中的 GQuark
GQuark 就是一个 uint32 的整型,每一个整形值的背后都有一个字符串,也就是说每个GQuark 和 唯一 一个 字符串对应,这个对应关系和唯一性保障由GLib来负责。为什么要用GQuark?主要是为了弥补枚举类型的不可扩展,和字符串的比较不便利。因此推出一个 “用整形来一 一映射字符串” 的方案。原创 2022-12-14 11:24:21 · 165 阅读 · 0 评论 -
[GLib][GStreamer] GInterface的创建
GInterface 属于一种 GType 类型,可以使用G_IMPLEMENT_INTERFACE 创建一个 GInterface 类型,类比 G_DEFINE_TYPE。/** * G_IMPLEMENT_INTERFACE: * @TYPE_IFACE: The #GType of the interface to add * @iface_init: (type GInterfaceInitFunc): The interface init function, of type #G.原创 2021-12-21 17:40:03 · 185 阅读 · 0 评论 -
[Glib] GObject 的 dispose 和 finalize 成员函数的各自作用
GObject学习教程---第十一章:GObject 子类对象的析构过程_knowledgebao的博客-CSDN博客索引:https://blog.csdn.net/knowledgebao/article/details/84633798本文是学习学习他人的博客的心得(具体详见“楼主见解”),如果源网站可访问的话,建议直接访问源网站:楼主见解:主要讲解析构为什么需要2个函数来实现。讲解了dispose和finalize的使用场景。析构函数末尾必须调用基类的对应析构函数。James Henstr...ht原创 2021-11-26 15:45:38 · 468 阅读 · 0 评论 -
[GStreamer] 关于segment
gstreamer中的segment是什么?_泰勒朗斯的博客-CSDN博客原创 2022-12-07 15:45:43 · 122 阅读 · 0 评论 -
[GStreamer] Bus && Message
Bus 里的 message 有两种被消费的方法:同步轮训返回,异步回调返回。同步轮训返回:使用gst_bus_timed_pop_filtered 设置超时阻塞读取bus里的message,超时或者感兴趣的message被读到时函数返回。异步回调返回:使用gst_bus_add_signal_watch激活message信号上报机制,此函数调用后,每当有message进入bus,都会触发一个对应的glib 信号,如果使用g_signal_connect设置了信号处理函数,那么此..原创 2021-11-23 14:28:31 · 470 阅读 · 0 评论 -
[GStreamer] 内存管理
GstMemory:管理一小块实际的虚拟内存 GstBuffer:一个对象,是element、plugin、application互相信息交互的最小数据单位,内部包含GstMemory、时间信息和一些其他信息。 GstMeta:附加在GstBuffer上,用来提供一些描述内存的额外信息。 GstBufferPool:buffer池,但是只能分配尺寸固定的buffer。GstMemory:/** * GstMemory: * @mini_object: parent structure原创 2021-11-25 16:21:01 · 1823 阅读 · 0 评论 -
[GStreamer] 常用内容积累
GST_OBJECT_NAME(GstObject *) 通过gst对象指针获取gst对象的nameGError *err;gchar *debug_info;gst_message_parse_error(msg,&err,&debug_info);std::cout << "GST_MESSAGE_ERROR received , sender : " << GST_OBJECT_NAME(msg->src) <&...原创 2021-11-18 17:21:27 · 262 阅读 · 0 评论 -
[GStreamer] GStreamer日志控制
The debug logGStreamer and its plugins are full of debug traces, this is, places in the code where a particularly interesting piece of information is printed to the console, along with time stamping, process, category, source code file, function and elem原创 2021-11-22 14:37:19 · 722 阅读 · 0 评论 -
[GStreamer] 使用meson编译GStreamer(gstreamer core)
refs:meson使用:Command-line commandshttps://mesonbuild.com/Commands.html步骤:1)下载源码 && 解压wget https://gitlab.freedesktop.org/gstreamer/gstreamer/-/archive/1.18/gstreamer-1.18.tar.gztar -xvf gstreamer-1.18.tar.gz2)创建构建路径cd gstreamer-原创 2022-01-12 15:34:51 · 1025 阅读 · 0 评论 -
[GStreamer] 插件的名字要和GST_PLUGIN_DEFINE匹配
注意,如果插件的名字时libgst开头的,那么就会从libgst后面的第一个字符开始摘取字符串,然后拼接成gst_plugin_xxx_get_desc函数名称,而这个函数名称的定义是在宏GST_PLUGIN_DEFINE中进行的。另外,如果插件文件时libmyplugin.so,那么GST_PLUGIN_DEFINE的第三个参数就必须是myplugin,因为代码中发现没有libgst开头,而是lib开头,则会从lib后的第一位开始算。...原创 2022-07-28 18:00:19 · 310 阅读 · 0 评论 -
[GStreamer] Element factory metadata for ‘gstmyessrc‘ has no valid long-name field
注意,这里必须转化成 element 类才能使用gst_element_class_set_static_metadata。原创 2022-08-05 20:19:38 · 193 阅读 · 0 评论 -
[GStreamer] 插件编写 —— source element
Reference :https://gstreamer.freedesktop.org/documentation/plugin-development/advanced/negotiation.html#caps-negotiation-use-caseshttps://gstreamer.freedesktop.org/documentation/plugin-development/advanced/negotiation.html#caps-negotiation-use-casesDi.原创 2021-12-24 17:41:37 · 728 阅读 · 0 评论 -
[GStreamer] 使用meson编译GStreamer(gst-plugin-base)
前言:GStreamer由 gstreamer core 和 plugin 组成,前面已经介绍了如何编译 gstreamer core,本文章介绍编译 gst-plugin-base 插件。方法和步骤和之前类似,参考:[GStreamer] 使用meson编译GStreamer(gstreamer core)_ykun089的博客-CSDN博客refs:meson使用:Command-line commandshttps://mesonbuild.com/Commands.html步骤:1)下载源码 &原创 2022-01-12 16:24:16 · 946 阅读 · 0 评论 -
[GStreamer] GstPad
GstPad:函数指针类型 设置函数 关联的模板函数 描述 GstPadActivateFunction gst_pad_set_activatemode_function gst_pad_set_activatemode_function_full xxx_active() 当前pad从Ready转换到Paused状态时,这个函数被调用。如果不为此函数指定新函数,则会使用默认流程,原创 2021-11-30 16:00:14 · 1386 阅读 · 0 评论 -
[GLib][GStreamer] Glib 对象模型中的 instance struct 和 class struct
每一个 GType 都有两个结构体 :instance struct 和 class struct ,二者的生命周期、实例个数 和 司职都有区别。实例个数:class struct 是所有具备相同 GType 的 GObject 所共享的,只有一个实例,而 instance struct 是每一个 GObject 独享的,有很多实例。生命周期:每个 GObject 的销毁都伴随这一个 instance struct 的销毁,当且仅当所有具备相同 GType 的 GObject 都被销毁时,相原创 2021-12-24 11:10:11 · 424 阅读 · 0 评论 -
[GLib][GStreamer] GType的创建
参考:GObject – 2.0https://docs.gtk.org/gobject/?q=G_DEFINE_TYPEG_DEFINE_TYPE 做了什么?以 G_DEFINE_TYPE(GstMyFilter, gst_my_filter, GST_TYPE_ELEMENT); 为例1.声明了如下几个static函数static void gst_my_filter_init (GstMyFilter *self);sta...原创 2021-12-21 16:16:08 · 412 阅读 · 0 评论 -
[GStreamer] 插件编写
Tips:A plugin registry is used to store the details of the plugins in a binary registry file.This way, a program using GStreamer does not have to load all plugins to determine which are needed.Plugins are only loaded when their provided elements are..原创 2021-11-25 09:27:17 · 1143 阅读 · 0 评论 -
[GStreamer] mode of pad
GSreamer 不要求同一个 element中的多个pad处于同样 mode,根据不通组合有如下应用场景:1)所有pad都是push mode,这样的element称为全push 模式的element。如果这个element是source element,这就要求此element必须起一个任务,此任务需要将生产出的buffer推送给自己的source pad,然后有source pad把buffer 送给下级 element, 而下级 element内部的 xxx_chain函数将会负责处理这些.原创 2021-12-08 09:26:46 · 90 阅读 · 0 评论 -
[Linux使用] Linux下定位GStreamer插件及element的方法
使用 rpm -qf 可以根据so文件查找所属的rpm包,当知道GStreamer的plugin文件时,可以用此命令反向查找rpm包。 使用 rpm -ql 可以查看rpm包中包含哪些文件,当知道GStreamer的插件安装包时,可以用次命令查看rpm包中有哪些插件so。 如果知道任意一个so文件名,可先使用 rpm -qf 找到 所属rpm包,再使用rpm -ql 找到所有so文件名。 使用 gst-inspect-1.0 --plugin xxx.so 可罗列所有 element...原创 2021-11-17 11:24:34 · 1226 阅读 · 0 评论 -
[gstreamer] 关于GstBuffer的refcount
2)由于 gst_buffer_new_xxx 系列函数返回的是指针,因此当指针离开作用域时不会导致底层的 GstBuffer 被销毁,仅仅是指针被销毁,所以真正的 GstBuffer 实例不会受影响, 这一点非常重要。3)gst_buffer_ref 会增加一个计数,gst_buffer_unref 会减少一个计数,一般情况下,在一个函数里,ref 和 unref 要对称。4)要注意是否有些函数会隐式改变计数,在使用函数之前要先看下函数注释,如果有隐式的计数操作,那么在离开作用域的时候要记得补偿计数。原创 2022-11-10 16:38:42 · 321 阅读 · 0 评论