Doxygen Book
gsttensor_repo.h
Go to the documentation of this file.
1 
25 #ifndef __GST_TENSOR_REPO_H__
26 #define __GST_TENSOR_REPO_H__
27 
28 #include <glib.h>
29 #include <gst/gst.h>
30 
31 #include "tensor_common.h"
32 
33 G_BEGIN_DECLS
34 
40 typedef struct
41 {
42  GstBuffer *buffer;
43  GstCaps *caps;
44  GCond cond_push;
45  GCond cond_pull;
46  GMutex lock;
47  gboolean eos;
48  gboolean src_changed;
49  guint src_id;
50  gboolean sink_changed;
51  guint sink_id;
52  gboolean pushed;
54 
58 typedef struct
59 {
60  guint num_data;
61  GMutex repo_lock;
62  GCond repo_cond;
63  GHashTable* hash;
64  gboolean initialized;
66 
72 
76 gboolean
77 gst_tensor_repo_add_repodata (guint myid, gboolean is_sink);
78 
82 gboolean
83 gst_tensor_repo_set_buffer (guint nth, GstBuffer * buffer, GstCaps * caps);
84 
88 gboolean
89 gst_tensor_repo_check_eos (guint nth);
90 
94 gboolean
95 gst_tensor_repo_set_eos (guint nth);
96 
100 gboolean
101 gst_tensor_repo_set_changed (guint o_nth, guint nth, gboolean is_sink);
102 
106 GstBuffer *
107 gst_tensor_repo_get_buffer (guint nth, gboolean * eos, guint * newid, GstCaps ** caps);
108 
112 gboolean
113 gst_tensor_repo_check_changed (guint nth, guint * newid, gboolean is_sink);
114 
118 gboolean
120 
124 void
125 gst_tensor_repo_init (void);
126 
130 gboolean
131 gst_tensor_repo_wait (void);
132 
133 G_END_DECLS
134 
135 #endif /* __GST_TENSOR_REPO_H__ */
gst_tensor_repo_set_changed
gboolean gst_tensor_repo_set_changed(guint o_nth, guint nth, gboolean is_sink)
Set the changing status of repo.
Definition: gsttensor_repo.c:91
gst_tensor_repo_get_repodata
GstTensorRepoData * gst_tensor_repo_get_repodata(guint nth)
Getter to get nth GstTensorRepoData.
Definition: gsttensor_repo.c:74
gst_tensor_repo_set_buffer
gboolean gst_tensor_repo_set_buffer(guint nth, GstBuffer *buffer, GstCaps *caps)
Push GstBuffer into repo.
Definition: gsttensor_repo.c:193
GstTensorRepoData::src_changed
gboolean src_changed
Definition: gsttensor_repo.h:48
GstTensorRepo::repo_lock
GMutex repo_lock
Definition: gsttensor_repo.h:61
GstTensorRepoData::caps
GstCaps * caps
Definition: gsttensor_repo.h:43
gst_tensor_repo_wait
gboolean gst_tensor_repo_wait(void)
Wait for the repo initialization.
Definition: gsttensor_repo.c:406
GstTensorRepoData::sink_id
guint sink_id
Definition: gsttensor_repo.h:51
GstTensorRepoData::cond_pull
GCond cond_pull
Definition: gsttensor_repo.h:45
gst_tensor_repo_init
void gst_tensor_repo_init(void)
GstTensorRepo initialization.
Definition: gsttensor_repo.c:386
GstTensorRepo
GstTensorRepo data structure.
Definition: gsttensor_repo.h:58
gst_tensor_repo_check_changed
gboolean gst_tensor_repo_check_changed(guint nth, guint *newid, gboolean is_sink)
Check repo data is changed.
Definition: gsttensor_repo.c:255
GstTensorRepo::num_data
guint num_data
Definition: gsttensor_repo.h:60
GstTensorRepoData::pushed
gboolean pushed
Definition: gsttensor_repo.h:52
GstTensorRepoData
GstTensorRepo internal data structure.
Definition: gsttensor_repo.h:40
gst_tensor_repo_get_buffer
GstBuffer * gst_tensor_repo_get_buffer(guint nth, gboolean *eos, guint *newid, GstCaps **caps)
Get GstTensorRepoData from repo.
Definition: gsttensor_repo.c:309
GstTensorRepo::hash
GHashTable * hash
Definition: gsttensor_repo.h:63
tensor_common.h
Common header file for NNStreamer, the GStreamer plugin for neural networks.
GstTensorRepoData::sink_changed
gboolean sink_changed
Definition: gsttensor_repo.h:50
GstTensorRepoData::eos
gboolean eos
Definition: gsttensor_repo.h:47
GstTensorRepoData::src_id
guint src_id
Definition: gsttensor_repo.h:49
GstTensorRepo::initialized
gboolean initialized
Definition: gsttensor_repo.h:64
GstTensorRepoData::buffer
GstBuffer * buffer
Definition: gsttensor_repo.h:42
gst_tensor_repo_remove_repodata
gboolean gst_tensor_repo_remove_repodata(guint nth)
Remove nth GstTensorRepoData from GstTensorRepo.
Definition: gsttensor_repo.c:357
GstTensorRepoData::lock
GMutex lock
Definition: gsttensor_repo.h:46
gst_tensor_repo_check_eos
gboolean gst_tensor_repo_check_eos(guint nth)
Check EOS (End-of-Stream) of slot.
Definition: gsttensor_repo.c:236
GstTensorRepoData::cond_push
GCond cond_push
Definition: gsttensor_repo.h:44
gst_tensor_repo_add_repodata
gboolean gst_tensor_repo_add_repodata(guint myid, gboolean is_sink)
Add GstTensorRepoData into repo.
Definition: gsttensor_repo.c:129
gst_tensor_repo_set_eos
gboolean gst_tensor_repo_set_eos(guint nth)
Set EOS (End-of-Stream) of slot.
Definition: gsttensor_repo.c:287
GstTensorRepo::repo_cond
GCond repo_cond
Definition: gsttensor_repo.h:62