Doxygen Book
tensor_query_server.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-only */
13 #ifndef __GST_TENSOR_QUERY_SERVER_H__
14 #define __GST_TENSOR_QUERY_SERVER_H__
15 
16 #include <gst/gst.h>
17 #include <tensor_common.h>
18 #include <nnstreamer-edge.h>
19 #include "tensor_meta.h"
20 
21 G_BEGIN_DECLS
22 #define DEFAULT_SERVER_ID 0
23 #define DEFAULT_QUERY_INFO_TIMEOUT 5
24 
28 typedef struct
29 {
30  gchar *host;
31  guint16 port;
32  gchar *dest_host;
33  guint16 dest_port;
34  gchar *topic;
35 
36  /* nns-edge callback info */
37  nns_edge_event_cb cb;
38  void *pdata;
40 
44 typedef struct
45 {
46  guint id;
47  gboolean configured;
48  GMutex lock;
49  GCond cond;
50 
51  nns_edge_h edge_h;
53 
57 gboolean gst_tensor_query_server_add_data (const guint id);
58 
62 gboolean gst_tensor_query_server_prepare (const guint id,
63  nns_edge_connect_type_e connect_type, GstTensorQueryEdgeInfo *edge_info);
64 
68 void gst_tensor_query_server_remove_data (const guint id);
69 
73 gboolean gst_tensor_query_server_wait_sink (const guint id);
74 
78 gboolean gst_tensor_query_server_send_buffer (const guint id, GstBuffer *buffer);
79 
83 void gst_tensor_query_server_set_configured (const guint id);
84 
88 void gst_tensor_query_server_set_caps (const guint id, const gchar *caps_str);
89 
94 
95 G_END_DECLS
96 #endif /* __GST_TENSOR_QUERY_CLIENT_H__ */
gst_tensor_query_server_release_edge_handle
void gst_tensor_query_server_release_edge_handle(const guint id)
Release nnstreamer edge handle of query server.
Definition: tensor_query_server.c:258
GstTensorQueryEdgeInfo::host
gchar * host
Definition: tensor_query_server.h:30
GstTensorQueryServer::cond
GCond cond
Definition: tensor_query_server.h:49
GstTensorQueryEdgeInfo::cb
nns_edge_event_cb cb
Definition: tensor_query_server.h:37
GstTensorQueryEdgeInfo
Internal data structure for nns-edge info to prepare edge connection.
Definition: tensor_query_server.h:28
GstTensorQueryServer::id
guint id
Definition: tensor_query_server.h:46
gst_tensor_query_server_prepare
gboolean gst_tensor_query_server_prepare(const guint id, nns_edge_connect_type_e connect_type, GstTensorQueryEdgeInfo *edge_info)
Prepare edge connection and its handle.
Definition: tensor_query_server.c:114
gst_tensor_query_server_send_buffer
gboolean gst_tensor_query_server_send_buffer(const guint id, GstBuffer *buffer)
Send buffer to connected edge device.
Definition: tensor_query_server.c:183
GstTensorQueryServer::lock
GMutex lock
Definition: tensor_query_server.h:48
tensor_meta.h
Internal tensor meta header for nnstreamer.
GstTensorQueryEdgeInfo::dest_host
gchar * dest_host
Definition: tensor_query_server.h:32
gst_tensor_query_server_remove_data
void gst_tensor_query_server_remove_data(const guint id)
Remove GstTensorQueryServer.
Definition: tensor_query_server.c:280
gst_tensor_query_server_set_caps
void gst_tensor_query_server_set_caps(const guint id, const gchar *caps_str)
set query server caps.
Definition: tensor_query_server.c:342
GstTensorQueryEdgeInfo::port
guint16 port
Definition: tensor_query_server.h:31
gst_tensor_query_server_wait_sink
gboolean gst_tensor_query_server_wait_sink(const guint id)
Wait until the sink is configured and get server info handle.
Definition: tensor_query_server.c:292
tensor_common.h
Common header file for NNStreamer, the GStreamer plugin for neural networks.
GstTensorQueryServer::configured
gboolean configured
Definition: tensor_query_server.h:47
GstTensorQueryEdgeInfo::dest_port
guint16 dest_port
Definition: tensor_query_server.h:33
gst_tensor_query_server_set_configured
void gst_tensor_query_server_set_configured(const guint id)
set query server sink configured.
Definition: tensor_query_server.c:322
GstTensorQueryServer::edge_h
nns_edge_h edge_h
Definition: tensor_query_server.h:51
GstTensorQueryEdgeInfo::pdata
void * pdata
Definition: tensor_query_server.h:38
GstTensorQueryServer
GstTensorQueryServer internal info data structure.
Definition: tensor_query_server.h:44
GstTensorQueryEdgeInfo::topic
gchar * topic
Definition: tensor_query_server.h:34
gst_tensor_query_server_add_data
gboolean gst_tensor_query_server_add_data(const guint id)
Add GstTensorQueryServer.
Definition: tensor_query_server.c:77