NVIDIA DeepStream SDK API Reference

6.4 Release
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 {
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 
204  guint startTime, guint duration, gpointer userData);
205 
215 
226 
227 #ifdef __cplusplus
228 }
229 #endif
230 #endif /* NVDSSR_H_ */
231 
NvDsSRContext
struct NvDsSRContext NvDsSRContext
Holds information about smart record instance.
NvDsSRSessionId
guint32 NvDsSRSessionId
Definition: gst-nvdssr.h:47
NvDsSRInitParams::callback
NvDsSRCallbackFunc callback
callback function gets called once recording is complete
Definition: gst-nvdssr.h:77
NVDSSR_STATUS_CUSTOM1
@ NVDSSR_STATUS_CUSTOM1
Definition: gst-nvdssr.h:66
NvDsSRRecordingInfo::channels
guint channels
channels in recorded audio
Definition: gst-nvdssr.h:155
NVDSSR_STATUS_INVALID_OP
@ NVDSSR_STATUS_INVALID_OP
Definition: gst-nvdssr.h:63
NvDsSRStart
NvDsSRStatus NvDsSRStart(NvDsSRContext *ctx, NvDsSRSessionId *sessionId, guint startTime, guint duration, gpointer userData)
Starts the video recording.
NvDsSRDestroy
NvDsSRStatus NvDsSRDestroy(NvDsSRContext *ctx)
Destroys the instance of smart record.
NvDsSRContext::resetDone
gboolean resetDone
flag to check if encodebin is reset
Definition: gst-nvdssr.h:116
NvDsSRRecordingInfo::ctx
NvDsSRContext * ctx
SR bin context.
Definition: gst-nvdssr.h:137
NvDsSRStatus
NvDsSRStatus
Specifies API return status.
Definition: gst-nvdssr.h:60
NvDsSRInitParams::cacheSize
guint cacheSize
size of cache in seconds, applies to video and audio.
Definition: gst-nvdssr.h:94
NvDsSRRecordingInfo
struct NvDsSRRecordingInfo NvDsSRRecordingInfo
Hold information about video recorded.
Definition: gst-nvdssr.h:43
NvDsSRContext::isPlaying
gboolean isPlaying
flag to check if encodebin is in playing state.
Definition: gst-nvdssr.h:118
NVDSSR_CONTAINER_MKV
@ NVDSSR_CONTAINER_MKV
Definition: gst-nvdssr.h:54
NvDsSRRecordingInfo::sessionId
NvDsSRSessionId sessionId
recording session-id
Definition: gst-nvdssr.h:139
NvDsSRRecordingInfo::containerType
NvDsSRContainerType containerType
recorded video container, MP4 / MKV
Definition: gst-nvdssr.h:147
NVDSSR_STATUS_CUSTOM3
@ NVDSSR_STATUS_CUSTOM3
Definition: gst-nvdssr.h:68
NvDsSRRecordingInfo::height
guint height
recorded video height
Definition: gst-nvdssr.h:151
NvDsSRRecordingInfo::width
guint width
recorded video width
Definition: gst-nvdssr.h:149
NvDsSRContext::uData
gpointer uData
pointer to user provided data
Definition: gst-nvdssr.h:126
NvDsSRRecordingInfo::dirpath
gchar * dirpath
recorded file dir path
Definition: gst-nvdssr.h:143
NvDsSRContext::flowLock
GMutex flowLock
mutex to control the flow
Definition: gst-nvdssr.h:122
NvDsSRContext::recordQue
GstElement * recordQue
queue element to cache the content.
Definition: gst-nvdssr.h:106
NVDSSR_STATUS_CUSTOM2
@ NVDSSR_STATUS_CUSTOM2
Definition: gst-nvdssr.h:67
NvDsSRCreate
NvDsSRStatus NvDsSRCreate(NvDsSRContext **ctx, NvDsSRInitParams *params)
Creates the instance of smart record.
NvDsSRCallbackFunc
gpointer(* NvDsSRCallbackFunc)(NvDsSRRecordingInfo *info, gpointer userData)
Definition: gst-nvdssr.h:45
NvDsSRContext::initParams
NvDsSRInitParams initParams
initialization parameters
Definition: gst-nvdssr.h:120
NvDsSRInitParams::width
guint width
optional, recording video width, 0 means no transcode
Definition: gst-nvdssr.h:81
NvDsSRRecordingInfo::containsAudio
gboolean containsAudio
Boolean indicating if recorded stream contains audio.
Definition: gst-nvdssr.h:159
_DS_DEPRECATED_
#define _DS_DEPRECATED_(STR)
Definition: gst-nvdssr.h:27
NVDSSR_STATUS_INVALID_VAL
@ NVDSSR_STATUS_INVALID_VAL
Definition: gst-nvdssr.h:62
NvDsSRContext
Holds information about smart record instance.
Definition: gst-nvdssr.h:101
NvDsSRRecordingInfo::duration
guint64 duration
duration in milliseconds
Definition: gst-nvdssr.h:145
NvDsSRInitParams
Holds initializtion paramerters required to create NvDsSRContext.
Definition: gst-nvdssr.h:74
NVDSSR_STATUS_OK
@ NVDSSR_STATUS_OK
Definition: gst-nvdssr.h:61
NvDsSRInitParams::fileNamePrefix
gchar * fileNamePrefix
recorded file name prefix
Definition: gst-nvdssr.h:85
NvDsSRRecordingInfo::samplingRate
guint samplingRate
sampling rate of recorded audio in Hz
Definition: gst-nvdssr.h:157
NvDsSRContext::gotKeyFrame
gboolean gotKeyFrame
flag to check the key frame.
Definition: gst-nvdssr.h:112
NvDsSRInitParams::height
guint height
optional, recording video height, 0 means no transcode
Definition: gst-nvdssr.h:83
NvDsSRContainerType
NvDsSRContainerType
Specifies container types.
Definition: gst-nvdssr.h:52
NvDsSRContext::resetThread
GThread * resetThread
thread to reset the encodebin
Definition: gst-nvdssr.h:124
NVDSSR_CONTAINER_MP4
@ NVDSSR_CONTAINER_MP4
Definition: gst-nvdssr.h:53
NvDsSRContext::recordbin
GstElement * recordbin
parent bin element.
Definition: gst-nvdssr.h:104
NVDSSR_STATUS_ERROR
@ NVDSSR_STATUS_ERROR
Definition: gst-nvdssr.h:64
NvDsSRStop
NvDsSRStatus NvDsSRStop(NvDsSRContext *ctx, NvDsSRSessionId sessionId)
Stops the previously started recording.
NvDsSRInitParams::defaultDuration
guint defaultDuration
default recording duration in seconds
Definition: gst-nvdssr.h:89
NvDsSRContext::encodebin
GstElement * encodebin
child bin to save the content to file.
Definition: gst-nvdssr.h:108
NvDsSRInitParams::containerType
NvDsSRContainerType containerType
recording video container, MP4 / MKV
Definition: gst-nvdssr.h:79
NvDsSRRecordingInfo::filename
gchar * filename
recorded file name
Definition: gst-nvdssr.h:141
NvDsSRInitParams::dirpath
gchar * dirpath
store recorded file under directory path
Definition: gst-nvdssr.h:87
NvDsSRRecordingInfo::containsVideo
gboolean containsVideo
Boolean indicating if recorded stream contains video.
Definition: gst-nvdssr.h:153
NvDsSRInitParams
struct NvDsSRInitParams NvDsSRInitParams
Holds initializtion paramerters required to create NvDsSRContext.
NvDsSRContext::recordOn
gboolean recordOn
flag to check if recording is on
Definition: gst-nvdssr.h:114
NvDsSRRecordingInfo
Hold information about video recorded.
Definition: gst-nvdssr.h:134
NvDsSRContext::privData
gpointer privData
pointer to private data
Definition: gst-nvdssr.h:128
NvDsSRContext::filesink
GstElement * filesink
filesink element
Definition: gst-nvdssr.h:110