gst-example

dsexample就是推理过后,附加和更新流经这里的元数据。

NPP是啥?GST打头的方法都要查查啥意思
gstdsexample也是make make install 生成libnvdsgst_dsexample.so
1、枚举 带PROP_PROCESS
2、宏定义 CHECK_NVDS_MEMORY_AND_GPUID
3、给属性默认值 DEFAULT 
4、宏定义 CHECK_NPP_STATUS()  CHECK_CUDA_STATUS()
5、在pipeline上flow through的memory是我们处理的对象
6、gst_dsexample_sink_template接收pad  gst_dsexample_src_template生成pad
7、gst_dsexample_set_property()  gst_dsexample_get_property()
gst_dsexample_set_caps()---元和接收pad cap商定好的时候调用
在这里保存input video information.在video_info里

gst_dsexample_start()--Initialize all resources and start the output thread
gst_dsexample_stop()
gst_dsexample_transform_ip
attach_metadata_full_frame
attach_metadata_object
8、gst_dsexample_class_init 安装属性,设置输入生成pad cap,用上面的方法重写父类方法
	1)g_object_class_install_property 数个这个方法
	2)设置pad capabilities---pad支持的数据类型,支持才能通过,到达element
	3)设置描述element的元数据
9、gst_dsexample_init
不生成新的buffer,just adding / updating metadata
/* Initialize all property variables to default values */
10、get_converted_mat 把缓存推到库里
11、gst_dsexample_transform_ip 找到推理完的元数据,拿到手

自定义方法
	1)Getcurtime() 得到现在的时间

下面是官方解释:

官网解释
1、修改gst-example来自定义
2、它处理整个frame,缩小和颜色转换
处理由主检测器检测到的对象,裁剪出,处理这些对象


This release版本 includes a simple static library dsexample_lib that demonstrates演示 the interface between custom libraries and this Gstreamer plugin. The library generates simple labels of the form “Obj_label”. The library implements实现 these functions:
•DsExampleCtxInit—Initalizes the custom library
•DsExampleCtxDeinit—De-initalizes the custom library取消初始化自定义库
•DsExampleProcess – Process on an input frame


这个GStreamer插件是就地转换插件,只添加/更新现有的元数据。其他相关职能:
GstBaseTransfrom Class Functions:

•start—Acquires获取 resources, allocate memory分配内存, initialize初始化 example library.
•stop—De-initializes the example library and frees up resources and memory.
•set_caps—Gets the capabilities能力 of the video (i.e. resolution, color format, framerate) that flow through this element. Allocations分配 / initializations初始化 that depend on input video format can be done here.
•transform_ip—Finds the metadata of the primary detector.Call this function when the upstream element pushes a buffer.
•Use get_converted_mat to get the required buffer for pushing to library. Push the data to the example library. Pop the example library output.
•Attach附加 / update metadata using attach_metadata_full_frame or attach_metadata_object.

Other supporting functions

•get_converted_mat—Scales, converts, or crops the input buffer, either the full frame or the object based on its co-ordinates in primary detector metadata.
•attach_metadata_full_frame—Shows how the plugin can attach its own metadata for objects detected by the plugin.
•attach_metadata_object—Shows how the plugin can update labels for objects detected by primary detector.

Enabling启用 and configuring配置 the sample示例 plugin
The pre-compiled预编译 deepstream-app binary二进制文件 already has the functionality功能 to parse分析 the configuration配置 and add the sample element to the pipeline.

To enable启动 and configure配置 the plugin, add the following section部分 to an existing configuration file (for example, source4_720p_dec_infer-resnet_tracker_sgie_tiled_display_int8.txt):

[ds-example]
enable=1
processing-width=640
processing-height=480
full-frame=0
unique-id=15

Using the sample plugin in a custom application/pipeline
The sample plugin can be used in a gst-launch启动 pipeline. The pipeline can also be constructed建造 in a custom自定义 application.
不理解

Implementing实现 Custom Logic自定义逻辑 Within在…里 the Sample Plugin
要在插件中实现自定义逻辑,请将下面的函数调用列表替换为任何其他自定义库的相应函数。

DsExampleCtxInit
DsExampleCtxDeinit
DsExampleProcess

根据库的输入要求,get_converted_mat也可能需要修改。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章