NVIDIA DeepStream SDK API Reference

6.1.1 Release

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
gst-nvdssr.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 NVIDIA Corporation. All rights reserved.
3  *
4  * NVIDIA Corporation and its licensors retain all intellectual property
5  * and proprietary rights in and to this software, related documentation
6  * and any modifications thereto. Any use, reproduction, disclosure or
7  * distribution of this software and related documentation without an express
8  * license agreement from NVIDIA Corporation is strictly prohibited.
9  *
10  */
22 #ifndef NVDSSR_H_
23 #define NVDSSR_H_
24 
25 #include <gst/gst.h>
26 
27 #define _DS_DEPRECATED_(STR) __attribute__ ((deprecated (STR)))
28 
38 #ifdef __cplusplus
39 extern "C"
40 {
41 #endif
42 
44 
45 typedef gpointer (*NvDsSRCallbackFunc) (NvDsSRRecordingInfo *info, gpointer userData);
46 
47 typedef guint32 NvDsSRSessionId;
48 
52 typedef enum {
56 
60 typedef enum {
65 
69 } NvDsSRStatus;
70 
74 typedef struct NvDsSRInitParams
75 {
81  guint width;
83  guint height;
87  gchar *dirpath;
90  union {
92  guint videoCacheSize _DS_DEPRECATED_("videoCacheSize is deprecated. Use cacheSize instead");
94  guint cacheSize;
95  };
97 
101 typedef struct NvDsSRContext
102 {
104  GstElement *recordbin;
106  GstElement *recordQue;
108  GstElement *encodebin;
110  GstElement *filesink;
112  gboolean gotKeyFrame;
114  gboolean recordOn;
116  gboolean resetDone;
118  gboolean isPlaying;
122  GMutex flowLock;
124  GThread *resetThread;
126  gpointer uData;
128  gpointer privData;
129 } NvDsSRContext;
130 
134 typedef struct NvDsSRRecordingInfo
135 {
139  NvDsSRSessionId sessionId;
141  gchar *filename;
143  gchar *dirpath;
145  guint64 duration;
149  guint width;
151  guint height;
153  gboolean containsVideo;
155  guint channels;
159  gboolean containsAudio;
161 
181 
203 NvDsSRStatus NvDsSRStart (NvDsSRContext *ctx, NvDsSRSessionId *sessionId,
204  guint startTime, guint duration, gpointer userData);
205 
214 NvDsSRStatus NvDsSRStop (NvDsSRContext *ctx, NvDsSRSessionId sessionId);
215 
226 
227 #ifdef __cplusplus
228 }
229 #endif
230 #endif /* NVDSSR_H_ */
231 
struct NvDsSRRecordingInfo NvDsSRRecordingInfo
Hold information about video recorded.
Definition: gst-nvdssr.h:43
gboolean isPlaying
flag to check if encodebin is in playing state.
Definition: gst-nvdssr.h:118
NvDsSRInitParams initParams
initialization parameters
Definition: gst-nvdssr.h:120
Holds information about smart record instance.
Definition: gst-nvdssr.h:101
NvDsSRStatus NvDsSRStop(NvDsSRContext *ctx, NvDsSRSessionId sessionId)
Stops the previously started recording.
GMutex flowLock
mutex to control the flow
Definition: gst-nvdssr.h:122
Holds initializtion paramerters required to create NvDsSRContext.
Definition: gst-nvdssr.h:74
guint height
recorded video height
Definition: gst-nvdssr.h:151
NvDsSRStatus
Specifies API return status.
Definition: gst-nvdssr.h:60
GstElement * recordQue
queue element to cache the content.
Definition: gst-nvdssr.h:106
GstElement * recordbin
parent bin element.
Definition: gst-nvdssr.h:104
gchar * filename
recorded file name
Definition: gst-nvdssr.h:141
guint width
recorded video width
Definition: gst-nvdssr.h:149
NvDsSRStatus NvDsSRStart(NvDsSRContext *ctx, NvDsSRSessionId *sessionId, guint startTime, guint duration, gpointer userData)
Starts the video recording.
#define _DS_DEPRECATED_(STR)
Definition: gst-nvdssr.h:27
guint cacheSize
size of cache in seconds, applies to video and audio.
Definition: gst-nvdssr.h:94
gboolean containsAudio
Boolean indicating if recorded stream contains audio.
Definition: gst-nvdssr.h:159
gchar * dirpath
recorded file dir path
Definition: gst-nvdssr.h:143
NvDsSRStatus NvDsSRDestroy(NvDsSRContext *ctx)
Destroys the instance of smart record.
gboolean containsVideo
Boolean indicating if recorded stream contains video.
Definition: gst-nvdssr.h:153
Hold information about video recorded.
Definition: gst-nvdssr.h:134
guint samplingRate
sampling rate of recorded audio in Hz
Definition: gst-nvdssr.h:157
gboolean gotKeyFrame
flag to check the key frame.
Definition: gst-nvdssr.h:112
guint channels
channels in recorded audio
Definition: gst-nvdssr.h:155
NvDsSRStatus NvDsSRCreate(NvDsSRContext **ctx, NvDsSRInitParams *params)
Creates the instance of smart record.
guint width
optional, recording video width, 0 means no transcode
Definition: gst-nvdssr.h:81
gchar * fileNamePrefix
recorded file name prefix
Definition: gst-nvdssr.h:85
NvDsSRContext * ctx
SR bin context.
Definition: gst-nvdssr.h:137
gboolean recordOn
flag to check if recording is on
Definition: gst-nvdssr.h:114
NvDsSRContainerType containerType
recording video container, MP4 / MKV
Definition: gst-nvdssr.h:79
gpointer privData
pointer to private data
Definition: gst-nvdssr.h:128
guint64 duration
duration in milliseconds
Definition: gst-nvdssr.h:145
gpointer uData
pointer to user provided data
Definition: gst-nvdssr.h:126
guint height
optional, recording video height, 0 means no transcode
Definition: gst-nvdssr.h:83
NvDsSRContainerType
Specifies container types.
Definition: gst-nvdssr.h:52
guint32 NvDsSRSessionId
Definition: gst-nvdssr.h:47
gboolean resetDone
flag to check if encodebin is reset
Definition: gst-nvdssr.h:116
struct NvDsSRContext NvDsSRContext
Holds information about smart record instance.
GstElement * filesink
filesink element
Definition: gst-nvdssr.h:110
guint defaultDuration
default recording duration in seconds
Definition: gst-nvdssr.h:89
NvDsSRSessionId sessionId
recording session-id
Definition: gst-nvdssr.h:139
NvDsSRContainerType containerType
recorded video container, MP4 / MKV
Definition: gst-nvdssr.h:147
gpointer(* NvDsSRCallbackFunc)(NvDsSRRecordingInfo *info, gpointer userData)
Definition: gst-nvdssr.h:45
NvDsSRCallbackFunc callback
callback function gets called once recording is complete
Definition: gst-nvdssr.h:77
GstElement * encodebin
child bin to save the content to file.
Definition: gst-nvdssr.h:108
GThread * resetThread
thread to reset the encodebin
Definition: gst-nvdssr.h:124
struct NvDsSRInitParams NvDsSRInitParams
Holds initializtion paramerters required to create NvDsSRContext.
gchar * dirpath
store recorded file under directory path
Definition: gst-nvdssr.h:87