123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- #pragma once
- #include <iostream>
- #include <stdio.h>
- #include <string.h>
- #include <gst/gst.h>
- #include <glib.h>
- #include <stdio.h>
- #include <math.h>
- #include <string.h>
- #include <sys/time.h>
- #include "gstnvdsmeta.h"
- #include "gst-nvmessage.h"
- #include "user_app.h"
- #include <list>
- using namespace std;
- namespace VIA{
- // 基于Deepstream
- class Inference
- {
- private:
- // Deepstream
- GMainLoop *loop = NULL;
- GstElement *pipeline = NULL,*streammux = NULL, *sink = NULL, *pgie = NULL,
- *queue1, *queue2, *queue3, *queue4, *queue5, *nvvidconv = NULL,
- *nvosd = NULL, *tiler = NULL;
- GstElement *transform = NULL;
- GstBus *bus = NULL;
- guint bus_watch_id;
- GstPad *tiler_src_pad = NULL;
- guint tiler_rows, tiler_columns;
- guint pgie_batch_size;
- public:
- static std::shared_ptr<Inference> CreateNew();
- Inference();
- ~Inference();
- public:
- int32_t Init();
- void Destory();
- void StartTask();
- private:
- // static
- static GstPadProbeReturn tiler_src_pad_buffer_probe(GstPad * pad, GstPadProbeInfo * info, gpointer u_data);
- static gboolean bus_call (GstBus * bus, GstMessage * msg, gpointer data);
- static void cb_newpad (GstElement * decodebin, GstPad * decoder_src_pad, gpointer data);
- static void decodebin_child_added (GstChildProxy * child_proxy, GObject * object,
- gchar * name, gpointer user_data);
- static GstElement* create_source_bin(guint index, gchar * uri);
- };
- }
|