NVIDIA DeepStream SDK API Reference

8.0 Release
gstnvimagedec.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2023-2024 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 
11 
12 #ifndef __GST_NVIMAGE_DEC_H__
13 #define __GST_NVIMAGE_DEC_H__
14 
15 #include <gst/gst.h>
16 #include <gst/video/video.h>
17 
18 #include "nvjpeg.h"
19 
20 G_BEGIN_DECLS
21 
22 #define GST_TYPE_NVIMAGE_DEC \
23  (gst_nvimage_dec_get_type())
24 #define GST_NVIMAGE_DEC(obj) \
25  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVIMAGE_DEC,GstNvImageDec))
26 #define GST_NVIMAGE_DEC_CLASS(klass) \
27  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVIMAGE_DEC,GstNvImageDecClass))
28 #define GST_IS_NVIMAGE_DEC(obj) \
29  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVIMAGE_DEC))
30 #define GST_IS_NVIMAGE_DEC_CLASS(obj) \
31  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVIMAGE_DEC))
32 
35 
36 #define START_MEASUREMENT \
37  timeval start, end; \
38  gettimeofday (&start, NULL);
39 #define STOP_MEASUREMENT \
40  gettimeofday (&end, NULL); \
41  long seconds = end.tv_sec - start.tv_sec; \
42  long microseconds = end.tv_usec - start.tv_usec; \
43  long totalTimeMicro = seconds * 1000000 + microseconds;
44 
45 typedef struct decode_params_t_ {
46  int dev;
47 
48  nvjpegJpegState_t nvjpeg_state;
49  nvjpegHandle_t nvjpeg_handle;
50  nvjpegJpegStream_t nvjpeg_stream;
52 
53  nvjpegOutputFormat_t fmt;
55 
57 {
58  GstVideoDecoder parent;
59 
60  /* < private > */
61  GstVideoCodecState *input_state;
62  GstVideoCodecState *output_state;
63  gint width;
64  gint height;
65  gint old_width;
66  gint old_height;
67  gboolean needs_pool;
68  guint gpu_id;
69  GstVideoFormat format;
71  GstBufferPool *pool;
72  gboolean nvimagedec_init;
73 };
74 
76 {
77  GstVideoDecoderClass parent_class;
78 };
79 
80 GType gst_nvimage_dec_get_type (void);
81 
82 G_END_DECLS
83 
84 #endif /* __GST_NVIMAGE_DEC_H__ */
_GstNvImageDec::old_width
gint old_width
Definition: gstnvimagedec.h:65
_GstNvImageDec::needs_pool
gboolean needs_pool
Definition: gstnvimagedec.h:67
_GstNvImageDec::params
decode_params_t params
Definition: gstnvimagedec.h:70
decode_params_t_::fmt
nvjpegOutputFormat_t fmt
Definition: gstnvimagedec.h:53
_GstNvImageDec::nvimagedec_init
gboolean nvimagedec_init
Definition: gstnvimagedec.h:72
_GstNvImageDec::old_height
gint old_height
Definition: gstnvimagedec.h:66
_GstNvImageDec::gpu_id
guint gpu_id
Definition: gstnvimagedec.h:68
_GstNvImageDec::height
gint height
Definition: gstnvimagedec.h:64
decode_params_t_::nvjpeg_handle
nvjpegHandle_t nvjpeg_handle
Definition: gstnvimagedec.h:49
_GstNvImageDec::format
GstVideoFormat format
Definition: gstnvimagedec.h:69
_GstNvImageDec::input_state
GstVideoCodecState * input_state
Definition: gstnvimagedec.h:61
decode_params_t_::stream
cudaStream_t stream
Definition: gstnvimagedec.h:51
_GstNvImageDec::width
gint width
Definition: gstnvimagedec.h:63
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: nvbufsurftransform.h:35
_GstNvImageDec
Definition: gstnvimagedec.h:56
_GstNvImageDec::pool
GstBufferPool * pool
Definition: gstnvimagedec.h:71
decode_params_t_::nvjpeg_state
nvjpegJpegState_t nvjpeg_state
Definition: gstnvimagedec.h:48
decode_params_t_
Definition: gstnvimagedec.h:45
gst_nvimage_dec_get_type
GType gst_nvimage_dec_get_type(void)
decode_params_t_::nvjpeg_stream
nvjpegJpegStream_t nvjpeg_stream
Definition: gstnvimagedec.h:50
decode_params_t
struct decode_params_t_ decode_params_t
_GstNvImageDecClass::parent_class
GstVideoDecoderClass parent_class
Definition: gstnvimagedec.h:77
decode_params_t_::dev
int dev
Definition: gstnvimagedec.h:46
_GstNvImageDecClass
Definition: gstnvimagedec.h:75
_GstNvImageDec::parent
GstVideoDecoder parent
Definition: gstnvimagedec.h:58
_GstNvImageDec::output_state
GstVideoCodecState * output_state
Definition: gstnvimagedec.h:62