NVIDIA DeepStream SDK API Reference

5.0 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 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
42 
43 typedef gpointer (*NvDsSRCallbackFunc) (NvDsSRRecordingInfo *info, gpointer userData);
44 
45 typedef guint32 NvDsSRSessionId;
46 
50 typedef enum {
54 
58 typedef enum {
63 
67 } NvDsSRStatus;
68 
72 typedef struct NvDsSRInitParams
73 {
79  guint width;
81  guint height;
85  gchar *dirpath;
91 
95 typedef struct NvDsSRContext
96 {
98  GstElement *recordbin;
100  GstElement *recordQue;
102  GstElement *encodebin;
104  GstElement *filesink;
106  gboolean gotKeyFrame;
108  gboolean recordOn;
110  gboolean resetDone;
112  gboolean isPlaying;
116  GMutex flowLock;
118  GThread *resetThread;
120  gpointer uData;
122  gpointer privData;
123 } NvDsSRContext;
124 
128 typedef struct NvDsSRRecordingInfo
129 {
133  NvDsSRSessionId sessionId;
135  gchar *filename;
137  gchar *dirpath;
139  guint64 duration;
143  guint width;
145  guint height;
147 
167 
189 NvDsSRStatus NvDsSRStart (NvDsSRContext *ctx, NvDsSRSessionId *sessionId,
190  guint startTime, guint duration, gpointer userData);
191 
200 NvDsSRStatus NvDsSRStop (NvDsSRContext *ctx, NvDsSRSessionId sessionId);
201 
212 
213 #ifdef __cplusplus
214 }
215 #endif
216 #endif /* NVDSSR_H_ */
217 
struct NvDsSRRecordingInfo NvDsSRRecordingInfo
Hold information about video recorded.
Definition: gst-nvdssr.h:41
gboolean isPlaying
flag to check if encodebin is in playing state.
Definition: gst-nvdssr.h:112
guint videoCacheSize
size of video cache in seconds.
Definition: gst-nvdssr.h:89
NvDsSRInitParams initParams
initialization parameters
Definition: gst-nvdssr.h:114
Holds information about smart record instance.
Definition: gst-nvdssr.h:95
NvDsSRStatus NvDsSRStop(NvDsSRContext *ctx, NvDsSRSessionId sessionId)
Stops the previously started recording.
GMutex flowLock
mutex to control the flow
Definition: gst-nvdssr.h:116
Holds initializtion paramerters required to create NvDsSRContext.
Definition: gst-nvdssr.h:72
guint height
recorded video height
Definition: gst-nvdssr.h:145
NvDsSRStatus
Specifies API return status.
Definition: gst-nvdssr.h:58
GstElement * recordQue
queue element to cache the content.
Definition: gst-nvdssr.h:100
GstElement * recordbin
parent bin element.
Definition: gst-nvdssr.h:98
gchar * filename
recorded file name
Definition: gst-nvdssr.h:135
guint width
recorded video width
Definition: gst-nvdssr.h:143
NvDsSRStatus NvDsSRStart(NvDsSRContext *ctx, NvDsSRSessionId *sessionId, guint startTime, guint duration, gpointer userData)
Starts the video recording.
gchar * dirpath
recorded file dir path
Definition: gst-nvdssr.h:137
NvDsSRStatus NvDsSRDestroy(NvDsSRContext *ctx)
Destroys the instance of smart record.
Hold information about video recorded.
Definition: gst-nvdssr.h:128
gboolean gotKeyFrame
flag to check the key frame.
Definition: gst-nvdssr.h:106
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:79
gchar * fileNamePrefix
recorded file name prefix
Definition: gst-nvdssr.h:83
NvDsSRContext * ctx
SR bin context.
Definition: gst-nvdssr.h:131
gboolean recordOn
flag to check if recording is on
Definition: gst-nvdssr.h:108
NvDsSRContainerType containerType
recording video container, MP4 / MKV
Definition: gst-nvdssr.h:77
gpointer privData
pointer to private data
Definition: gst-nvdssr.h:122
guint64 duration
duration in milliseconds
Definition: gst-nvdssr.h:139
gpointer uData
pointer to user provided data
Definition: gst-nvdssr.h:120
guint height
optional, recording video height, 0 means no transcode
Definition: gst-nvdssr.h:81
NvDsSRContainerType
Specifies container types.
Definition: gst-nvdssr.h:50
guint32 NvDsSRSessionId
Definition: gst-nvdssr.h:45
gboolean resetDone
flag to check if encodebin is reset
Definition: gst-nvdssr.h:110
struct NvDsSRContext NvDsSRContext
Holds information about smart record instance.
GstElement * filesink
filesink element
Definition: gst-nvdssr.h:104
guint defaultDuration
default recording duration in seconds
Definition: gst-nvdssr.h:87
NvDsSRSessionId sessionId
recording session-id
Definition: gst-nvdssr.h:133
NvDsSRContainerType containerType
recorded video container, MP4 / MKV
Definition: gst-nvdssr.h:141
gpointer(* NvDsSRCallbackFunc)(NvDsSRRecordingInfo *info, gpointer userData)
Definition: gst-nvdssr.h:43
NvDsSRCallbackFunc callback
callback function gets called once recording is complete
Definition: gst-nvdssr.h:75
GstElement * encodebin
child bin to save the content to file.
Definition: gst-nvdssr.h:102
GThread * resetThread
thread to reset the encodebin
Definition: gst-nvdssr.h:118
struct NvDsSRInitParams NvDsSRInitParams
Holds initializtion paramerters required to create NvDsSRContext.
gchar * dirpath
store recorded file under directory path
Definition: gst-nvdssr.h:85