Doxygen Book
gstdatareposrc.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-only */
13 #ifndef __GST_DATA_REPO_SRC_H__
14 #define __GST_DATA_REPO_SRC_H__
15 
16 #include <sys/types.h>
17 #include <gst/gst.h>
18 #include <gst/base/gstpushsrc.h>
19 #include <json-glib/json-glib.h>
20 #include <tensor_typedef.h>
21 #include "gstdatarepo.h"
22 
23 G_BEGIN_DECLS
24 #define GST_TYPE_DATA_REPO_SRC \
25  (gst_data_repo_src_get_type())
26 #define GST_DATA_REPO_SRC(obj) \
27  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_DATA_REPO_SRC,GstDataRepoSrc))
28 #define GST_DATA_REPO_SRC_CLASS(klass) \
29  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_DATA_REPO_SRC,GstDataRepoSrcClass))
30 #define GST_IS_DATA_REPO_SRC(obj) \
31  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_DATA_REPO_SRC))
32 #define GST_IS_DATA_REPO_SRC_CLASS(klass) \
33  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_DATA_REPO_SRC))
34 
37 
42 
43  GstPushSrc parent;
44  GstPad *src_pad;
45 
46  gboolean is_start;
47  gboolean successful_read;
48  gint fd;
49  gint file_size;
50  guint64 read_position;
51  guint64 fd_offset;
52  guint64 start_offset;
53  guint64 last_offset;
58  guint total_samples;
59  guint num_samples;
60  gsize sample_size;
63  /* property */
64  gchar *filename;
65  gchar *json_filename;
66  gchar *tensors_seq_str;
69  guint epochs;
70  gboolean is_shuffle;
73  guint array_index;
77  gboolean need_changed_caps;
78  GstCaps *caps;
80  /* flexible tensors */
82  JsonArray *sample_offset_array;
83  JsonArray *tensor_size_array;
84  JsonArray *tensor_count_array;
85  JsonParser *parser;
89 
90  GstClockTime running_time;
91  gint rate_n, rate_d;
92  guint64 n_frame;
93 };
94 
99  GstPushSrcClass parent_class;
100 };
101 
102 GType gst_data_repo_src_get_type (void);
103 
104 G_END_DECLS
105 #endif /* __GST_DATA_REPO_SRC_H__ */
_GstDataRepoSrc::epochs
guint epochs
Definition: gstdatareposrc.h:69
_GstDataRepoSrc::parent
GstPushSrc parent
Definition: gstdatareposrc.h:43
_GstDataRepoSrc::shuffled_index_array
GArray * shuffled_index_array
Definition: gstdatareposrc.h:72
_GstDataRepoSrc::src_pad
GstPad * src_pad
Definition: gstdatareposrc.h:44
_GstDataRepoSrc::start_offset
guint64 start_offset
Definition: gstdatareposrc.h:52
_GstDataRepoSrc::tensor_size_array
JsonArray * tensor_size_array
Definition: gstdatareposrc.h:83
_GstDataRepoSrc::is_shuffle
gboolean is_shuffle
Definition: gstdatareposrc.h:70
NNS_TENSOR_SIZE_LIMIT
#define NNS_TENSOR_SIZE_LIMIT
The number of tensors NNStreamer supports is 256. The max memories of gst-buffer is 16 (See NNS_TENSO...
Definition: tensor_typedef.h:42
_GstDataRepoSrc::tensors_seq_cnt
guint tensors_seq_cnt
Definition: gstdatareposrc.h:76
_GstDataRepoSrc::current_sample_index
gint current_sample_index
Definition: gstdatareposrc.h:56
_GstDataRepoSrc::parser
JsonParser * parser
Definition: gstdatareposrc.h:85
_GstDataRepoSrcClass
GstDataRepoSrcClass data structure.
Definition: gstdatareposrc.h:98
_GstDataRepoSrc::is_start
gboolean is_start
Definition: gstdatareposrc.h:46
_GstDataRepoSrc::read_position
guint64 read_position
Definition: gstdatareposrc.h:50
_GstDataRepoSrc::tensor_count_array
JsonArray * tensor_count_array
Definition: gstdatareposrc.h:84
_GstDataRepoSrc::caps
GstCaps * caps
Definition: gstdatareposrc.h:78
_GstDataRepoSrc::tensor_size_array_len
guint tensor_size_array_len
Definition: gstdatareposrc.h:87
_GstDataRepoSrc::num_samples
guint num_samples
Definition: gstdatareposrc.h:59
_GstDataRepoSrc::rate_d
gint rate_d
Definition: gstdatareposrc.h:91
_GstDataRepoSrc::sample_size
gsize sample_size
Definition: gstdatareposrc.h:60
GstDataRepoDataType
GstDataRepoDataType
Data type of incoming buffer.
Definition: gstdatarepo.h:23
_GstDataRepoSrc::successful_read
gboolean successful_read
Definition: gstdatareposrc.h:47
gstdatarepo.h
GStreamer plugin to read file in MLOps Data repository into buffers.
_GstDataRepoSrc::last_offset
guint64 last_offset
Definition: gstdatareposrc.h:53
_GstDataRepoSrc::data_type
GstDataRepoDataType data_type
Definition: gstdatareposrc.h:61
GstTensorsConfig
Internal data structure for configured tensors info (for other/tensors).
Definition: tensor_typedef.h:284
_GstDataRepoSrc::array_index
guint array_index
Definition: gstdatareposrc.h:73
_GstDataRepoSrc::json_filename
gchar * json_filename
Definition: gstdatareposrc.h:65
_GstDataRepoSrc::tensors_size
gsize tensors_size[NNS_TENSOR_SIZE_LIMIT]
Definition: gstdatareposrc.h:54
tensor_typedef.h
Common header file for NNStreamer, the GStreamer plugin for neural networks.
_GstDataRepoSrc::tensors_seq
guint tensors_seq[NNS_TENSOR_SIZE_LIMIT]
Definition: gstdatareposrc.h:75
_GstDataRepoSrcClass::parent_class
GstPushSrcClass parent_class
Definition: gstdatareposrc.h:99
_GstDataRepoSrc::need_changed_caps
gboolean need_changed_caps
Definition: gstdatareposrc.h:77
_GstDataRepoSrc::fd
gint fd
Definition: gstdatareposrc.h:48
_GstDataRepoSrc::file_size
gint file_size
Definition: gstdatareposrc.h:49
_GstDataRepoSrc::fd_offset
guint64 fd_offset
Definition: gstdatareposrc.h:51
_GstDataRepoSrc::tensors_seq_str
gchar * tensors_seq_str
Definition: gstdatareposrc.h:66
_GstDataRepoSrc::first_epoch_is_done
gboolean first_epoch_is_done
Definition: gstdatareposrc.h:57
_GstDataRepoSrc::rate_n
gint rate_n
Definition: gstdatareposrc.h:91
_GstDataRepoSrc::config
GstTensorsConfig config
Definition: gstdatareposrc.h:81
gst_data_repo_src_get_type
GType gst_data_repo_src_get_type(void)
_GstDataRepoSrc::sample_offset_array
JsonArray * sample_offset_array
Definition: gstdatareposrc.h:82
_GstDataRepoSrc::total_samples
guint total_samples
Definition: gstdatareposrc.h:58
_GstDataRepoSrc::start_sample_index
guint start_sample_index
Definition: gstdatareposrc.h:67
_GstDataRepoSrc::filename
gchar * filename
Definition: gstdatareposrc.h:64
_GstDataRepoSrc::tensor_count_array_len
guint tensor_count_array_len
Definition: gstdatareposrc.h:88
_GstDataRepoSrc::sample_offset_array_len
guint sample_offset_array_len
Definition: gstdatareposrc.h:86
_GstDataRepoSrc::running_time
GstClockTime running_time
Definition: gstdatareposrc.h:90
_GstDataRepoSrc
GstDataRepoSrc data structure.
Definition: gstdatareposrc.h:41
_GstDataRepoSrc::n_frame
guint64 n_frame
Definition: gstdatareposrc.h:92
_GstDataRepoSrc::tensors_offset
gsize tensors_offset[NNS_TENSOR_SIZE_LIMIT]
Definition: gstdatareposrc.h:55
_GstDataRepoSrc::stop_sample_index
guint stop_sample_index
Definition: gstdatareposrc.h:68