Deep stream 源码注释,各个元件属性和函数功能的注解

本文介绍如何使用DeepStream SDK搭建一个完整的视频分析管道,包括多个视频源的接入、视频流批处理、目标检测与识别等关键步骤。

对deep stream各个元件属性和函数功能的注解

 

int
main (int argc, char *argv[])
{
  GMainLoop *loop = NULL;
  //它是组成管道的基本构件,也是框架中所有可用组件的基础
  //可以描述为一个具有特定属性的黑盒子,它通过连接点(link point)与外界进行交互,向框架中的其余部分表征自己的特性或者功能.

  GstElement *pipeline = NULL, *streammux = NULL, *sink = NULL, *pgie = NULL,
      *queue1, *queue2, *queue3, *queue4, *queue5, *nvvidconv = NULL,
      *nvosd = NULL, *tiler = NULL;
#ifdef PLATFORM_TEGRA
  GstElement *transform = NULL;
#endif
  GstBus *bus = NULL;
  guint bus_watch_id;
  GstPad *tiler_src_pad = NULL;
  guint i, num_sources;
  guint tiler_rows, tiler_columns;
  guint pgie_batch_size;

  /* Check input arguments */
  if (argc < 2) {
    g_printerr ("Usage: %s <uri1> [uri2] ... [uriN] \n", argv[0]);
    return -1;
  }
  num_sources = argc - 1;

  /* Standard GStreamer initialization */
  gst_init (&argc, &argv);
  loop = g_main_loop_new (NULL, FALSE); //创建一个main loop对象,一个main loop对象只能被一个线程使用,但一个线程可以有多个main loop对象

  /* Create gstreamer elements */
  /* Create Pipeline element that will form a connection of other elements */
  pipeline = gst_pipeline_new ("dstest3-pipeline"); //Pipeline通过gst_pipeline_new创建

  /* Create nvstreammux instance to form batches from one or more sources. */
  //gst_element_factory_make(): 这个函数使用一个已存在的工厂对象和一个新的元件名来创建元件
  //"nvstreammux": 可从多个输入源组成一批缓冲区

  streammux = gst_element_factory_make ("nvstreammux", "stream-muxer");

  if (!pipeline || !streammux) {
    g_printerr ("One element could not be created. Exiting.\n");
    return -1;
  }
  //gst_bin_add(): 在pipeline中加入element。这个方法会接受一个element作为输入参数,最后由NULL来终止
  //gst_bin_add_many(): 这个方法会接受一系列的element作为输入参数
  //将streammux元件加入到pipeline

  gst_bin_add (GST_BIN (pipeline), streammux);

  for (i = 0; i < num_sources; i++) {
    GstPad *

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值