| 1 |
/* |
| 2 |
* GStreamer gstreamer-ssdtensordec |
| 3 |
* Copyright (C) 2021,2025 Collabora Ltd |
| 4 |
* |
| 5 |
* gstssdtensordec.h |
| 6 |
* |
| 7 |
* This library is free software; you can redistribute it and/or |
| 8 |
* modify it under the terms of the GNU Library General Public |
| 9 |
* License as published by the Free Software Foundation; either |
| 10 |
* version 2 of the License, or (at your option) any later version. |
| 11 |
* |
| 12 |
* This library is distributed in the hope that it will be useful, |
| 13 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 15 |
* Library General Public License for more details. |
| 16 |
* |
| 17 |
* You should have received a copy of the GNU Library General Public |
| 18 |
* License along with this library; if not, write to the |
| 19 |
* Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, |
| 20 |
* Boston, MA 02110-1301, USA. |
| 21 |
*/ |
| 22 |
|
| 23 |
#ifndef __GST_SSD_TENSOR_DEC_H__ |
| 24 |
#define __GST_SSD_TENSOR_DEC_H__ |
| 25 |
|
| 26 |
#include <gst/gst.h> |
| 27 |
#include <gst/video/video.h> |
| 28 |
#include <gst/video/gstvideofilter.h> |
| 29 |
|
| 30 |
G_BEGIN_DECLS |
| 31 |
|
| 32 |
GType gst_ssd_tensor_dec_get_type (void); |
| 33 |
|
| 34 |
#define GST_TYPE_SSD_TENSOR_DEC (gst_ssd_tensor_dec_get_type()) |
| 35 |
#define GST_SSD_TENSOR_DEC(obj) \ |
| 36 |
(G_TYPE_CHECK_INSTANCE_CAST ((obj), GST_TYPE_SSD_TENSOR_DEC, GstSsdTensorDec)) |
| 37 |
#define GST_SSD_TENSOR_DEC_CLASS(klass) \ |
| 38 |
(G_TYPE_CHECK_CLASS_CAST ((klass), GST_TYPE_SSD_TENSOR_DEC, GstSsdTensorDecClass)) |
| 39 |
#define GST_IS_SSD_TENSOR_DEC(obj) \ |
| 40 |
(G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_SSD_TENSOR_DEC)) |
| 41 |
#define GST_IS_SSD_TENSOR_DEC_CLASS(klass) \ |
| 42 |
(G_TYPE_CHECK_CLASS_TYPE ((klass), GST_TYPE_SSD_TENSOR_DEC)) |
| 43 |
#define GST_SSD_TENSOR_DEC_GET_CLASS(obj) \ |
| 44 |
(G_TYPE_INSTANCE_GET_CLASS ((obj), GST_TYPE_SSD_TENSOR_DEC, GstSsdTensorDecClass)) |
| 45 |
|
| 46 |
typedef struct _GstSsdTensorDec GstSsdTensorDec; |
| 47 |
typedef struct _GstSsdTensorDecClass GstSsdTensorDecClass; |
| 48 |
|
| 49 |
|
| 50 |
#define GST_SSD_TENSOR_DEC_META_NAME "ssd-tensor-dec" |
| 51 |
#define GST_SSD_TENSOR_DEC_META_PARAM_NAME "extra-data" |
| 52 |
#define GST_SSD_TENSOR_DEC_META_FIELD_LABEL "label" |
| 53 |
#define GST_SSD_TENSOR_DEC_META_FIELD_SCORE "score" |
| 54 |
|
| 55 |
/** |
| 56 |
* GstSsdTensorDec: |
| 57 |
* |
| 58 |
* @label_file label file |
| 59 |
* @score_threshold score threshold |
| 60 |
* |
| 61 |
* Since: 1.20 |
| 62 |
*/ |
| 63 |
struct _GstSsdTensorDec |
| 64 |
{ |
| 65 |
GstBaseTransform basetransform; |
| 66 |
gchar *label_file; |
| 67 |
GArray *labels; |
| 68 |
gfloat score_threshold; |
| 69 |
gfloat size_threshold; |
| 70 |
GstVideoInfo video_info; |
| 71 |
}; |
| 72 |
|
| 73 |
/** |
| 74 |
* GstSsdTensorDecClass: |
| 75 |
* |
| 76 |
* @parent_class base transform base class |
| 77 |
* |
| 78 |
* Since: 1.20 |
| 79 |
*/ |
| 80 |
struct _GstSsdTensorDecClass |
| 81 |
{ |
| 82 |
GstBaseTransformClass parent_class; |
| 83 |
}; |
| 84 |
|
| 85 |
GST_ELEMENT_REGISTER_DECLARE (ssd_tensor_dec) |
| 86 |
|
| 87 |
G_DEFINE_AUTOPTR_CLEANUP_FUNC (GstSsdTensorDec, g_object_unref) |
| 88 |
|
| 89 |
#define GST_TYPE_SSD_OBJECT_DETECTOR (gst_ssd_object_detector_get_type()) |
| 90 |
G_DECLARE_FINAL_TYPE (GstSsdObjectDetector, gst_ssd_object_detector, GST, SSD_OBJECT_DETECTOR, GstSsdTensorDec) |
| 91 |
|
| 92 |
/** |
| 93 |
* GstSsdObjectDetector: |
| 94 |
* |
| 95 |
* Since: 1.20 |
| 96 |
* Deprecated: 1.28 : Use GstSsdTensorDec instead. |
| 97 |
*/ |
| 98 |
struct _GstSsdObjectDetector |
| 99 |
{ |
| 100 |
GstSsdTensorDec parent; |
| 101 |
}; |
| 102 |
|
| 103 |
/** |
| 104 |
* GstSsdObjectDetectorClass: |
| 105 |
* |
| 106 |
* @parent_class base transform base class |
| 107 |
* |
| 108 |
* Since: 1.20 |
| 109 |
* Deprecated: 1.28 : Use GstSsdTensorDecClass instead. |
| 110 |
*/ |
| 111 |
struct _GstSsdObjectDetectorClass |
| 112 |
{ |
| 113 |
GstSsdTensorDecClass parent_class; |
| 114 |
}; |
| 115 |
|
| 116 |
GST_ELEMENT_REGISTER_DECLARE (ssd_object_detector) |
| 117 |
|
| 118 |
G_END_DECLS |
| 119 |
|
| 120 |
#endif /* __GST_SSD_TENSOR_DEC_H__ */ |