#pragma once #include #include #include #include #include #include #include #include #include #include "gstnvdsmeta.h" #include "gst-nvmessage.h" #include "user_app.h" #include 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 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); }; }