NVIDIA DeepStream SDK API Reference

9.1 Release
sources/gst-plugins/gst-nvimage/gstnvimageenc.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_ENC_H__
19 #define __GST_NVIMAGE_ENC_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 MAX_ENCODED_SIZE 15*1024*1024
29 
30 #define GST_TYPE_NVIMAGE_ENC \
31  (gst_nvimage_enc_get_type())
32 #define GST_NVIMAGE_ENC(obj) \
33  (G_TYPE_CHECK_INSTANCE_CAST((obj),GST_TYPE_NVIMAGE_ENC,GstNvImageEnc))
34 #define GST_NVIMAGE_ENC_CLASS(klass) \
35  (G_TYPE_CHECK_CLASS_CAST((klass),GST_TYPE_NVIMAGE_ENC,GstNvImageEncClass))
36 #define GST_IS_NVIMAGE_ENC(obj) \
37  (G_TYPE_CHECK_INSTANCE_TYPE((obj),GST_TYPE_NVIMAGE_ENC))
38 #define GST_IS_NVIMAGE_ENC_CLASS(obj) \
39  (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_NVIMAGE_ENC))
40 
43 
44 typedef struct encode_params_t_ {
45  int dev;
46 
47  nvjpegJpegState_t nvjpeg_state;
48  nvjpegEncoderState_t nvjpeg_encoder_state;
49  nvjpegHandle_t nvjpeg_handle;
51  unsigned int quality;
52  nvjpegOutputFormat_t fmt;
54 
56 {
57  GstVideoEncoder parent;
58 
59  /* < private > */
60  GstVideoCodecState *input_state;
61  GstVideoCodecState *output_state;
62  guint gpu_id;
63  GstVideoFormat format;
65  unsigned int encoded_size;
66 };
67 
69 {
70  GstVideoEncoderClass parent_class;
71 };
72 
73 GType gst_nvimage_enc_get_type (void);
74 
75 G_END_DECLS
76 
77 #endif /* __GST_NVIMAGE_ENC_H__ */
78 
cudaStream_t
struct CUstream_st * cudaStream_t
Forward declaration of cudaStream_t.
Definition: sources/includes/nvbufsurftransform.h:35
_GstNvImageEncClass::parent_class
GstVideoEncoderClass parent_class
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:70
_GstNvImageEnc::gpu_id
guint gpu_id
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:62
encode_params_t_::quality
unsigned int quality
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:51
encode_params_t_::stream
cudaStream_t stream
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:50
_GstNvImageEnc::params
encode_params_t params
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:64
encode_params_t_::fmt
nvjpegOutputFormat_t fmt
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:52
_GstNvImageEnc::format
GstVideoFormat format
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:63
gst_nvimage_enc_get_type
GType gst_nvimage_enc_get_type(void)
encode_params_t_::nvjpeg_handle
nvjpegHandle_t nvjpeg_handle
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:49
encode_params_t_::nvjpeg_encoder_state
nvjpegEncoderState_t nvjpeg_encoder_state
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:48
_GstNvImageEncClass
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:68
_GstNvImageEnc
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:55
encode_params_t_
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:44
encode_params_t
struct encode_params_t_ encode_params_t
_GstNvImageEnc::encoded_size
unsigned int encoded_size
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:65
encode_params_t_::dev
int dev
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:45
_GstNvImageEnc::output_state
GstVideoCodecState * output_state
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:61
encode_params_t_::nvjpeg_state
nvjpegJpegState_t nvjpeg_state
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:47
_GstNvImageEnc::input_state
GstVideoCodecState * input_state
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:60
_GstNvImageEnc::parent
GstVideoEncoder parent
Definition: sources/gst-plugins/gst-nvimage/gstnvimageenc.h:57