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也可能需要修改。

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