nvenc: Remove unused member variables
authorSeungha Yang <seungha.yang@navercorp.com>
Fri, 26 Jul 2019 15:57:02 +0000 (00:57 +0900)
committerSebastian Dröge <slomo@coaxion.net>
Tue, 6 Aug 2019 15:03:22 +0000 (15:03 +0000)
Supported interlace-mode and codec profiles are checked
during plugin init and those values are never used.

sys/nvcodec/gstnvbaseenc.h
sys/nvcodec/gstnvh264enc.c
sys/nvcodec/gstnvh264enc.h
sys/nvcodec/gstnvh265enc.c
sys/nvcodec/gstnvh265enc.h

index 6ef0fcd..606e9d7 100644 (file)
@@ -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 */
 
index d21f9b2..2876a35 100644 (file)
@@ -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);
 }
 
index 8ed6574..3ca1b46 100644 (file)
 
 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 {
index 82ae4a4..842b95c 100644 (file)
@@ -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);
 }
 
index 29fb36a..8ed7152 100644 (file)
 
 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 {