Doxygen Book
nnstreamer_plugin_api.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: LGPL-2.1-only */
15 #ifndef __NNS_PLUGIN_API_H__
16 #define __NNS_PLUGIN_API_H__
17 
18 #include <glib.h>
19 #include <gst/gst.h>
20 #include <tensor_typedef.h>
21 #include <nnstreamer_version.h>
23 
24 G_BEGIN_DECLS
25 
31 extern gboolean
32 gst_structure_is_tensor_stream (const GstStructure * structure);
33 
39 extern media_type
40 gst_structure_get_media_type (const GstStructure * structure);
41 
48 extern gboolean
50  const GstStructure *structure);
51 
59 extern gboolean
60 gst_tensors_config_from_peer (GstPad * pad, GstTensorsConfig * config,
61  gboolean * is_fixed);
62 
68 extern GstCaps *
70 
76 extern GstCaps *
78 
83 extern void
84 gst_tensor_alloc_init (gsize alignment);
85 
92 extern gboolean
94 
101 extern GstMemory *
102 gst_tensor_meta_info_append_header (GstTensorMetaInfo * meta, GstMemory * mem);
103 
109 extern void
110 gst_tensor_caps_update_dimension (GstCaps *caps, GstCaps *filter);
111 
118 extern gboolean
119 gst_tensor_caps_can_intersect (GstCaps *caps1, GstCaps *caps2);
120 
127 extern GstMemory *
128 gst_tensor_buffer_get_nth_memory (GstBuffer * buffer, const guint index);
129 
137 extern gboolean
138 gst_tensor_buffer_append_memory (GstBuffer * buffer, GstMemory * memory, const GstTensorInfo * info);
139 
143 extern guint
144 gst_tensor_buffer_get_count (GstBuffer * buffer);
145 
146 G_END_DECLS
147 #endif /* __NNS_PLUGIN_API_H__ */
GstTensorInfo
Internal data structure for tensor info.
Definition: tensor_typedef.h:261
gst_tensors_config_from_peer
gboolean gst_tensors_config_from_peer(GstPad *pad, GstTensorsConfig *config, gboolean *is_fixed)
Parse caps from peer pad and set tensors config.
Definition: nnstreamer_plugin_api_impl.c:1041
gst_tensor_caps_update_dimension
void gst_tensor_caps_update_dimension(GstCaps *caps, GstCaps *filter)
Update caps dimension for negotiation.
Definition: nnstreamer_plugin_api_impl.c:1093
GstTensorMetaInfo
Data structure to describe a tensor data. This represents the basic information of a memory block for...
Definition: tensor_typedef.h:310
nnstreamer_plugin_api_util.h
Optional/Additional NNStreamer APIs for sub-plugin writers. (No GStreamer dependency)
gst_tensor_meta_info_append_header
GstMemory * gst_tensor_meta_info_append_header(GstTensorMetaInfo *meta, GstMemory *mem)
Append header to memory.
Definition: nnstreamer_plugin_api_impl.c:1544
gst_structure_get_media_type
media_type gst_structure_get_media_type(const GstStructure *structure)
Get media type from structure.
Definition: nnstreamer_plugin_api_impl.c:1001
gst_tensor_caps_from_config
GstCaps * gst_tensor_caps_from_config(const GstTensorsConfig *config)
Get tensor caps from tensors config (for other/tensor)
Definition: nnstreamer_plugin_api_impl.c:1395
GstTensorsConfig
Internal data structure for configured tensors info (for other/tensors).
Definition: tensor_typedef.h:284
gst_structure_is_tensor_stream
G_BEGIN_DECLS gboolean gst_structure_is_tensor_stream(const GstStructure *structure)
Check given mimetype is tensor stream.
Definition: nnstreamer_plugin_api_impl.c:984
tensor_typedef.h
Common header file for NNStreamer, the GStreamer plugin for neural networks.
gst_tensor_caps_can_intersect
gboolean gst_tensor_caps_can_intersect(GstCaps *caps1, GstCaps *caps2)
Try intersecting @caps1 and @caps2 for tensor stream.
Definition: nnstreamer_plugin_api_impl.c:1142
media_type
enum _nns_media_type media_type
Float16 compiler extension support.
gst_tensors_caps_from_config
GstCaps * gst_tensors_caps_from_config(const GstTensorsConfig *config)
Get caps from tensors config (for other/tensors)
Definition: nnstreamer_plugin_api_impl.c:1372
gst_tensor_buffer_get_nth_memory
GstMemory * gst_tensor_buffer_get_nth_memory(GstBuffer *buffer, const guint index)
Get the nth GstMemory from given buffer.
Definition: nnstreamer_plugin_api_impl.c:1586
gst_tensor_buffer_get_count
guint gst_tensor_buffer_get_count(GstBuffer *buffer)
Get the number of tensors in the buffer.
Definition: nnstreamer_plugin_api_impl.c:1813
gst_tensor_meta_info_parse_memory
gboolean gst_tensor_meta_info_parse_memory(GstTensorMetaInfo *meta, GstMemory *mem)
Parse memory and fill the tensor meta.
Definition: nnstreamer_plugin_api_impl.c:1509
gst_tensor_alloc_init
void gst_tensor_alloc_init(gsize alignment)
set alignment that default allocator would align to
Definition: tensor_allocator.c:109
gst_tensors_config_from_structure
gboolean gst_tensors_config_from_structure(GstTensorsConfig *config, const GstStructure *structure)
Parse structure and set tensors config (for other/tensors)
Definition: nnstreamer_plugin_api_impl.c:1413
gst_tensor_buffer_append_memory
gboolean gst_tensor_buffer_append_memory(GstBuffer *buffer, GstMemory *memory, const GstTensorInfo *info)
Append memory to given buffer.
Definition: nnstreamer_plugin_api_impl.c:1666