#pragma once #include #include #include #include #include #include #include #include #include #include "gstnvdsmeta.h" #include "gst-nvmessage.h" #include "DataSource.h" // ZLMediaKit #include "Util/logger.h" #include "Util/NoticeCenter.h" #include "Poller/EventPoller.h" #include "Player/PlayerProxy.h" #include "Rtmp/RtmpPusher.h" #include "Common/config.h" #include "Pusher/MediaPusher.h" #include "Extension/Frame.h" #include "Util/SqlPool.h" #include "Network/TcpClient.h" #include "Poller/Timer.h" #include "TCPClient.h" #include using namespace std; namespace MIVA{ // 基于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(std::list DataList); void Destory(); void StartTask(); void PauseTask(); 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); }; }