#ifndef __GST_CUSTOMTILER_H__ #define __GST_CUSTOMTILER_H__ #include "opencv2/imgproc/imgproc.hpp" #include "opencv2/highgui/highgui.hpp" #include "opencv2/core/cuda.hpp" #include "opencv2/cudawarping.hpp" #include #include /* Open CV headers */ #include #include #include "nvbufsurface.h" #include "nvbufsurftransform.h" #include "nvdsmeta.h" #include "gst-nvquery.h" #include "gstnvdsmeta.h" #include #include #include /* Package and library details required for plugin_init */ #define PACKAGE "customtiler" #define VERSION "1.0.1" #define LICENSE "Proprietary" #define DESCRIPTION "IView Custom Timer" #define BINARY_PACKAGE "Custom Tile Plugin" #define URL "http://kigis.com/" G_BEGIN_DECLS /* Standard boilerplate stuff */ typedef struct _GstCustomTiler GstCustomTiler; typedef struct _GstCustomTilerClass GstCustomTilerClass; typedef struct _ResizeMatGroup ResizeMatGroup; /* Standard boilerplate stuff */ #define GST_TYPE_CUSTOMTILER (gst_customtiler_get_type()) #define GST_CUSTOMTILER(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_CUSTOMTILER,GstCustomTiler)) #define GST_CUSTOMTILER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_CUSTOMTILER, GstCustomTilerClass)) #define GST_CUSTOMTILER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GST_TYPE_CUSTOMTILER, GstCustomTilerClass)) #define GST_IS_CUSTOMTILER(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_CUSTOMTILER)) #define GST_IS_CUSTOMTILER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_CUSTOMTILER)) #define GST_CUSTOMTILER_CAST(obj) ((GstCustomTiler *)(obj)) #define MAX_SWAP_SIZE 10 struct _GstCustomTiler { GstBaseTransform base_trans; // Add Language gint currentLanguage; // Add Passowrd Flag gint passwordFlag; // updated at index `unique_id` of attr_info array in NvDsObjectParams. guint unique_id; guint frame_num; // CUDA Stream used for allocating the CUDA task cudaStream_t cuda_stream; void *host_rgb_buf; // the intermediate scratch buffer for conversions RGBA NvBufSurface *tilesurface[MAX_SWAP_SIZE]; guint swap; NvDsBatchMeta *batch_meta; NvDsFrameMeta *frame_meta; NvDsMeta *meta; //NvDsMeta *meta; // OpenCV mat containing RGB data cv::Mat *cvmat; // Input video info (resolution, color format, framerate, etc) GstVideoInfo video_info; // GPU ID on which we expect to execute the task guint gpu_id; // Resolution at which frames/objects should be processed gint processing_width; gint processing_height; // Auto Scale Mode gboolean auto_scale; // Amount of objects processed in single call to algorithm guint in_batch_size; guint batch_size; GstBuffer *outBuff; // Boolean indicating if entire frame or cropped objects should be processed gboolean process_full_frame; GThread *processMatThread[4]; }; //for resizeMat thread struct _ResizeMatGroup { gboolean isEmpty = TRUE; cv::Mat *src; cv::Mat *dst; cv::Rect rect; }; // Boiler plate stuff struct _GstCustomTilerClass { GstBaseTransformClass parent_class; }; GType gst_customtiler_get_type (void); G_END_DECLS #endif /* __GST_CUSTOMTILER_H__ */