1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677 |
- #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 "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 <list>
- 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<Inference> CreateNew();
- Inference();
- ~Inference();
- public:
- int32_t Init(std::list<DataSource> 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);
- };
- }
|