From b43d0f785cbfd079cac34a24b0cb7ab82125cd7f Mon Sep 17 00:00:00 2001 From: Seungha Yang Date: Sat, 27 Jul 2019 00:57:02 +0900 Subject: [PATCH] nvenc: Remove unused member variables Supported interlace-mode and codec profiles are checked during plugin init and those values are never used. --- sys/nvcodec/gstnvbaseenc.h | 4 ---- sys/nvcodec/gstnvh264enc.c | 20 -------------------- sys/nvcodec/gstnvh264enc.h | 10 ---------- sys/nvcodec/gstnvh265enc.c | 20 -------------------- sys/nvcodec/gstnvh265enc.h | 10 ---------- 5 files changed, 64 deletions(-) diff --git a/sys/nvcodec/gstnvbaseenc.h b/sys/nvcodec/gstnvbaseenc.h index 6ef0fcdf50..606e9d7601 100644 --- a/sys/nvcodec/gstnvbaseenc.h +++ b/sys/nvcodec/gstnvbaseenc.h @@ -97,10 +97,6 @@ typedef struct { * while we wait */ GThread *bitstream_thread; - /* supported interlacing input modes. - * 0 = none, 1 = fields, 2 = interleaved */ - gint interlace_modes; - void *display; /* GstGLDisplay */ void *other_context; /* GstGLContext */ diff --git a/sys/nvcodec/gstnvh264enc.c b/sys/nvcodec/gstnvh264enc.c index d21f9b22d0..2876a351a6 100644 --- a/sys/nvcodec/gstnvh264enc.c +++ b/sys/nvcodec/gstnvh264enc.c @@ -93,7 +93,6 @@ gst_nv_h264_enc_finalize (GObject * obj) static gboolean gst_nv_h264_enc_open (GstVideoEncoder * enc) { - GstNvH264Enc *nvenc = GST_NV_H264_ENC (enc); GstNvBaseEnc *base = GST_NV_BASE_ENC (enc); if (!GST_VIDEO_ENCODER_CLASS (gst_nv_h264_enc_parent_class)->open (enc)) @@ -117,31 +116,12 @@ gst_nv_h264_enc_open (GstVideoEncoder * enc) } } - /* query supported input formats */ - nvenc->supported_profiles = - gst_nv_enc_get_supported_codec_profiles (base->encoder, - NV_ENC_CODEC_H264_GUID); - if (!nvenc->supported_profiles) { - GST_WARNING_OBJECT (nvenc, "No supported encoding profiles"); - gst_nv_h264_enc_close (enc); - return FALSE; - } - return TRUE; } static gboolean gst_nv_h264_enc_close (GstVideoEncoder * enc) { - GstNvH264Enc *nvenc = GST_NV_H264_ENC (enc); - - GST_OBJECT_LOCK (nvenc); - if (nvenc->supported_profiles) - g_value_unset (nvenc->supported_profiles); - g_free (nvenc->supported_profiles); - nvenc->supported_profiles = NULL; - GST_OBJECT_UNLOCK (nvenc); - return GST_VIDEO_ENCODER_CLASS (gst_nv_h264_enc_parent_class)->close (enc); } diff --git a/sys/nvcodec/gstnvh264enc.h b/sys/nvcodec/gstnvh264enc.h index 8ed65748c2..3ca1b4650f 100644 --- a/sys/nvcodec/gstnvh264enc.h +++ b/sys/nvcodec/gstnvh264enc.h @@ -37,16 +37,6 @@ typedef struct { GstNvBaseEnc base_nvenc; - - /* the supported input formats */ - GValue * supported_profiles; /* OBJECT LOCK */ - - GstVideoCodecState *input_state; - gboolean gl_input; - - /* supported interlacing input modes. - * 0 = none, 1 = fields, 2 = interleaved */ - gint interlace_modes; } GstNvH264Enc; typedef struct { diff --git a/sys/nvcodec/gstnvh265enc.c b/sys/nvcodec/gstnvh265enc.c index 82ae4a4ccf..842b95cf8b 100644 --- a/sys/nvcodec/gstnvh265enc.c +++ b/sys/nvcodec/gstnvh265enc.c @@ -94,7 +94,6 @@ gst_nv_h265_enc_finalize (GObject * obj) static gboolean gst_nv_h265_enc_open (GstVideoEncoder * enc) { - GstNvH265Enc *nvenc = GST_NV_H265_ENC (enc); GstNvBaseEnc *base = GST_NV_BASE_ENC (enc); if (!GST_VIDEO_ENCODER_CLASS (gst_nv_h265_enc_parent_class)->open (enc)) @@ -118,31 +117,12 @@ gst_nv_h265_enc_open (GstVideoEncoder * enc) } } - /* query supported input formats */ - nvenc->supported_profiles = - gst_nv_enc_get_supported_codec_profiles (base->encoder, - NV_ENC_CODEC_HEVC_GUID); - if (!nvenc->supported_profiles) { - GST_WARNING_OBJECT (nvenc, "No supported encoding profiles"); - gst_nv_h265_enc_close (enc); - return FALSE; - } - return TRUE; } static gboolean gst_nv_h265_enc_close (GstVideoEncoder * enc) { - GstNvH265Enc *nvenc = GST_NV_H265_ENC (enc); - - GST_OBJECT_LOCK (nvenc); - if (nvenc->supported_profiles) - g_value_unset (nvenc->supported_profiles); - g_free (nvenc->supported_profiles); - nvenc->supported_profiles = NULL; - GST_OBJECT_UNLOCK (nvenc); - return GST_VIDEO_ENCODER_CLASS (gst_nv_h265_enc_parent_class)->close (enc); } diff --git a/sys/nvcodec/gstnvh265enc.h b/sys/nvcodec/gstnvh265enc.h index 29fb36a09d..8ed7152a61 100644 --- a/sys/nvcodec/gstnvh265enc.h +++ b/sys/nvcodec/gstnvh265enc.h @@ -38,16 +38,6 @@ typedef struct { GstNvBaseEnc base_nvenc; - - /* the supported input formats */ - GValue * supported_profiles; /* OBJECT LOCK */ - - GstVideoCodecState *input_state; - gboolean gl_input; - - /* supported interlacing input modes. - * 0 = none, 1 = fields, 2 = interleaved */ - gint interlace_modes; } GstNvH265Enc; typedef struct {