NVIDIA DeepStream SDK API Reference

6.4 Release
deepstream_asr_app.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2020-2022, NVIDIA CORPORATION. All rights reserved.
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20 * DEALINGS IN THE SOFTWARE.
21 */
22 
23 #ifndef __DEEPSTREAM_ASR_APP_H_
24 #define __DEEPSTREAM_ASR_APP_H_
25 
26 #include <gst/gst.h>
27 #include <glib.h>
28 #include <stdio.h>
29 #include <stdlib.h>
31 
32 #define CHECK_PTR(ptr) \
33  if(ptr == NULL) \
34  { \
35  return -1; \
36  }
37 
38 typedef struct __StreamCtx
39 {
40  gchar *uri;
41  guint stream_id;
42  guint has_audio;
43  guint bus_id;
44  GstElement *asr_pipeline;
45  int eos_received;
47  FILE *FP_asr;
48 } StreamCtx;
49 
50 typedef struct __AppCtx
51 {
52  guint num_sources;
53  StreamCtx *sctx;
55 } AppCtx;
56 
57 
58 int create_pipeline(AppCtx *appctx, int stream_num, StreamCtx *sctx);
59 int start_pipeline(int stream_num, StreamCtx *sctx);
60 int destroy_pipeline(StreamCtx *sctx);
61 
62 guint get_num_sources (gchar *cfg_file_path);
63 gboolean parse_config_file (AppCtx *appctx, gchar *config_file);
64 
65 G_BEGIN_DECLS
66 
67 guint get_num_sources_yaml (gchar *cfg_file_path);
68 gboolean parse_config_file_yaml (AppCtx *appctx, gchar *config_file);
69 
70 G_END_DECLS
71 #endif
__AppCtx::app_config
NvDsAppConfig app_config
Definition: deepstream_asr_tts_app.h:125
__StreamCtx::asr_pipeline
GstElement * asr_pipeline
Definition: deepstream_asr_tts_app.h:105
AppCtx
REST server application context.
Definition: nvds_appctx_server.h:57
parse_config_file_yaml
gboolean parse_config_file_yaml(AppCtx *appctx, gchar *config_file)
__AppCtx::num_sources
guint num_sources
Definition: deepstream_asr_tts_app.h:114
__StreamCtx::eos_received
int eos_received
Definition: deepstream_asr_tts_app.h:107
deepstream_asr_config_file_parser.h
__StreamCtx::stream_id
guint stream_id
Definition: deepstream_asr_tts_app.h:102
__StreamCtx
Definition: deepstream_asr_tts_app.h:99
start_pipeline
int start_pipeline(int stream_num, StreamCtx *sctx)
get_num_sources_yaml
G_BEGIN_DECLS guint get_num_sources_yaml(gchar *cfg_file_path)
create_pipeline
int create_pipeline(AppCtx *appctx, int stream_num, StreamCtx *sctx)
get_num_sources
guint get_num_sources(gchar *cfg_file_path)
__StreamCtx::FP_asr
FILE * FP_asr
Definition: deepstream_asr_tts_app.h:109
__NvDsAppConfig
Definition: deepstream_asr_tts_config_file_parser.h:36
StreamCtx
struct __StreamCtx StreamCtx
parse_config_file
gboolean parse_config_file(AppCtx *appctx, gchar *config_file)
__StreamCtx::bus_id
guint bus_id
Definition: deepstream_asr_tts_app.h:104
__NvDsAudioConfig
Definition: deepstream_asr_tts_config_file_parser.h:30
__AppCtx::sctx
StreamCtx * sctx
Definition: deepstream_asr_tts_app.h:115
__StreamCtx::audio_config
NvDsAudioConfig audio_config
Definition: deepstream_asr_tts_app.h:108
destroy_pipeline
int destroy_pipeline(StreamCtx *sctx)
__StreamCtx::uri
gchar * uri
Definition: deepstream_asr_tts_app.h:101
AppCtx
struct __AppCtx AppCtx
__StreamCtx::has_audio
guint has_audio
Definition: deepstream_asr_tts_app.h:103
__AppCtx
Definition: deepstream_asr_tts_app.h:112