NVIDIA DeepStream SDK API Reference

7.0 Release
gst-nvdssr.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2019 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: LicenseRef-NvidiaProprietary
4  *
5  * NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
6  * property and proprietary rights in and to this material, related
7  * documentation and any modifications thereto. Any use, reproduction,
8  * disclosure or distribution of this material and related documentation
9  * without an express license agreement from NVIDIA CORPORATION or
10  * its affiliates is strictly prohibited.
11  */
12 
24 #ifndef NVDSSR_H_
25 #define NVDSSR_H_
26 
27 #include <gst/gst.h>
28 
29 #define _DS_DEPRECATED_(STR) __attribute__ ((deprecated (STR)))
30 
40 #ifdef __cplusplus
41 extern "C"
42 {
43 #endif
44 
46 
47 typedef gpointer (*NvDsSRCallbackFunc) (NvDsSRRecordingInfo *info, gpointer userData);
48 
49 typedef guint32 NvDsSRSessionId;
50 
54 typedef enum {
58 
62 typedef enum {
67 
71 } NvDsSRStatus;
72 
76 typedef struct NvDsSRInitParams
77 {
83  guint width;
85  guint height;
89  gchar *dirpath;
92  union {
94  guint videoCacheSize _DS_DEPRECATED_("videoCacheSize is deprecated. Use cacheSize instead");
96  guint cacheSize;
97  };
99 
103 typedef struct NvDsSRContext
104 {
106  GstElement *recordbin;
108  GstElement *recordQue;
110  GstElement *encodebin;
112  GstElement *filesink;
114  gboolean gotKeyFrame;
116  gboolean recordOn;
118  gboolean resetDone;
120  gboolean isPlaying;
124  GMutex flowLock;
126  GThread *resetThread;
128  gpointer uData;
130  gpointer privData;
131 } NvDsSRContext;
132 
136 typedef struct NvDsSRRecordingInfo
137 {
143  gchar *filename;
145  gchar *dirpath;
147  guint64 duration;
151  guint width;
153  guint height;
155  gboolean containsVideo;
157  guint channels;
161  gboolean containsAudio;
163 
183 
206  guint startTime, guint duration, gpointer userData);
207 
217 
228 
229 #ifdef __cplusplus
230 }
231 #endif
232 #endif /* NVDSSR_H_ */
233 
NvDsSRContext
struct NvDsSRContext NvDsSRContext
Holds information about smart record instance.
NvDsSRSessionId
guint32 NvDsSRSessionId
Definition: gst-nvdssr.h:49
NvDsSRInitParams::callback
NvDsSRCallbackFunc callback
callback function gets called once recording is complete
Definition: gst-nvdssr.h:79
NVDSSR_STATUS_CUSTOM1
@ NVDSSR_STATUS_CUSTOM1
Definition: gst-nvdssr.h:68
NvDsSRRecordingInfo::channels
guint channels
channels in recorded audio
Definition: gst-nvdssr.h:157
NVDSSR_STATUS_INVALID_OP
@ NVDSSR_STATUS_INVALID_OP
Definition: gst-nvdssr.h:65
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:118
NvDsSRRecordingInfo::ctx
NvDsSRContext * ctx
SR bin context.
Definition: gst-nvdssr.h:139
NvDsSRStatus
NvDsSRStatus
Specifies API return status.
Definition: gst-nvdssr.h:62
NvDsSRInitParams::cacheSize
guint cacheSize
size of cache in seconds, applies to video and audio.
Definition: gst-nvdssr.h:96
NvDsSRRecordingInfo
struct NvDsSRRecordingInfo NvDsSRRecordingInfo
Hold information about video recorded.
Definition: gst-nvdssr.h:45
NvDsSRContext::isPlaying
gboolean isPlaying
flag to check if encodebin is in playing state.
Definition: gst-nvdssr.h:120
NVDSSR_CONTAINER_MKV
@ NVDSSR_CONTAINER_MKV
Definition: gst-nvdssr.h:56
NvDsSRRecordingInfo::sessionId
NvDsSRSessionId sessionId
recording session-id
Definition: gst-nvdssr.h:141
NvDsSRRecordingInfo::containerType
NvDsSRContainerType containerType
recorded video container, MP4 / MKV
Definition: gst-nvdssr.h:149
NVDSSR_STATUS_CUSTOM3
@ NVDSSR_STATUS_CUSTOM3
Definition: gst-nvdssr.h:70
NvDsSRRecordingInfo::height
guint height
recorded video height
Definition: gst-nvdssr.h:153
NvDsSRRecordingInfo::width
guint width
recorded video width
Definition: gst-nvdssr.h:151
NvDsSRContext::uData
gpointer uData
pointer to user provided data
Definition: gst-nvdssr.h:128
NvDsSRRecordingInfo::dirpath
gchar * dirpath
recorded file dir path
Definition: gst-nvdssr.h:145
NvDsSRContext::flowLock
GMutex flowLock
mutex to control the flow
Definition: gst-nvdssr.h:124
NvDsSRContext::recordQue
GstElement * recordQue
queue element to cache the content.
Definition: gst-nvdssr.h:108
NVDSSR_STATUS_CUSTOM2
@ NVDSSR_STATUS_CUSTOM2
Definition: gst-nvdssr.h:69
NvDsSRCreate
NvDsSRStatus NvDsSRCreate(NvDsSRContext **ctx, NvDsSRInitParams *params)
Creates the instance of smart record.
NvDsSRCallbackFunc
gpointer(* NvDsSRCallbackFunc)(NvDsSRRecordingInfo *info, gpointer userData)
Definition: gst-nvdssr.h:47
NvDsSRContext::initParams
NvDsSRInitParams initParams
initialization parameters
Definition: gst-nvdssr.h:122
NvDsSRInitParams::width
guint width
optional, recording video width, 0 means no transcode
Definition: gst-nvdssr.h:83
NvDsSRRecordingInfo::containsAudio
gboolean containsAudio
Boolean indicating if recorded stream contains audio.
Definition: gst-nvdssr.h:161
_DS_DEPRECATED_
#define _DS_DEPRECATED_(STR)
Definition: gst-nvdssr.h:29
NVDSSR_STATUS_INVALID_VAL
@ NVDSSR_STATUS_INVALID_VAL
Definition: gst-nvdssr.h:64
NvDsSRContext
Holds information about smart record instance.
Definition: gst-nvdssr.h:103
NvDsSRRecordingInfo::duration
guint64 duration
duration in milliseconds
Definition: gst-nvdssr.h:147
NvDsSRInitParams
Holds initializtion paramerters required to create NvDsSRContext.
Definition: gst-nvdssr.h:76
NVDSSR_STATUS_OK
@ NVDSSR_STATUS_OK
Definition: gst-nvdssr.h:63
NvDsSRInitParams::fileNamePrefix
gchar * fileNamePrefix
recorded file name prefix
Definition: gst-nvdssr.h:87
NvDsSRRecordingInfo::samplingRate
guint samplingRate
sampling rate of recorded audio in Hz
Definition: gst-nvdssr.h:159
NvDsSRContext::gotKeyFrame
gboolean gotKeyFrame
flag to check the key frame.
Definition: gst-nvdssr.h:114
NvDsSRInitParams::height
guint height
optional, recording video height, 0 means no transcode
Definition: gst-nvdssr.h:85
NvDsSRContainerType
NvDsSRContainerType
Specifies container types.
Definition: gst-nvdssr.h:54
NvDsSRContext::resetThread
GThread * resetThread
thread to reset the encodebin
Definition: gst-nvdssr.h:126
NVDSSR_CONTAINER_MP4
@ NVDSSR_CONTAINER_MP4
Definition: gst-nvdssr.h:55
NvDsSRContext::recordbin
GstElement * recordbin
parent bin element.
Definition: gst-nvdssr.h:106
NVDSSR_STATUS_ERROR
@ NVDSSR_STATUS_ERROR
Definition: gst-nvdssr.h:66
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:91
NvDsSRContext::encodebin
GstElement * encodebin
child bin to save the content to file.
Definition: gst-nvdssr.h:110
NvDsSRInitParams::containerType
NvDsSRContainerType containerType
recording video container, MP4 / MKV
Definition: gst-nvdssr.h:81
NvDsSRRecordingInfo::filename
gchar * filename
recorded file name
Definition: gst-nvdssr.h:143
NvDsSRInitParams::dirpath
gchar * dirpath
store recorded file under directory path
Definition: gst-nvdssr.h:89
NvDsSRRecordingInfo::containsVideo
gboolean containsVideo
Boolean indicating if recorded stream contains video.
Definition: gst-nvdssr.h:155
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:116
NvDsSRRecordingInfo
Hold information about video recorded.
Definition: gst-nvdssr.h:136
NvDsSRContext::privData
gpointer privData
pointer to private data
Definition: gst-nvdssr.h:130
NvDsSRContext::filesink
GstElement * filesink
filesink element
Definition: gst-nvdssr.h:112