NVIDIA DeepStream SDK API Reference

9.1 Release
9.1/sources/gst-plugins/gst-nvimage/gstnvimagedec.h
Go to the documentation of this file.
1 /*
2  * SPDX-FileCopyrightText: Copyright (c) 2023-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3  * SPDX-License-Identifier: Apache-2.0
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifndef __GST_NVIMAGE_DEC_H__
19 #define __GST_NVIMAGE_DEC_H__
20 
21 #include <gst/gst.h>
22 #include <gst/video/video.h>
23 
24 #include "nvjpeg.h"
25 
26 G_BEGIN_DECLS
27 
28 #define GST_TYPE_NVIMAGE_DEC \
29  (gst_nvimage_dec_get_type())
30 #define GST_NVIMAGE_DEC(obj) \
31  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVIMAGE_DEC,GstNvImageDec))
32 #define GST_NVIMAGE_DEC_CLASS(klass) \
33  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVIMAGE_DEC,GstNvImageDecClass))
34 #define GST_IS_NVIMAGE_DEC(obj) \
35  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVIMAGE_DEC))
36 #define GST_IS_NVIMAGE_DEC_CLASS(obj) \
37  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVIMAGE_DEC))
38 
41 
42 #define START_MEASUREMENT \
43  timeval start, end; \
44  gettimeofday (&start, NULL);
45 #define STOP_MEASUREMENT \
46  gettimeofday (&end, NULL); \
47  long seconds = end.tv_sec - start.tv_sec; \
48  long microseconds = end.tv_usec - start.tv_usec; \
49  long totalTimeMicro = seconds * 1000000 + microseconds;
50 
51 typedef struct decode_params_t_ {
52  int dev;
53 
54  nvjpegJpegState_t nvjpeg_state;
55  nvjpegHandle_t nvjpeg_handle;
56  nvjpegJpegStream_t nvjpeg_stream;
58 
59  nvjpegOutputFormat_t fmt;
61 
62 struct _GstNvImageDec
63 {
64  GstVideoDecoder parent;
65 
66  /* < private > */
67  GstVideoCodecState *input_state;
68  GstVideoCodecState *output_state;
69  gint width;
70  gint height;
71  gint old_width;
72  gint old_height;
73  gboolean needs_pool;
74  guint gpu_id;
75  GstVideoFormat format;
77  GstBufferPool *pool;
78  gboolean nvimagedec_init;
79 };
80 
82 {
83  GstVideoDecoderClass parent_class;
84 };
85 
86 GType gst_nvimage_dec_get_type (void);
87 
88 G_END_DECLS
89 
90 #endif /* __GST_NVIMAGE_DEC_H__ */
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: sources/includes/nvbufsurftransform.h:35
_GstNvImageDec::old_width
gint old_width
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:71
_GstNvImageDec::output_state
GstVideoCodecState * output_state
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:68
_GstNvImageDec::needs_pool
gboolean needs_pool
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:73
_GstNvImageDec::params
decode_params_t params
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:76
decode_params_t_::fmt
nvjpegOutputFormat_t fmt
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:59
_GstNvImageDec::nvimagedec_init
gboolean nvimagedec_init
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:78
_GstNvImageDec::old_height
gint old_height
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:72
_GstNvImageDec::input_state
GstVideoCodecState * input_state
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:67
_GstNvImageDec::gpu_id
guint gpu_id
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:74
_GstNvImageDec::height
gint height
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:70
decode_params_t_::nvjpeg_handle
nvjpegHandle_t nvjpeg_handle
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:55
_GstNvImageDec::format
GstVideoFormat format
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:75
decode_params_t_::stream
cudaStream_t stream
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:57
_GstNvImageDec::width
gint width
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:69
_GstNvImageDec
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:62
decode_params_t_::nvjpeg_state
nvjpegJpegState_t nvjpeg_state
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:54
decode_params_t_
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:51
decode_params_t_::nvjpeg_stream
nvjpegJpegStream_t nvjpeg_stream
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:56
_GstNvImageDecClass::parent_class
GstVideoDecoderClass parent_class
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:83
decode_params_t_::dev
int dev
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:52
decode_params_t
struct decode_params_t_ decode_params_t
_GstNvImageDecClass
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:81
_GstNvImageDec::parent
GstVideoDecoder parent
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:64
gst_nvimage_dec_get_type
GType gst_nvimage_dec_get_type(void)
_GstNvImageDec::pool
GstBufferPool * pool
Definition: sources/gst-plugins/gst-nvimage/gstnvimagedec.h:77